by zackify · 2y ago · 0 comments
I’ve been using liteFS in production for a couple months.
Your web app is able to resolve db queries instantly.
You don’t need loading states if you’re using complex charts and other frontend JS that waits for data.
All the data is resolved so fast and you can just return all your data like more traditional apps, and the load times are insane.
If you’re multi region you can deploy one app instance there. Instead of 2-3. Postgres read replica, maybe something like redis.
It really replaces both of those, assuming you have a read heavy app it works great.
Or a slow anything else, e.g., SQLite queries. This thread has focused on the network aspects, and they do stand out since there can be such a large gap between a network call vs a local SSD read. But we're still talking about a database, which could be huge (presumably it's the main, single DB for the whole app). And there is still all of the actual SQLite work that needs to happen to execute a query, plus opportunities for really bad performance b/c of bad queries, lack of indexes, all the usual suspects. Not to mention the load on the owning process itself. So, I'm agreeing that a loading state is needed.
All data for one customer that is important enough to load easily fits within less than 5MB. That is of course not counting logs and such, but it's all "important" user-specific data. It's not -that- dissimilar from a small to medium-sized redux store in complexity. Lots of toggles, forms, raw text and some relations.
Of course this architecture doesn't scale to the enterprise level, or to other certain heavily data-driven applications (like imagine running the entirety of your sentry database in-browser?), but that's what architecture is -for-! Pick one that synergizes well with your use-case!
SQLite, on the other hand, skips all of that with its simple in-process model.
> LiteFS’ use of FUSE limits the write throughput to about 100 transactions per second so write-heavy applications may not be a good fit.
https://fly.io/docs/litefs/faq/#what-are-the-tradeoffs-of-us...