Which Is Right for Your SaaS Application?

In the first part of this blog series we covered the basics of what Software as a Service solutions are and what they are used for. Now let’s see how you can build them. A microservice architecture is particularly useful for SaaS applications, but are microservices always the right choice? To the user both monoliths and microservices provide the same experience, but for app developers and companies, the proper choice of application architecture can make a big difference.

Let’s revise the differences between monoliths and microservices.

What Is a Monolith?

A monolith is a piece of software with a broadly defined role, such as an E-commerce store, content management system, search engine, data management system, etc. It puts all business logic in one single package – a monolith.

When developing a monolithic application, all functionalities are developed as a single unit in which the parts depend on each other to work properly.

The Pros of Monoliths

  • Monoliths are easier to build and deploy. Deploying a monolithic aplication can be as simple as copying the code to a folder on the server. Developers can focus on building features that meet business goals rather than building complex deployment and testing pipelines
  • Faster initial setup. Microservices have upfront costs in money and time that monoliths do not.

The Cons Of Monoliths

  • Monolithic applications are easier to get up and running than microservices, but problems tend to present themselves as the application grows and matures.
  • Modification becomes increasingly difficult
  • Monoliths are a single point of failure – When part of a monolithic application breaks, the whole app is likely to go down. If a microservice breaks, then only part of the application stops working. Which means that microservices are more resilient than brittle monoliths

What are microservices?

When using microservices, instead of building all of the functionalities in one single unit, they are broken down into small pieces (services), each of which has a well-defined role.
Microservices communicate via API’s, and each microservice consumes API calls from other services. Additionally, each microservice can have an independent database.

The Pros of Microservices

  • Decoupled services are easier to modify – You can always modify just one service. Services are easier to understand and evolve than the application as a whole. Additionally, you don’t need to test and redeploy the whole applications, or worry about hidden dependencies.
  • Services scale independently – While monolithic apps can be difficult to scale horizontally especially if the whole app depends on a single database, microservices can be scaled or duplicated depending on the needs of the individual services.
  • Microservices let you use different technology stacks, which means you can choose the language you want to build a service with, regardless of the languages used to build the other services in that same application.

The Cons of Microservices

  • Microservices can increase complexity – You will probably end up with dozens of services that require independent CI/CD pipelines and hosting infrastructure, so you will be spending significant time for deployment and infrastructure instead of improving the app
  • Take longer to get into production – Because of their complexity they require up-front planning and preparation
  • Additional service layer or extra services can complicate the development process

The choice

Although both monoliths and microservices have benefits, neither is the perfect choice for every scenario and you should consider which fits your team and project best. In order to do that, there are some generally applicable guidelines, so it’s important to consider the following:
For proof-of-concept and minimum viable product projects, a monolithic application will allow a development team to get code into production more quickly
Established organizations with larger teams may benefit from a microservices approach that divides the application between development teams, each responsible for a single encapsulated service

Stay tuned for the next blog where we will talk about API Gateway in SaaS applications.

Author avatar

About Vladimir Tomanovski

was part of Keitaro