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

Splitting the Monolith

Splitting the Monolith

The story of a monolithic application that has been modified into a distributed system.

Enrique Zamudio

March 07, 2019
Tweet

More Decks by Enrique Zamudio

Other Decks in Technology

Transcript

  1. Who? • Working as a programmer since 1994 • Working

    with Java since 2000 • Java Champion in 2015 • Working on this project since 2017
  2. The monolith • PHP-based system • Mostly web-based • Incoming

    calls are endpoints • cronjobs are methods in the same codebase, run from CLI • Redis as DB • Running on traditional servers
  3. Current situation • PHP is hard to maintain and test

    • Current architecture not very scalable • Particularly with manual setup • Anticipated growth
  4. The project • Migrate data to RDBMS • PostgreSQL •

    Migrate logic to services in Java (the split) • Put those services in containers • Manage those containers
  5. Why? • Moving to PostgreSQL is a priority • ACID

    • Querying • Low impact on PHP codebase
  6. Unexpected growth 2017 • 18K users in January • 200K

    users in November 0 50 100 150 200 January May June November
  7. Distributed system • Dedicated services calling each other • Kubernetes

    helps a lot • Redundancy, deployment, no downtime on upgrades, etc • Monitoring is trickier – observability • RDBMS is a SPoF • Tradeoffs are worth it • DB proxy service is another SPoF, but it's temporary (hopefully)
  8. What's next? • Finish migrating data to PostgreSQL • Leave

    Redis just for queues and caching • Start migrating higher-level logic to Java • This eliminates low-level DB calls from PHP • Which eliminates the need for models in PHP • Which eliminates the need for the DB Proxy service • Services talking directly to the database
  9. ¿?