FAQ / Accounts & Billing / How does Algolia count records and operations?

How does Algolia count records and operations?

How We Count Records

The number of records equals to the total record count across all your indices, including replicas.

Let’s say you have 5,000 records in main index, and three replicas for that index.

This means you would have a total record count of 5,000 x 4 ( primary index + 3 replicas) = 20,000 records.

Your plan may limit the number of records that you can store. As long as you don’t exceed the maximum record count of your plan, you can add, update, or delete as many records as you want.

If you go over this limit, we charge an over-quota based on the maximum number of records you reach. Your plan may let you pre-purchase discounted, additional records at the beginning of your contract period.

To offer flexibility, we ignore the three days when you had the most records. This means we don’t count them in your monthly total record.

How we count operations

We charge for all indexing and search operations.

For instance, let’s say that in the course of a month, you perform:

  • 40,000 record updates
  • 20,000 search operations per day (600,000 operations for a 30-day month)

This would result in 640,000 operations.

Depending on your plan, you may be billed based on the total monthly number of indexing operations.

If you go over this limit, we charge a fee for the extra operations based on the over-quota pricing of your current plan. Your plan may let you pre-purchase discounted, additional records at the beginning of your contract period.

Counting indexing operations

We count the following indexing operations:

  • Record operations: each addition, update, or deletion on a record counts as one operation. This happens even when nothing changes (for example, if the targeted objectID is unknown).
    • If you batch indexing calls, each record included in the batch counts as one operation. We make an exception for the deleteBy operation, which can delete more than one record but only counts as a single operation.
  • Rule operations: each addition, update, or deletion counts as one operation.
  • Synonym operations: each addition, update, or deletion counts as one operation.
  • ACL operations: each addition, update, or deletion of an API key or its ACL counts as one operation.
  • Index operations: every setSettings call counts as one operation, even if you change several settings at once.
    • Moving, deleting, clearing, or copying an index counts as one operation.

Counting reindexing operations

Reindexing lets you update all records in an index, which you can do with the replaceAllObjects method.

For an index with 10,000 records, the reindexing process:

  • creates a temporary index,
  • indexes 10,000 records,
  • and replaces the production index with the temporary one.

In the example above, the reindex counts as 10,001 operations (10,000 for the writes to the temporary index + 1 operation for the move).

Creating an index doesn’t count as an extra operation because it happens as a byproduct of indexing records.

Counting search operations

Every time you make a search request to an Algolia index, we count one search operation. In autocomplete and search-as-you-type implementations, a search happens at every keystroke. For example, if a user types the word “apple” (five letters) in your search input, a request is sent to Algolia for every letter, resulting in five search operations.

If your search implementation queries multiple indices at each keystroke, then each keystroke corresponds to one search operation per queried index. With our “apple” example above, if your search implementation was querying three indices at a time, each keystroke would count as three operations.

Calls to the search, browse, or searchForFacetValues methods count as one search operation.

Counting InstantSearch operations

Our InstantSearch UI libraries cache all duplicate searches, reducing your search operation count. However, some widgets require two search operations per user input (e.g., the refinementList widget makes one search to get the refinement count, and one to perform the actual search).

Refinement operations

Any user-selected refinement—such as grouping, sorting, and filtering—triggers a new search operation if the search wasn’t cached yet.

Unused operations

On the Starter and Pro plans, if you perform fewer operations than included in your plan or purchased with overage, the unused operations don’t roll over to the following service period.

Maximum Queries Per Second (QPS)

Your plan may also have a limit on the maximum allowable QPS (the allowed number of queries performed per second). You can learn more about how we calculate the max QPS, monitor how your max QPS graph evolves over time under the Performance tab of your dashboard, and retrieve the information via the Usage API.

Counting operations on replica indices

We count operations on replica indices a little differently than with primary indices.

The following replica operations don’t count:

  • Propagating data updates from a primary index to a replica index (which happens automatically).
  • Propagating settings updates from a primary index to a replica index (via the forwardToReplicas parameter).

However, we count the following operations:

  • Updating settings directly on a replica, which counts as one operation.
  • Adding a synonym or a Rule directly to a replica, which counts as one operation.

Did you find this page helpful?