Monolith ✅ vs Microservices ❌, a New Perspective
One main reason that people chose Microservices: Fear of Testing; Cannot do real UI Test Automation.
The two main topics of my writing: End-to-End Test Automation and Continuous Testing. I usually don’t share my views on software architecture. I consider myself a good software engineer/designer, as I won an international programming award. The concrete proof is a list of apps I have developed (and been maintaining, this is harder) all these years, in my spare time, solo.
The reason I am talking about Monolith or Microservices (two software architectures) here is: this is still about End-to-End Test Automation and CT, very much so.
What led me to write this article? The below news.
Please note that this case study was done (and released) in Amazon, which should embrace Microservices (so customers buying more instances). So, I was surprised to see it.
Microservices became popular about 5 years ago, I never liked it and never witnessed a successful implementation (always with all heaps of problems). It reminded me of the infamous Enterprise Java Beans (EJB). The so-called benefits sound good in theory, but not in practice.
You will find many “Microservices Pros and Cons” and “Microservices vs Monolith” articles online. Here, I will share a new fresh perspective.
A compromised view (between Microservices and Monolith fans) is that “Microservices is complex, introducing overhead (performance and infrastructure, i.e. more expensive) but it is more scalable”. I think both sides can accept that, right?
Table of Contents:
· 1. Most Web apps are not that complex, Monolith is more than capable in terms of performance, scaling, … etc
· 2. A technical compromise resulting from a limitation in its capability to perform comprehensive Automated End-to-End UI Regression Testing
∘ 1. “We don’t have the capability to do automated end-to-end (via UI) testing”
∘ 2. “API Testing shall be enough”
· Advice
1. Most Web apps are not that complex, Monolith is more than capable in terms of performance, scaling, … etc
I worked as a Java Contractor Programmer for over a decade on many projects, honestly, maybe only one or two of those apps can match the complexity of my-solo-developed-in-spare-time apps such as ClinicWise and WhenWise. All my web apps are powered by the Ruby on Rails framework, a Monolith architecture.
By the way, Ruby on Rails is the most in-demand skill according to Hired’s 2023 State of Software Engineers Report.
Some would argue “Your apps would be more scalable if using a Microservices architecture”.
Maybe, but I have always been satisfied with the performance and scalability of my apps. For a Micro-ISV (independent software vendor), infrastructure cost can hit me hard, by using Ruby on Rails (Monolith), a complete production server set-up (for one app) costs me merely ~80/month.
two MySQL database server instances
(one is primary, and the other is mirrored)two app server instances
(one primary, the other for failover)one shared Redis server
(caching and background processing)one load-balancer
(Nginx)
FACT: there have been big advancement in CPU manufacuting (by TSMC), we get faster and faster CPUs & memory & hardrives.
Yes, My apps don’t have a big number of users. If my apps suddenly get a lot more customers, this is a good problem to have, upgrading to faster server instances (up to 20X powerful) is very easy. No changes to the software.
Moreover, setting up testing server instances is very easy, all my existing Mac Minis, basically free.
As you can see, the hyped better scalability by microservices architecture is pale compared to the huge real infrastructure savings every month to my apps: ClinicWise, SiteWise, WhenWise, SupportWise and TestWisely.
Some “Microservices fans” will immediately think “That’s because the volume to your apps is still small”. Yes. How about Github and Airbnb, both developed in Ruby on Rails (Monolith)? Surely your app won’t match even the 0.1% scale needs of Github.
For most apps, the hyped Microservices benefits are not realized, but the cost and complexity are real. Monolith architecture, if done decently, is comfortably capable to scale to a level that 99.99+% apps never need, and cost only a little extra.
So, what is the fundamental reason that some software companies adopted Microservices? Putting aside the silly chasing hype, it is Testing!
2. A technical compromise resulting from a limitation in its capability to perform comprehensive Automated End-to-End UI Regression Testing
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.