5 common problems FaunaDB indexes solve for you

You can use indexes not only to speed up queries, but also to paginate, sort, and filter documents in FaunaDB

5 common problems FaunaDB indexes solve for you

Indexes are a core feature of almost every database today, so it’s no surprise that FaunaDB has them too. FaunaDB is a cloud-hosted, distributed, multi-model database that is well-suited for web and mobile apps.

FaunaDB offers native support for GraphQL, but also provides its own, more powerful query language, FQL, which we’ll use in our indexing examples here. 

There are multiple use cases for indexes. The most obvious is improved performance when locating specific data within vast collections of records, but pagination, sorting, and searching are also provided by indexes.

Every time we want to satisfy some data requirements that target one or more documents, and we don’t know their refs (the global reference that identifies a unique document within a database), indexes are the way to go.

In this article, we will learn about five common use cases that can be solved with indexes. Every use case has a code example and an explanation.

To continue reading this article register now