Hacker News new | ask | show | jobs
by tripue 2852 days ago
Interesting project. How do you achieve theses performances ?
1 comments

I guess that LMDB is the root of the outstanding peformance. Check it out, it is an innovative key/value database that uses a memory-mapped db file, the OS cache, zero-copy on reads and copy-on-write.
Are you really comparing the same thing, then? Do you have the same consistency guarantees if the system shuts down unexpectedly?
When I saw the results I did not believe, so I reviewed the benchmark code. It is basically the same SQL commands being run in normal SQLite and with the branching enabled.

Yes, LMDB is proved to be safe. It is used in many apps and even other DB implementations, including Monero.

What I have not tested is SQLite with WAL (Write-Ahead Log). In this case it may be faster than the default journal mode.

Yes, it would be nice to see results with WAL, as it's significantly faster in most cases.
Maybe libmdbx would be interesting too.

https://github.com/leo-yuriev/libmdbx

According to Wikipedia[1], SQLightning -- a port of Sqlite using LMDB -- was 20x faster than original sqllight. It could thus be interesting to compare LiteTree with SQLightning.

[1] https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Databa...

Indeed. But the last version of SQLightning is using SQLite 3.7. It would be useful to have an updated version. I was going to update it but then I decided to implement LiteTree in another way, using pages instead of rows. This is because our customers at Blocko/Aergo prefer higher performance over small storage.