Global Secondary Index
Understand GSI with an example.
We'll cover the following...
Example scenario
Imagine that we are creating a database for songs. We choose “Artist” as the partition key and “Song_title” as the sort key. The other attributes in the table are “Album”, “Genre”, and “Year”.
The envisioned database will look like this:
Artist | Song | Album | Genre | Year |
---|---|---|---|---|
Pink Floyd | Comfortably Numb | The Wall | Progressive rock | 1979 |
Pink Floyd | Mother | The Wall | Progressive rock | 1979 |
The Beatles | Glass Onion | The Beatles | Psychedelic rock | 1968 |
The Beatles | Hey Jude | 1 | Pop rock | 2000 |
Metallica | Atlas, Rise! | Hardwired… to self-destruct |