Use strongly consistent indexing with Apache Phoenix

Strongly consistent indexing is a three-phase indexing algorithm that ensures that the index table is always in sync with the data table.

Strongly consistent indexing ensures that the data read from the index table is consistent at read time for read operations. An index table row is repaired using the corresponding data table row if necessary at read time. When the writes to a table are fast, an additional write phase is used without impacting the write performance.

The following table illustrates the design of the three-phase indexing:
Table 1.
Operation Strongly consistent index
  1. Reads the index rows and checks its status
  2. Repairs unverified rows using the underlying data table
  1. Sets the status of the existing index rows as unverified and writes the new index rows with status as unverified
  2. Writes to the underlying data table rows
  3. Deletes the exisiting index rows and sets the status oif the new rows as verified
  1. Sets the status of index table rows as unverified
  2. Deletes the underlying data table rows
  3. Deletes the index table rows

Newly created Apache Phoenix tables in Cloudera Runtime 7.1.6 and higher use strongly consistent indexing by default. You can use the index upgrade tool to upgrade your Apache Phoenix tables to use the strongly consistent indexing.