Hacker News new | ask | show | jobs
Show HN: Fast and simple key/value store written using Go's standard library (github.com)
3 points by recompileme 2712 days ago
1 comments

So your PUTs are 3X slower than badgerdb's, but your GETs are 3.1X are faster. Not bad!

Now benchmark against the leaders: Redis, Tarantool and Aerospike. Don't even bother with low-concurrency, almost nobody cares for that.

Yes, you right. But Redis and Aerospike are in-memory DB's. Pudge store data on disk.

Tarantool - much slower, because it's a database, but pudge - is an engine. No overhead on connection/transfer. In that case, i must compare with http://sophia.systems/ But now tarantool don't use sophia. I write https://github.com/recoilme/okdbc on top of sophia - high-level cross-platform sockets interface to sophia db. You may take a look on benchmark: https://github.com/recoilme/okdbc#similar-benchmark-for-memc...

memcached-1.4.34:

SET 69520.84 requests per second

GET 53244.68 requests per second

okdb (based on sophia, ex-engine for tarantool)

SET 48804.88 requests per second

GET 56191.01 requests per second

pudge in-memory mode:

SET 439581 requests per second

GET 1652069 requests per second

pudge write on disk mode:

SET 43843 requests per second

GET 666067 requests per second

But speed it's not the main thing

So, pudge as fast or faster then Memcache or Redis or Aerospike or any other database, including in-memory but pudge it's not a database, it's a database engine. With connection overhead it will be probably slower than in-memory DB's if you implement it badly

I'm pretty sure Redis stores data on disk by default, dumps every 2 seconds.

Do you write to disk on every PUT/SET?

Thank you for your interest. I will try to explain difference redis vs pudge, sorry for my bad english.

Redis is in-memory database. It put keys and values in-memory. If you don't have enough memory you don't may store data. Redis has 2 mode for persistence - AOF and RDB. RDB is snapshot (default), AOF is append only file. In AOF mode redis will write at the end of file and call fsync() every second. Redis is single threaded app (you don't may read data concurrently or utilize all multithread power of your server). And last - you may use redis with redis protocol from any kind of app. It's database.

Pudge is key/value store, database engine. You may write another database with pudge or write server with http/grpc/redis/memcache or other protocol, but in general - pudge is embeddable database. If you need database server on top of pudge you may found some examples in readme.

Pudge has 2 store mode. On disk(default) and in-memory. In on disk mode pudge write data on every set, but pudge may write over old unused data in case of upsert (at the any point of file). Pudge run fsync() every second, like redis in AOF mode. In this mode pudge store in-memory only keys, but values stored on disk. In in-memory mode pudge store keys and values in-memory. In this mode pudge store data on disk only onClose command, like redis in RDB mode. Pudge is multithread app. It has one writer, but readers don't block readers.

Ah, thanks for the lengthy explanation. I get it now.
and in general, pudge much more comparable to:

- badger (embeddable db engine based on LSM Tree)

- leveldb /goleveldb (embeddable db engine based on LSM Tree)

- bolt/LMDB/pogreb (embeddable db engine with active use of MMAP)

- rocksdb and so on

redis is more about in-memory data-structures, then about key/value store.