Hello everyone! This week, I spent 10 hours coding in my spare time and finished my comparison program for SQLite vs. MongoDB.
SQLite vs MongoDB ⚔️ https://github.com/hinst/mongodb-sqlite-versus
-
SQLite is approximately seven times faster than MongoDB.
- SQLite works directly with the file without HTTP, whereas in MongoDB, the client and server must communicate with each other.
-
MongoDB files take up about half as much disk space as
SQLite.
- MongoDB supports built-in zstd compression.
Compression can be manually disabled in MongoDB, but doing so has almost no impact on speed.
I think SQLite is better suited for micro-projects on an Orange Pi. I have a 256GB memory card, and it should theoretically be enough even for fairly large databases. However, Debian, Docker, and Kubernetes have already sucked up 40 GB 😤. Additionally, MongoDB has issues on the Orange Pi: the official version doesn’t run at all due to compatibility problems. I only managed to get MongoDB running on Orange Pi through a series of complex workarounds (literally “dancing with a tambourine”). On the other hand, SQLite works right out of the box.
I also tried testing libSQL from Turso, but bugs and unfinished features cropped up immediately, so my motivation to continue vanished quickly. I think I’ll start working on a mini website project on the Orange Pi soon, but first, I need to get some proper sleep 😴