And then you have to rearchitect your data layer under extreme duress as your databases are constantly on fire.
So you really need to find the balance point and start doing it before your databases are on fire all the time.
And then you have to rearchitect your data layer under extreme duress as your databases are constantly on fire.
So you really need to find the balance point and start doing it before your databases are on fire all the time.
With that, you can start planning your rearchitecture if you're running out of upgrades, and start implementing when your servers aren't yet on fire, but are likely to be.
Today's server hardware ecosystem isn't advancing as reliably as it was 8 years ago, but we're still seeing significant capacity upgrades every couple years. If you're CPU bound, the new Zen2 Epyc processors are pretty exciting, I think they also increased the amount of accessible ram, which is also a potential scaling bottleneck.
But that's not how the real world works. The databases don't just slowly get bad. They hit a wall, and when they do it is pretty unpredictable. Unless you have your scaling story set ahead of time, you're gonna have a bad day (or week).
Usually, databases are pretty good at running up to 100%, though. And if you started with small hardware, and have upgraded a few times already, you should have a pretty good idea of where your wall is going to hit. Some systems won't work much better on a two socket system than a one socket system, because the work isn't open to concurrency, but again, we're talking about scaling databases, and database authors spend a lot of time working on scaling, and do a pretty good job. Going vertically up to a two socket system makes a lot of sense on a database; four and eight socket systems could work too, but get a lot more expensive pretty fast.
Sometimes, the wall on a databases is from bad queries or bad tuning; sharding can help with that, because maybe you isolate the bad queries and they don't affect everyone at once, but fixing those queries would help you stay on a single database design.
It can be an easy fix (buy more memory), but the first time it happens it can be pretty mysterious.
Your will implement new features, add new tables and columns, indexes, etc which will affect your data layer.
So just splitting up the heaviest part (eg. Catalog) into "a microservice" would be easy while I add nginx as load balancer. I already separated domain vs Integration Events.
Both now use events in memory in the application, I only need a message broker like NATS then for the integration events.
It would be a easy wall ;). I have multiple options like heavier hardware, splitting up the db from application server or splitting up a domain bound api to a seperate server.
As long as I don't need multimedia streaming, kubernetes or implement Kafka the future is clear.
Ps. Load balancing based on tenant and cookie would be a easy fix in extreme circomstances.
The thing I'm afraid for the most is hitting the identity server for authentication/token verification. Not sure if it's justified though.
Side note: one application has an insane amount of complex joins and will not scale :)