by Dave3of5 · 3y ago · 0 comments
Why are more and more devs trying to use s3 as a general purpose DB?
Working on a system right now where the architects have made this mistake it has insanely poor performance (High latency) and lack any proper ACID compliance. I've now been asked to "make it faster" and the answer is to switch back to an actual DBMS.
> Top tier SaaS services like S3 are able to deliver amazing simplicity, reliability, durability, scalability, and low price because their technologies are structurally oriented to deliver those things. Serving customers over large resource pools provides unparalleled efficiency and reliability at scale
In terms of simplicity using s3 is anything but simple. Sure the CRUD api is simple but there are a bunch of gotchas. What about transactionality, partial updates, running multi document queries, consistency of the whole set of documents. You have to rewrite a whole DBMS on top of s3 itself or use redshift to get these things.
In terms of scalability there are, limits 3500rps per key prefix.
It's actually not lower price than a DBMS when you have a lot of data.
The missing link is really a serverless postgres (which many are working on but nothing has impressed me so far.
It can be very attractive to teams who don't want to have an internal expert for all that, or to buy huge hardware to deal with spikes in activity that only happen occasionally⁰. Just being able to spin up a large DB for some tests without worrying about available space, how much it will compete for this like CPU/IO with your other DBs¹, etc, can be very convenient.
It can work out quite expensive in terms of price/performance ratio, if those factors are not a benefit to you.
----
[0] or happen regularly but usually for only a short time
[1] usually these things are capped, or have a burstable cap, so “noisy neighbours”² are not the huge problem they can often be on cheap shared hosting
[2] unless you have explicitly pooled resources (like Elastic Pools for Azure SQL) without per-object limits, in which case your own activity could be harmful noise
One example of "serverless postgres" in my opinion would mean data is on a blob store and you only pay when running queries and for the static storage.
Basically snowflake's pricing model.
Used AWS Aurora Serverless v2 (MySQL) and it worked pretty good actually never used the postgres version but it's now available.
Sure, there is the benefit of being able to dump your cold data in cheaply and read flexibly, but... the dev ux is just PITA.
No, you get a DBMS and only change the storage underneath. You can't use S3 for appending to WAL though.
All those can be fixed besides the latency for a cold GET from S3 and appending WAL to S3.
I think what you mean is what we have implemented a side channel DBMS which holds a copy which you use for the transactionality. It's a terrible approach I would not do this at all you don't get any benefit from using s3 here.
This is not to say you can't use s3 to pull large blob storage off the DB and reference it in the DB I'm talking about the entire DB as s3.
Yes, it can be done, except for WAL append & COLD GET. You "just" have to re-architect everything in the storage layer.
Do you have anything specific in mind besides the 2 things I mentioned?
I already said my points about the problems your follow-up comments have not addressed those.
Also there is no such thing in s3 as a cold GET there is a cold startup for a lambda. The latency from s3 on a get is orders of magnitude poorer that EBS or LSSD and should be used "infrequently".
See warpstream as example https://news.ycombinator.com/item?id=37036291