Monolith vs Microservices - What Interviewers Are REALLY Testing


Hello Reader,

"Are microservices better than monolith?" - this is a very popular interview question and real world project topic.

Another variation of this is asking differences between monolith and microservices. Let me clear something up right away: monolith is not the bad guy.

When I conducted hundreds of interviews at AWS as Principal Solutions Architect, I have seen candidates walk into interviews ready to trash the monolith and declare microservices the winner.

That is the wrong move.

And it signals to the interviewer that you have read blog posts, not built real systems.

In today's edition, we will go over pros and cons of both monolith and microservices, and finally give you a delightful answer for the interview.

The Monolith - What You Need to Know

A monolith is a single-codebase application where all your business logic lives together. One JAR file, one deployment, one unit. At small scale, this is actually a strength - simple, no over-engineering, resource efficient.

The problems emerge as you grow - scaling becomes all-or-nothing.

If your product listing service gets hammered with traffic, you can't scale just that piece - you scale the whole thing. You are spinning up two full copies of a massive application to handle load on one small function. That costs money.

Release cycles slow down.
Touching one module means testing everything.
The business slows down to match the code.

The Microservice Advantage (and disadvantage!)

With microservices, each function has its own codebase, its own deployment, its own scaling rules.

Your /buy service can run on a Lambda which don't need to scale as much.
Your /browse service runs on EC2s with Auto Scaling Group, ready to scale upto higher number as traffic goes up.
If /browse traffic spikes, only that service scales, leaving the Lambda alone.

Pros:

  • Each microservice can scale independently
  • Each microservice can be written (and managed) with different tech stack. For example, in the above diagram /browse backend is written in Python, whereas /buy backend is written in Javascript. this feature is called polyglot
  • Testing, deploying, implementing governance becomes much easier because each service is independent of each other

Cons:

  • Increased complexity with multiple backends and codebase
  • Implementing observability is harder. If a user operation invokes multiple services, you need to have a way to correlate them in case something goes wrong
  • More operational overhead of managing multiple services, and related CICD pipelines

Now that we are starting to realize that both monolith and microservice have strengths and weaknesses, let's look at a good interview answer to the original question - "Are microservices better than monolith?"

The Delightful Answer

Average candidate: "Microservices are better because they scale independently."

Delightful candidate: "It depends on where you are in the product lifecycle.

Monolith makes sense early - less operational overhead, faster iteration. As scale demands grow and teams expand, monolith becomes more expensive and time to market becomes slower.

Microservices becomes more suitable in this case.

However keep in mind that microservices have some considerations as well.

As an Architect, I will consider those factor choosing between monolith and microservices."

That answer shows judgment. Judgment is what gets you hired.

Your turn: Have you had to defend a monolith decision at work, or convince a team to move toward microservices? Hit reply - I'm curious what you ran into.

Keep learning and keep rocking 🚀,

Raj

P.S - If you want to get an AWS Solutions Architect job without coding or learning every AWS service, the 8th cohort for AWS SA Bootcamp is launching on May 16th, 12 PM ET (Eastern Time) via live webinar. Please register for the webinar below:

Here’s what you get when you show up LIVE:

  1. My exclusive Solutions Architect framework to prep you for today's job market! But if you’re not live, you won’t get it. No second chances.
  2. Full bootcamp details, my new stealth product reveal to help you prepare better, AND a special offer for live participants only.
  3. You will have the chance to interact with me and ask questions.

And good news - it already worked for last cohort's students who secured cloud jobs in top companies, including at AWS, Microsoft, Google, JPMorgan, Reddit, and some of them didn't even have cloud experience 💰.

Spots are limited, so don't miss it!

Fast Track To Cloud

Free Cloud Interview Guide to crush your next interview. Plus, real-world answers for cloud interviews, and system design from a top AWS Solutions Architect.

Read more from Fast Track To Cloud

Hello Reader, As a former Principal Solutions Architect at AWS, and Distinguished Cloud Architect at Verizon, I conducted 300+ interviews. And every cloud interview has this question. Every. Single. One. "How will you make your application scalable for a big traffic day?" And almost every candidate gives the same answer: "I'll use an Auto Scaling Group with EC2s and a load balancer to distribute traffic." Technically correct. Completely average. Three years ago that answer was fine. Today it...

Hello Reader, The way agents are built just changed. AWS published a new library this week that lets you write prompts directly inside your code, and the LLM generates the actual logic at runtime. Just a comment describing what you want. Here is what that looks like in practice. Instead of writing a full Python function to pull 30 days of stock data from Yahoo Finance, you write one line: "Use the Yahoo Finance Python package to retrieve the historical price of the stock in the last 30 days."...

Hello Reader, Not all System Designs are created equal! To make matters complicated, there are so many designs out there. As a former Principal Solutions Architect at AWS and Distinguished Cloud Architect at Verizon, I have taken over 300+ interviews, and I have seen three patterns coming over and over in interviews. In this newsletter edition, we will go through 3 System Design patterns that appear the MOST in cloud interviews and actual projects. If you nail these 3, you will be ahead of...