To work with Realtime Cloud Storage you’ll need to understand the following concepts:
Tables: A table has a unique name in your storage and holds a set of items. A table
ProductCatalog would hold all the products in your web catalog;
Items: Items contain your data in a set of attributes. At table
ProductCatalog each item would be a specific product like “iPhone 5S”. If you’re familiar with relational databases you could consider an item as a row in your relational table;
Attributes: An item attribute holds particular data about the item. The item “iPhone 5S” of table
ProductCatalog would have an attribute named
Capacity, which would hold the memory capacity of the specific iPhone. If you’re familiar with relational databases you could consider an attribute as a column in your relational table;
Primary and Secondary keys (or key schema): These keys are special attributes that identify specific items. Table
ProductCatalog would have a
Reference primary key to identify distinctively each product in the table. Therefore primary keys cannot be repeated in items of the same table unless you define a secondary key. Consider the secondary key as a range of keys inside each primary key. An alternative
ProductCatalog table schema could have the
Reference as primary key and the
SKU as secondary key, allowing different SKUs for the same
Reference (an iPhone 5S could have several SKUs to distinguish between the several finishes and capacities while keeping the same Reference). In this example the complete key of each product in
ProductCatalog would be the pair
References: References are “pointers” to specific Realtime Cloud Storage objects. They can be Storage References pointing to your entire Storage, table references pointing to a specific table or item references pointing to a specific item in a given table. In each SDK you’ll use this references to access the object data stored in Cloud Storage;
Snapshots: Snapshots hold the actual data of an item (the entire item’s attributes);
Real-time notifications: If you care about changes in a specific item or table you can set real-time notifications on specific events (put, update or delete) on an item or table and Realtime Cloud Storage will notify you every time these events occur. When Realtime Cloud Storage notifies you of some event, like an item update, it’ll give you the complete item along with the notification so you don’t have to round-trip to the cloud servers to read the actual value of the updated item;
Credentials and tokens: Each Realtime Cloud Storage has a specific application key that uniquely identifies it on the multi-tenant cloud servers. A token-based authentication system allows applications to define the operations each user or groups of users are allowed to perform over the Storage data. These operations follow the CRUD model (Create, Read, Update and Delete) and these permissions can be defined at a database, table or specific item level.
Throughput: Realtime Cloud Storage is highly-scalable which means that for each table you create in your storage you’re allowed to define the number of operations per second (throughput) that table should handle. This throughput is divided into read operations and write operations, meaning that you can easily define tables where you’ll read more often than write and vice-versa. Realtime Cloud Storage uses this throughput information to provision the appropriate Amazon DynamoDB resources in order to guarantee that your tables can handle the load you expect while keeping the best performance in a predictable way.
Now that you know the basic concepts move on to the next chapter and start using your Realtime Cloud Storage and all its awesome features.