Introducing Tern Db (in Gossamer)
Embedded, fast and small, key-value or SQL

After working on this privately for a while, I'm ready to share Tern Db. Built in 100% Gossamer, Tern Db is an embedded key value store with SQL syntax on top of it.
I built it to be read optimized and gentle on RAM and CPU demands, in service of a FOSS content management system I'm building in Gossamer aimed at a particular group of users who want a self hosted blog with a good user experience.
Raw query performance was excellent:
After iterating (and looking for reference implementations and other sources of ideas to optimize - I improved it further:
Tern DB went from 3.4 million queries/s to 12.1 million. (Rust's Redb from 2.46 to 2.49 million, and Rust with SQLite from 656k to 674k).
RAM usage is reasonable:
Within an HTTP server we can see the use case Tern DB was built for - running a lightweight web service on a small VPS. Let's look at CPU, Memory, and Requests/Sec:
If you want to build a small self hosted site with an embedded database, Gossamer is shaping into an excellent option with Tern's help.



