|
|
|
|
|
by bob1029
1798 days ago
|
|
To me, the more fundamental problem is the fact that we spread state across multiple computers. If you only mutate state on the server and simply send views back down to the clients, nearly all of "modern" web development practices can be safely ignored. Clearly, there are difficult engineering challenges with the approach of "all state on the server all the time", but anything worthwhile is never easy. Down this path you might not obtain Netflix-tier webscale directly out of the box, but that doesn't mean we throw our hands up and have all our clients drown in multiple megabytes of angular11+ dependency trash either. How many internet users are more than 50ms away from a Cloudflare/Microsoft/Google/Netflix CDN in 2021? How many cores can you get in a 1U server now? Distributed state machines for client UIs have been a massive mistake. |
|
I think it's important to define early in a project if the app is "cloud-based" or "local-based". If it's cloud-based, then only the server mutates state and sends views to the clients, as you wrote. Everything is simple. If it's local-based, then all data are available locally and mutated locally. The cloud is only used as mirror/backup and can support for some advanced features like full-text search. That's also a very clear architecture. That's how Linear works.
Things become hairy and unnecessarily complex when no clear choice is made between those two options, then it's not clear where the state is.