Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Is the monolith a problem? - RubyConf India 2025

Is the monolith a problem? - RubyConf India 2025

presented at RubyConf India 2025

Note: somehow link looks not working on the preview above, please download the PDF or check the original slide below

original slide: https://docs.google.com/presentation/d/e/2PACX-1vSfwex80cV7tvly2yc7llQaRDPPuxslS4ueCtZariDAB5pZocTGbaI0tncrdp7bd4EICCgrxu78Q4_0/pub?start=false&loop=false&delayms=3000

Avatar for Chikahiro Tokoro

Chikahiro Tokoro

September 15, 2025
Tweet

More Decks by Chikahiro Tokoro

Other Decks in Programming

Transcript

  1. Shape the Future of Business Travel The first Travel and

    Expense Management solution that truly digitally maps all areas of a business trip from end to end. From booking to invoicing!
  2. The monolith was blamed for last decade… Not scalable Complex

    and hard to debug Deployment bottleneck Not clear boundary Difficult to maintain
  3. The monolith was blamed for last decade… Not scalable Not

    clear boundary Difficult to maintain Deployment bottleneck Complex and hard to debug
  4. Scaling up the Prime Video audio/video monitoring service and reducing

    costs by 90% - 2023 Freedom Dumlao on X - 2024.09
  5. Rails World 2023 Opening Keynote - David Heinemeier Hansson The

    End of Programming as We Know It - Tim O’Reilly AI boom masks fundraising struggles for non-AI startups - Techcrunch
  6. CI / Deployment Language Monolingual Multilingual Slow Fast Simple Complex

    Infrastructure Latency Tracing Scaling Boundary Low High Single instance Multiple instances Clear Vague scale up (vertical) high cost, limited, Inefficient scale out (horizontal) low cost, unlimited, efficient
  7. Building Microservices, 2nd Edition - Sam Newman: 1. What Are

    Microservices? - Should I Use Microservices? 2000 engineers, 2 millions lines of code: the history of a Rails monolith - Cristian and Anatoly | EuRuKo 2024
  8. 2014 2025 2004 1998 Macro trends in the tech industry

    | April 2024 | Thoughtworks Modular Monolith
  9. 2014 2025 2004 1998 Macro trends in the tech industry

    | April 2024 | Thoughtworks Modular Monolith
  10. Tight coupling / Poor cohesion Antipattern: Single object knows/does too

    much What’s the God Object (Class) ? Hard to change, buggy Not clear boundary / Tangling e.g. Changing User Registration logic break Payment feature 😱
  11. Not scalable Deployment bottleneck ✅ ✅ The monolith was blamed

    for last decade… Difficult to maintain Complex and hard to debug Not clear boundary Those are characteristics of God Object!
  12. DRY ~ Don’t Repeat Yourself ~ “Every piece of knowledge

    must have a single, unambiguous, authoritative representation within a system.“ NOT for the code!! 1. Better Model Design
  13. understand DRY Customer Document type: invoice / receipt Invoice Receipt

    Receipt should be issued after invoice was paid use STI
  14. understand DRY Customer Invoice Receipt Invoice can only be issued

    for company Document type: invoice / receipt
  15. understand DRY Customer Invoice Receipt Company After issuing invoice, it

    should generate PDF Document type: invoice / receipt
  16. understand DRY Invoice Receipt Customer This is a similarity! Code

    duplication might be coincident Invoice and Receipt are different (domain) knowledge
  17. Example: complex Order model Order status: new / ordered /

    paid / fulfilled / shipping / finished Order cannot track multiple Shipments Mixing Domains: Process / Payment / Fulfillment / Shipment Changing Order needs re-Payment Order Shipment Shipment Shipment Basket Payment Order Related Order needs another Order etc….
  18. Order status: new / ordered / paid / fulfilled /

    shipping / finished Shipment Shipment Shipment Order status: new / ordered / paid / fulfilled Track multiple Shipments No need to re-payment Make multiple Orders Order Shipment Shipment Shipment Basket Payment Order Shipment Shipment Shipment Order status: paid / fulfilled Basket Order status: paid / fulfilled 2. Refactoring God Object
  19. Is the monolith a problem? No The problem is often

    “God Object” there is a tendency to blame the technology the issue of modeling
  20. To fix “God Object” 2. Refactoring: Incremental release with business

    merit 1. North star modeling: understanding DRY + DDD Feature Flag (Canary release) Shadow Traffic (Parallel adoption) Strangler Fig (Phased implementation)