/log-based-db

Implements and explains log structured databases

Primary LanguageRuby

When storing data to a database it may depend somewhat on the use case but generally you want it to be performant for both insertions and retrieves even as it grows in size. Another consideration is how it scales in its memory and disk usage. There are many different databases that have many different pros and cons depending on what they're optimized for, this repo will look at and build a log based systems similar to what is used internally for many NoSQL databases.

Log based systems are generally very efficient at inserting and retrieving individual records and with the right system can also work well with retrieving ranges of data. On the other hand if you want a system that is easy to perform many different dynamic queries it can have its shortcomings.

This starts from a plain text log file with no indexing. We than add indexing for efficient lookups. The next issue we address is horizontal scalability by adding segmentation and compaction.