Why Distributed Apps Need Dependency Management

Distributed cloud applications (aka microservices) have introduced an enormous amount of complexity into the design and operation of cloud software. What used to manifest itself as complexity hidden within a single process or runtime now finds itself spread across tens or hundreds of loosely coupled services. While all of these services can use different languages and can scale independently from one another, the distributed nature can often make the app as a whole hard to navigate, hard to deploy, and hard secure.

This new complexity makes it increasingly difficult to manage and contribute to cloud-native applications and beckons questions as to how we can maintain healthy cloud software. How can we take advantage of the benefits of service-oriented design without introducing friction and cost elsewhere?

How to Use Ballerina Local Repository

The need for overriding dependencies in a programming language is a fundamental need for many scenarios. Here we are discussing how to override dependencies in Ballerina. If you are new to Ballerina, I recommend you to play with it before reading this article. You can find everything you need in the Learn section of Language’s website.

Let’s start! Think you are working on a library that is used in a larger critical application, and you want to test a bug fix for this library inside of the larger application. Then it’s crucial to test it before publishing this library to a public package repository like Ballerina central. This is where the Local Repository comes into the picture. Also, you can use it in the following scenarios:

Distributed Apps Need Dependency Management

This post was originally published as Why distributed apps need dependency management on the Architect.io blog on September 16, 2020.

Distributed cloud applications (a.k.a. microservices) have introduced an enormous amount of complexity into the design and operation of cloud software. What used to manifest itself as complexity hidden within a single process or runtime now finds itself spread across tens or hundreds of loosely coupled services. While all of these services can use different languages and can scale independently from one another, the distributed nature can often make the app as a whole hard to navigate, hard to deploy, and hard secure.

Building Java Applications With Maven

Check out this stellar Java tutorial on building applications with Maven.

As developers, we spend just as much — if not more — time working on tasks that support our code rather than writing the code itself. This includes writing test cases, creating build and deployment scripts, structuring Continuous Integration (CI) and Continuous Delivery (CD) pipelines, and managing the external dependencies that our projects rely upon. If handled incorrectly, these supports can grind our application development to a halt — regardless of how well our code is written.

Over the years, numerous tools have been developed to reduce the burden on developers, and many have become nearly as indispensable as programming languages themselves. In the Java ecosystem, one of the most popular of these tools is Maven. Maven is a management tool for Java (and Java-based languages) that has become so widely used that tens of millions of binaries from Maven projects have been packaged and hosted for public use.

Dependency Management and Versioning With a Maven Multi-Module Project

In this article, we are going to look at how to implement a multi-module project in Maven with versioning and dependency management, as well as the best practices for building big, large-scale projects from both a developer perspective and a DevOps/management perspective.

However, if you are not familiar with Maven, I highly recommend reading this article first and getting some experience using Maven. This article will not cover Maven basics.

Starting With Apache Maven

Apache Maven is a build or a total project management tool that scores over its predecessors such as ANT for Java builds with the following advantages:

  • Useful when multiple JAR files are required for builds
  • Resolving recursive dependencies during build time
  • Creating project structures that are standardized
  • Building, publishing, and deployment of applications
  • Supports lifecycle of an application along with plugins

I have created an alumni project that is a dynamic web archive with a Servlet that says “Hello, Alumni”.