A document database usually stores a primary record by document ID.

But applications also ask questions such as:



Find users where status = "active"
Find invoices where customerId = 42
Find posts where category = "rust"






Those queries need secondary indexes.

LioranDB implements secondary indexing through an LSM-style index store.




...