Hacking SaaS #27 - Toward lower latency SaaS
Hacking SaaS is back with interesting readings (and viewings) for SaaS developers - CRDTs, CDNs, re-invent and more.
Let’s start by addressing the elephant in the room. Hacking SaaS was somewhat missing in action due to an elephant. The elephant happens to be Postgres. Or rather, a Serverless Postgres for Modern SaaS. This is to say that if you haven’t seen it yet, my startup’s product has finally launched. If you are curious, you can read the announcement or a code snippet that shows what we are about.
Now, let’s get back to our regular hacking.
Collaboration without CRDTs
Collaboration is still a major trend in SaaS. Both because this is how humans want to work and because if you do it right, it can lead to significant growth in your active users - a key SaaS KPI.
The problem with implementing collaboration was always that to minimize latency, you don’t want to synchronize and queue up every single mouse movement or keystroke that each user makes. Ideally, you want to let each user work as if they are completely alone and then merge the results—kind of like how git handles commits.
Until very recently, the gold standard for merging results was using CRDTs. And good papers were written about applying CRDTs in various real-world scenarios. My favorites are Martin Klepmann’s Local First and Christopher Meiklejohn’s Red Wedding Paper.
However, despite all attempts at friendly SDKs, CRDTs remained challenging to reason about and use in practice. Recently, smart engineers started asking whether anyone uses them in real life and, if not - what the best collaborative SaaS does instead.
“Collaboration with no CRDTs” is a great TLDR on the topic - summarizing when you need CRDT and what you can use instead, with tons of real-world examples. The Hacker News discussion is surprisingly informative as well.
The holy grail of SaaS performance is to be as fast as running the same software locally on your machine. If your app is in `us-west-2` and your user is in Ipswitch, UK, it is unlikely to happen due to network roundtrip latency.
With solutions like Cloudflare Workers, you can deploy your application to the edge. Companies like Vercel are trying to make this deployment super easy.
But… if your database is still on `us-west-2`, did you solve anything? The unintuitive answer is that you probably did. If not, you may be able to make a few changes in your app architecture and get significant improvements in the latencies your users perceive.
Th3o has a short and simple video explanation of the problem and why you don’t need to move everything to the edge right away.
Netflix has an in-depth InfoQ presentation on massively reducing latencies without storing data on the edge - by using CDN as a proxy.
It was last week, but I only partially caught up. Topics that showed up on my radar are:
There was probably a lot more! Help me catch up by sharing the best Re: Invent announcements in the SaaS Developers Slack.