4 ms·
Doesn't the same argument apply even more to using SQLite instead?
by andai 2mo ago
Doesn't the same argument apply even more to using SQLite instead?
- seki285 2mo agoIn a lot of cases using SQLite means you write queries incompatible with RDBMS. No need to worry about race conditions or the amount of queries you make, when 100 selects are uber fast.
- SoftTalker 2mo agoYes, for very small or embedded, single-purpose systems sqlite is usually a good choice. It's very well tested, and there's nothing extra to run or manage. But be careful if the system starts growing beyond that, you'll want a real RDBMS before you abuse sqlite too much.
- Lio 2mo agoDepends on what you mean by "small" and "growing". If you mean database size, SQLite can handle massive amounts of data. I've seen 281 TB quoted as theoretical max size.
- pojzon 2mo agoHow does it handle 100000 write transactions per second ? From multi-client architecture and with regional HA?
- crazygringo 2mo agoNot really. They are two different paradigms. Use the one that is right for you. SQLite is embedded for local applications with one writer mostly. Postgres is for a client-server architecture with many writers. When you start a project, you generally know which architecture you need.
- andai 2mo agoSo if it needs to work offline, but it syncs with a server, then you use both? (And the schema becomes some kind of lowest common denominator?)
- preg_match 2mo agoI would probably do an event-source architecture, where you record events on the client and then push them to the server when you're reconnected. It has a lot of benefits, for instance, trivial auditing and free serialization.
- theultdev 2mo agoyeah essentially, see electricsql though they also have "pglite" running in wasm. same concept though, sync slices to an embedded db.
- LAC-Tech 2mo agoSQLite is embedded for local applications with one writer mostly. In 2026 that advice feels antiquated. SQLite now is absolutely useful now for concurrent, mutli-writer applications. https://www.sqlite.org/src/doc/wal2/doc/wal2.md https://www.sqlite.org/src/doc/wal2/doc/wal2.md
- andersmurphy 2mo agoIs it? Sqlite seems pretty fast. [1] [1] - https://andersmurphy.com/2025/12/02/100000-tps-over-a-billion-rows-the-unreasonable-effectiveness-of-sqlite.html https://andersmurphy.com/2025/12/02/100000-tps-over-a-billio...
- groundzeros2015 2mo agoNo. SQLite doesn't have users, proper views, row level security, proper foreign keys, or functions.
- bbkane 2mo agoWhat don't you like about SQLite views or foreign keys?
- groundzeros2015 2mo agoFor example you can’t insert or update a SQLite view. I don’t even think SQLite lets you fully update a table schema. If you start trying to use it for sql and not just storing rows you run into these everywhere. SQLite is not serving the same needs as Postgres.
- bbkane 2mo agoYou can use a trigger with INSTEAD OF to update a view: CREATE TRIGGER update_customer_emails_trigger INSTEAD OF UPDATE ON customer_emails BEGIN UPDATE customers SET email = new.email, name = new.name WHERE id = old.id; END; Maybe that's not as flexible as you need. SQLites process for table updates can be pretty onerous if their ALTER TABLE lacks support. Its a 12 step process the docs have the temerity to call "simple" instead of "tedious and risky" - https://www.sqlite.org/lang_altertable.html#otheralter https://www.sqlite.org/lang_altertable.html#otheralter
- groundzeros2015 2mo agoYes, friction like this. It’s just not a fully featured SQL implementation. As their saying goes, it competes with fopen not oracle.
- frollogaston 2mo agoYes. I already did that once though, so I skip that step now (unless ofc it's a SQLite usecase).
- renegat0x0 2mo agoI used this approach to drive entire app, and it works. Nearly all data are fetched from SQLite. User can select a database, which can change app views, and the data. In my experience it is quite fast. My example for android app: https://f-droid.org/pl/packages/io.github.rumcajs.offlinewebsearch/ https://f-droid.org/pl/packages/io.github.rumcajs.offlineweb... Note that I am not android experienced programmer, and I am still learning.