Database Reference
In-Depth Information
Schema-less-ISH
DynamoDB provides a schema-less service from AWS but the keys have a very big impact
on application design, throughput performance, and cost. Let's define what schema-less-
ISH is and what kind of work it will do with your DynamoDB tables. So here if you have
your hash and range keys, and if you want to use the API, you should query the hash key
and range key:
From the previous table, you can query for all items where hash == 8 , or all items
where hash == 8 and range > Y . However, here you can't perform an API query for
all items where range > Y ; for that, you have to do an expensive table scan.
You can take advantage of the key structure by creating relationships between arbitrary en-
tities on a web application. So, any end user can go on the website and become a "member"
or "follower" of the respective article or content. For this kind of scenario we can create the
following table for the key schema:
For every relationship you can create two writes; one in each direction of the graph. So us-
ing the BOTO library it will look something like the following code:
results = table.query(hash_key=user_id,
range_key=BEGINS_WITH('FOLLOWER_OF.Article.'))
Search WWH ::




Custom Search