Hacker News new | comments | show | ask | jobs | submit login

Probably a naive question, but how does it compare to Redis? When would someone look for a K-V store written in X instead of the already mature Redis?

Badger is designed to store data on disk (like RocksDB or LevelDB), while Redis is an in-memory storage which can't store data sets larger than memory.

You can store Redis on disk too. Not that you gain anything from doing so as persistence can be better achieved by clustering and I've never ran into issues where memory was a limiting factor, even with millions of records in Redis. Frankly if memory was a limiting factor then you'd probably want your KV store separate from your application anyway rather than the embedded approach that Badger takes.

I think the real advantage of Badger is that it's not as sophisticated as Redis. ie you can have Redis-like functionality compiled into your application so less faffing about setting up another daemon / cloud micro-service inside your NAT / VPC / whatever.

> persistence can be better achieved by clustering

If you want persistence, then I'd recommend persisting to disk. While I've not had this fun with Redis, I've written code that took out an entire Cassandra ring. Were stuff only in memory, it would have not been pretty. Just because something is distributed doesn't mean it's guaranteed to never go completely down.

(That said, if you're using Redis as an in-memory cache, this is a potentially acceptable tradeoff.)

Redis is a database management system (DBMS). Badger is a storage engine.

An application developer would not choose Badger, but instead would pick a DBMS such as Redis.

A database engineer would use Badger to develop a DBMS that the application engineer could use. If the database engineer so chooses they could expose a Redis compatible API.

Yes this is more comparable to level, rocks or at a higher level Cassandra, ScyllaDB, DynamoDB etc.

It's comparable to LevelDB and RocksDB. However, Badger is not comparable to Cassandra, ScyllaDB or DynamoDB as they are distributed database management systems.

Cassandra, for example, has it's own storage engine that's responsible for writing bits to disk.

redis is not an embedded database, while rocksdb/boltdb/badger are.

Can you say what exactly is an "embedded workload"? I have seen this a few times now and tried googling but only ever come up with references to embedded systems and I'm guessing that this is not the same context.

I know rocksdb is LSM-based and was built by FB to address write amplification on SSDs.

It has no server that runs independently and applications connect to, instead you integrate (embed) it into your program as a library.


The terminology can be a bit confusing. Database Management System is what people often call a database. Unfortunately, the storage engine is also called a database.

Badger, RocksDB, LMDB, etc. are storage engines. A process uses these storage engines to write data to memory (note: the storage engine may support persistent, volatile, or both types of memory).

A database management system (DBMS) is a higher level concept that often has multiple processes either on a single server or distributed across multiple servers. Simply stated, each process within a DBMS uses the storage engine to read/write to/from memory (persistent or volatile).

It's important to note that storage engines are a specialized area and require different skills from writing a DBMS. It's a big deal when other people write high quality storage engines because it makes it a lot easier to write a DBMS.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact