Blog

Starting With a Monolith or Microservices: How New Technology Is Changing the Conventional View

Written by Jeremy H | February 3, 2021

Conventional wisdom says that new app development projects should begin as monolithic systems. This perspective suggests that you should wait until later to refactor the monolith into a microservices-based architecture — i.e., don’t use microservices until your use-case and scaling demands require them.

But is this viewpoint still correct? 

Modern API managers like DreamFactory are challenging the traditional viewpoint that suggests it’s always better to start a new system as a monolith. For example, with DreamFactory's automatic API generation tools and pre-built integrations for authentication services and other features, the traditional challenges associated with microservices — in terms of labor, time, overhead, and complexity — have all but disappeared.

In this guide, we’ll outline the traditional advantages and disadvantages of starting with monoliths vs. microservices. We’ll also look at how modern API management tools like DreamFactory are eliminating these barriers, making it easier, faster, and more affordable to start your development projects with microservices.

Did you know you can generate a full-featured, documented, and secure REST API in minutes using DreamFactory? Sign up for our free 14 day hosted trial to learn how! Our guided tour will show you how to create an API using an example MySQL database provided to you as part of the trial!

Start Building Your Microservices Now

Monoliths vs. Microservices: An Overview

Before we begin, let’s review what we mean by monolithic apps and microservices-based apps:

  • Monolithic apps: A monolithic system (or monolithic application) is the traditional way to develop an application. In a monolith, all of the features and services of the app are coded into a single piece of programming.
  • Microservices-based apps: A microservices-based system (or microservices architectural style) decouples the various features and services that make up a monolithic app. Then it runs each of these services separately, as an autonomous mini-application called a “microservice.” Each microservices typically run inside its own container (such as a Docker container). Finally, the individual microservices loosely connect and interact with each other through APIs. The API connections allow the microservices to work together to form the larger microservices-based application.

During the last 10 years, microservices-based applications have benefited global enterprises by providing them with massive scalability, greater agility, more highly available systems, and improved operational efficiency. Such benefits have enabled the phenomenal growth and global dominance of firms like Amazon, Netflix, Uber, and Etsy. Now, many businesses are trying to replicate the success of these corporations by developing microservices-based systems of their own. A recent DZone study points out that “nearly two-thirds of the organizations surveyed (63%) are building some (18%) or all (46%) of their applications using microservices.” 

Despite the popularity of microservices, the conventional view that it’s better to start with a monolith continues to persist. This is because of the traditional challenges related to developing a microservices-based app. These challenges relate to cross-cutting concerns, development complexity, skill-level requirements, and overhead. Even Martin Fowler (the father of the microservices movement), has written in support of this perspective: “You shouldn't start a new project with microservices, even if you're sure your application will be big enough to make it worthwhile… Almost all the successful microservice stories have started with a monolith that got too big and was broken up.”

The thing is, Fowler wrote this in 2015 — and these days the idea of starting with microservices is almost out of date. Today, technologies like the DreamFactory API manager are leveling the playing field when building microservices-based systems from the beginning, providing more options to the monolith or microservices decision. This technology is helping developers get their microservices projects to market faster, easier, and more cost-effectively.

How New Technology Is Overcoming the Challenges of Starting with Microservices

Let’s look at how new API management technology is changing the traditional disadvantages of starting your project as a microservices-based application.

Cross-Cutting Concerns

Traditionally, it has been easier to manage cross-cutting concerns with monolithic applications. Cross-cutting concerns are common in most applications. These may include concerns like persistence, caching, logging, security, rate limiting, error handling, fault tolerance, DoS protection, audit trails, etc. When all processes are happening within the same monolithic application, it’s a lot simpler to establish connections between cross-cutting concerns and different app components. This speeds up app development, traditionally making it easier and faster to bring a monolithic app concept to market.

With microservices, development teams will need to overcome challenges related to unexpected cross-cutting concerns. This could increase the costs of the development project if it is necessary to divert traffic through another service layer where you contain the cross-cutting concerns. Or, you may need to build a different module for each cross-cutting concern. This puts additional cost and time burdens on the initial development of the project. With monolithic architectures, cross-cutting concerns do not become an issue until after the system has been operating for some time. 

API gateways and API managers like DreamFactory can eliminate the challenges related to cross-cutting concerns. As Md Kamaruzzaman writes, “One possible way to solve these issues is to use an API Gateway. An API Gateway sits between the Client APP and the backend microservices and acts as a facade. It can work as a reverse proxy, routing the Client request to the appropriate backend microservice. It can also support the client request's fanning-out to multiple microservices and then return the aggregated responses to the client. It additionally supports essential cross-cutting concerns.

Complexity and Skill Level Requirement

When you’re managing the development of a single, monolithic application — as opposed to a network of independently running microservices — you only have to develop monitoring, logging, and testing for a single system. Therefore, monolithic applications are traditionally less complicated to develop. Also, they come with less operational overhead, making them faster, more affordable to develop, and less complicated to deploy than a microservices-based app.

The traditional complaint about microservices-based systems is that they are extremely expensive and complex to develop. The cost-saving advantages of microservices-based systems traditionally do not come into play until you’re dealing with a larger system with massive scaling requirements. Since each microservice usually runs within a container, it’s necessary to use a container orchestration tool (such as Kubernetes) to manage the deployment of containerized microservices and the distribution of resources across the system. For simpler, smaller-scale use-cases, this kind of system is traditionally too expensive to design and manage for startup use-cases. The need to code APIs and develop API integrations between the microservices adds further complexity and development delays. 

Finally, microservices traditionally come with an elevated skill-level requirement. Developing a microservices-based application requires a team with advanced skills pertaining to containers, container orchestration, and other specialties. The system will require constant monitoring and tweaking by these specialists. For example, development teams will need to watch latency issues closely and strategically tweak the distribution of resources across the microservices that comprise the system. Some teams may not have the required skills for these tasks.  

Fortunately, an advanced API manager like DreamFactory can overcome the traditional complexities and skill-level challenges that come with microservices. With DreamFactory, you can: 

  • Allows you to quickly and cost-effectively integrate pre-built microservices and other features into the projects you’re building. For example, DreamFactory empowers you to integrate services for authentication/authorization into app development projects in a matter of minutes.
  • Offers access to REST API generation tools that immediately generate fully Swagger-documented APIs for different apps and databases. This eliminates the time required to hand-code and document APIs for each microservices connection.
  • Empowers developers to focus on quickly creating a minimum viable product (MVP) as a single microservice, then rapidly complete the application by integrating the MVP with other microservices. The DreamFactory API manager offers pre-built APIs and manages API connections for the most popular services and databases. This allows you to add value and features to complete your development project quickly.

Did you know you can generate a full-featured, documented, and secure REST API in minutes using DreamFactory? Sign up for our free 14 day hosted trial to learn how! Our guided tour will show you how to create an API using an example MySQL database provided to you as part of the trial!

Start Building Your Microservices Now

DreamFactory: Making the Benefits of Microservices-Based App Development Down to Earth

Tech blogger Kristopher Sandoval encapsulates the benefits of microservices like this: “While we could use a megalithic, singular API, it brings with it a lack of portability, an absence of digestibility, and a difficulty in error checking and translation. By breaking up a service into separate functions and creating “mini APIs” for each that are strong enough on their own, but more powerful together, we create a suite of APIs that are portable, easy to check for errors, easy to implement, and in most cases simply better.

Traditionally, these and the many other benefits of microservices-based systems were not enough to overcome the challenges, complexities, and delays associated with building such a system. That’s why the conventional recommendation has been to “start with a monolith.” However, the DreamFactory API manager is changing this perspective, making it the monolith or microservices choice and easier decision.

With DreamFactory’s ability to auto-generate new REST APIs and establish and manage integrations between different microservices almost instantly, we have removed the most significant barriers, challenges, and delays associated with microservices app development. Want to see how easy it is to build a microservices-based system with DreamFactory? Contact the DreamFactory team and schedule a free hosted trial of the platform now!