Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One approach is to first take a write-lock on the table. Lookup the new username in the multi index, and if it exists, abort. If it does not exist, proceed to insert the employee into the table and the username into the multi index. Then release the write-lock. However, serializing write requests to the table limits my application's scalability...

Alternative approaches are prone to race conditions.

A server-side unique index allows my application to atomically insert the index entry only if the key does not already exist, overcoming race conditions without locks.

Claim: Given both multi and unique indexes, an application can

...

have all 4 types of

...

index mappings efficiently.

..If every object must correspond to a key, the application should never write an object that doesn't correspond to a key. This is easy to enforce with assertions on the client.

Claim: It is useful to know at index creation whether an index will be unique or multi.

...