Skip to main content

On This Page

Monolith vs Microservices: Why Tech Giants Are Returning to Monoliths (And Why You Should Consider It Too)

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

The $4.5 Million Question Nobody’s Asking

In 2023, Amazon Prime Video made headlines—not for launching a new feature, but for abandoning microservices and returning to a monolithic architecture, saving 90% on infrastructure costs. This move challenges the long-held belief that microservices are the optimal solution for scalability and highlights the hidden costs of distributed systems.

Why This Matters

The industry has often treated microservices as a default solution, overlooking the significant operational overhead and complexity they introduce. While ideal models suggest microservices offer independent scalability and fault isolation, the reality is that for many organizations, these benefits are outweighed by the increased costs of development, deployment, and maintenance, potentially costing millions of dollars annually.

Key Insights

  • Amazon Prime Video saved 90% on infrastructure costs by reverting to a monolith, 2023.
  • The “Saga pattern” is often required in microservices to manage data consistency, increasing complexity.
  • Tools like Temporal are used by companies like Stripe and Coinbase to manage the complexities of distributed transactions.

Working Example

# Monolith Example: Simple function call
def get_user_orders(user_id):
    user = get_user(user_id)
    orders = get_orders_for_user(user.id)
    return orders

def get_user(user_id):
    # Database query to fetch user details
    return User(id=user_id, name="Example User")

def get_orders_for_user(user_id):
    # Database query to fetch orders for the user
    return [Order(id=1, user_id=user_id, amount=100)]

class User:
    def __init__(self, id, name):
        self.id = id
        self.name = name

class Order:
    def __init__(self, id, user_id, amount):
        self.id = id
        self.user_id = user_id
        self.amount = amount

Practical Applications

  • Shopify: Successfully utilizes a modular monolith to handle billions in GMV and scale efficiently.
  • Pitfall: Prematurely adopting microservices can lead to increased development time, operational complexity, and ultimately, slower feature delivery.

References:

Continue reading

Next article

New StackWarp Hardware Flaw Breaks AMD SEV-SNP Protections on Zen 1–5 CPUs

Related Content