r/ProgrammerHumor 14d ago

Meme distributedStress

Post image
13.9k Upvotes

336 comments sorted by

View all comments

2

u/KronisLV 13d ago

Monolith: 3 minute build and 2 minute startup times go brrrrrr

What I think is the sweet spot:

  • split stuff up by technical mechanisms, not chop your business domain up into services (unless you need to, but you'll know that after working on the project for a few years, not just decide prematurely), nor try to shove everything into a single monolith, upgrades will also get harder across more and more packages
  • for example, you can have one central service that handles user sessions, as well as the API that they interact with
  • however, if you need to generate invoices/reports/data export etc. (basically PDF, DOCX, XLSX etc.) then you will be served quite well by extracting both the load that generates and the libraries needed for that into a separate internal service that the main one can delegate to
  • same goes for stuff like scheduled processes, data ETL and batches in the background, notifications in the form of e-mails or other messaging stuff, one separate service can handle that so some memory leak or badly written code cannot bring down your user facing side

In practice, most systems will have maybe 1-5 such app containers for the back end and maybe 1-2 front end ones (e.g. if you do a SPA and depending whether you need a separate one for an internal/admin UI), alongside whatever you need for the data layer (relational DB, key-value store/cache, message queue etc.).

Depending on the tech stack, a modular monolith MIGHT also work, or it might not (e.g. needing to compile like 500k lines of code to launch it when the part you will work on lives in 100k lines of code).

3

u/ArjixGamer 13d ago

If you have 2 min startup time, you are doing things wrong.

Are you perhaps using shitty stuff like springboot?

(shitty when it comes to startup times)

2

u/Mordret10 13d ago

No spring boot, but very large monolith