2 ms·
Yeah, the headline isn't great, but it's describing something real that database service providers are working on. You're right that the question is whether yo
by skybrian 3y ago
Yeah, the headline isn't great, but it's describing something real that database service providers are working on.
You're right that the question is whether you want the high-latency link to be between the web browser and the web backend, versus the web backend and the database.
Either way works; it's just a matter of where you're going to spend effort reducing round trips. For database driver developers, optimizing for minimizing round trips is new, but they're making progress. As an app developer, you can use stored procedures to reduce round trips, or even have app logic in both places.
As you say, serving a result from an edge cache is a way to avoid any database round trip. This brings up issues around cache invalidation that haven't really been tackled yet; with Postgres you could use listen/notify, but it assumes a persistent connection that isn't there for these new drivers.
An alternative would be to use read-only database replicas, but that seems relatively heavyweight compared to a bit of local caching.
- ppeetteerr 3y agoYeah, DB replication and caching would be a pain in this scenario. Akamai cache busting is challenging enough in complex cases. I can also imagine how you can have localized datasets with a centralized auth database, for instance. That way, you have something akin to sharding of the dataset to bring real-time functionality closer to a global user-base. For example, you can have an edge game server with a local state serving 20-30 players close to their physical location. I wouldn't recommend this for 99% of web development tho.