4 ms·
> So the question is, could you instead spend your "complexity budget" on actually optimizing the "app" layer? You definitely could, and I know people who have
by crazygringo 2y ago
> So the question is, could you instead spend your "complexity budget" on actually optimizing the "app" layer?
You definitely could, and I know people who have ported things from e.g. PHP or Python or Java to Go, so that a service that required 100 servers then only required 1. But it's just expensive -- the time it takes, and hiring people who can do that and maintain that.
And I only know of that having been done for services that were already in an extremely stable state, and not expected to change -- API endpoints, not HTML generators.
Generally speaking, the "app" layer is just changing a lot as features get tested and added and changed and swapped out, and dev cost is the priority, not server cost. And load balancing web servers is very easy.
> And connected to SQLite: Combine the fact that databases are just files, and that you can easily run "ATTACH <file>" to connect multiple database files on the same "connection", you should in many cases be able to design your overall structure to effectively "pre-shard" data.
Distributing a database that is read-only is easy, sure. It's the writes that are hard, and when you shard it's the joins between shards that give you headaches. If you work on a site where data from one user never has to be joined to data from another, then lucky you. ;)