3 ms·
> In the end, I always come back to Postgres. It's unbelievably powerful, lightweight and there's not much it can't do. How lightweight? SQLite itself is arou
by tzs 6y ago
> In the end, I always come back to Postgres. It's unbelievably powerful, lightweight and there's not much it can't do.
How lightweight?
SQLite itself is around 600 KB. That's with all features enabled. I believe you can get it it down to about half that if you disable features you don't need. RAM usage is typically under a dozen or so KB.
It doesn't even require that you have an operating system. All you need for a minimal build is a C runtime that includes memcmp, memcpy, memmove, memset, strcmp, strlen, and strncmp, and by default also malloc, realloc, and free although it has provisions for providing different memory allocators, and you have to provide some code to access storage if you are running on a system that doesn't have something close to open, read, write, and the like.
This means it can even be used on many embedded systems far too small to run a Unix.
Heck, it is not even too unreasonable to compile SQLite to webasm and include it on a web page if for some reason you need client side SQL on the web.
- exyi 6y agoDepends on what you need. It does not seem like a great idea to run Postgres in a browser, but it is usually less resource hungry than the JVM-based app using it to return HTML or JSON, so I can call it lightweight for server use.
- nawgz 6y ago> Heck, it is not even too unreasonable to compile SQLite to webasm and include it on a web page if for some reason you need client side SQL on the web. With the deprecation of Web SQL, I highly doubt this is a use-case anyone cares for anymore. Anyhow, I see your main point: SQLite is indeed "Lite", so it makes sense to use in embedded or small single-consumer cases. I just don't think those are very interesting tools to make in 2021, we expect collaboration and concurrency, so PostgreSQL wins in my imagination-space. I am a web developer though, so I am inherently biased. I also am not the person you were just discussing with
- dragonwriter 6y ago> With the deprecation of Web SQL, I highly doubt this is a use-case anyone cares for anymore. WebSQL didn’t die as a standard because noone wanted client SQL on the web, it died because SQLite was the only reasonable way of providing it, preventing multiple really-independent implementations.
- ptman 6y agoThere are people compiling sqlite to webasm, so it's a use-case some care for.
- derefr 6y ago> This means it can even be used on many embedded systems far too small to run a Unix. A good example is that SQLite is used inside many video games. You wouldn't put Postgres in your game engine.
- spicybright 6y agoIs using something with that small a foot print even worth it in today's age? Surely postgres and other don't have THAT big of an overhead, at least for the features they provide.