Secondary Indexes
• By Garren Smith
Database Secondary Indexes
I’ve been fortunate to design and build two secondary index systems from scratch. The first one was for the attempted rewrite of CouchDB on top of [[FoundationDB]] and the second was for the original Tigris database. Below is a list of resources on building secondary indexes in general and also using FoundationDB.
My documentation and talks on secondary indexes
Below are a list of code, documentation and talks I’ve on secondary indexes:
Tigris
- The public facing RFC for building secondary indexes for Tigris DB
- The initial index builder PR and the index reader PR for secondary indexes
- A talk I did at the online FoundationDB meetup on how secondary indexes work in TigrisDB
CouchDB
- RFC for building indexes for CouchDB on FDB
- The first PR to add secondary indexes to CouchDB on FDB
- A talk I did about the above work at FoundationDB conference in 2019
Favourite resources for secondary indexes
- CockroachDB has an RFC on their gin index implementation
- The Azure DocumentDB paper on how they implemented json indexes is an excellent read
- The Firebase paper has a good section on the tradeoffs they made around secondary indexes to handle high throughput.
- Mike Rhodes has very good series on building a JSON index.
- Ryan Worl did a good introduction talk at the FoundationDB conference on building indexes and change feeds using FoundationDB
- Phil Eaton shows how to build a SQL database using zig and rocks db.