Why are Amazon's websites so overloaded

Overloading Global Secondary Indexes (GSI)

Although Amazon DynamoDB has a default quota of 20 global secondary indexes per table, in practice you can index many more than 20 data fields. Unlike tables in relational database management systems (RDBMS), in which the schema is uniform, tables in DynamoDB can contain many different types of data elements at the same time. In addition, the same attribute in different elements can contain completely different types of information.

Consider the following example of a DynamoDB table layout that stores a wide variety of different types of data.

The attribute that is common to all elements has different content depending on the parent element. If you create a global secondary index on the table that uses the table's sort key as the partition key and the attribute as the sort key, you can run various queries that all use that global secondary index. These queries can include:

  • Look up an employee in the global secondary index using as the partition key value and the employee's name (e.g.) as the sort key value.

  • Using the global secondary index to find all employees working in a particular warehouse by searching by warehouse ID (like)

  • Get a list of the current settings by searching the global secondary index for This value has as a partition key value and uses a date range in the sort key value.