Remix.run Logo
benjiro 5 days ago

> I don't really understand the current trend of using sqlite in place of a traditional database. It has it's place, I use it in a client side project and it's really great

I think its more about the issue that databases like postgres are too much "magic". With Sqlite you see your database file, its a physical something. You want to move it to another server, its just a copy action, no dump/restore. You want to "upgrade", there is no mess like with postgres.

You want to create client separation, ... its just a file per client.

> although even there I have to be aware of the one writer only limitation.

The writer limit has not been a limit forever. You can easily do 20k writes per second, what is way beyond what most system anyway. You want 100k? A slightly different access pattern and voila. You want 1 million ... There are ways around it. If you put Sqlite vs Postgres for instance, ironically, seen Sqlite winning against postgres despite that single writer.

The whole hands on "we know what file is, where it is, and how to gain access to it" is really amazing. The whole "do not need to think about how to secure it on the network" also helps a lot.

Do i use Sqlite in production? No ... Postgres its extension support just rules. But i see the appeal for many.

jawilson2 5 hours ago | parent | next [-]

> You can easily do 20k writes per second, what is way beyond what most system anyway.

Do you have any resources on this? I'm working on a project with sqlite, with multiple threads writing, and want to squeeze out a little more performance.

jemmyw 5 days ago | parent | prev | next [-]

> I think its more about the issue that databases like postgres are too much "magic"

The problem with that thought is that in order for sqlite to be as full featured as it is, it also has a lot of "magic". I've also had to dive into the postgres code a few times to understand how it's doing something, and I've generally found it well structured and easy to navigate, and surprisingly terse - there's not that much "magic" really.

andersmurphy 5 days ago | parent | prev | next [-]

Yeah sqlite runs circles around postgresql when it comes to writes if you know what you are doing. Single writer lets you batch and batching is king for writes.

jrochkind1 5 days ago | parent | prev [-]

> You want to "upgrade", there is no mess like with postgres.

Sure, if you don't mind downtime?