Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various fixes #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/lessons/advanced-topics/secondary-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ There are a few basics of secondary indexes that are worth knowing:

- **No uniqueness requirement**. Recall that for a table's primary key, _every item is uniquely identified by its primary key_. Thus, you can't have two Items with the same key in a table.

This requirement is not applicable to secondary indexes. You may have Items in your secondary index with the exact same key structure.
This requirement is not applicable to secondary indexes. You may have Items in your secondary index with the exact same key structure. This explains why you can't call GetItem or BatchGetItem on an index: there could be more than one result.

- **Secondary index attributes aren't required.** When writing an Item, you _must_ specify the primary key elements. This isn't true with secondary indexes -- you may write an Item that doesn't include the attributes for secondary indexes. If you do this, the Item won't be written to the secondary index. This is known as a _sparse index_ and can be a very useful pattern.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Our first query pattern was to "Retrieve a single store by its Store Number." We

Because our table's primary key is Store Number, we can use the familiar [GetItem](./inserting-retrieving-items#get-item) API call to retrieve a single Item based on its primary key.

Run the [`get_store_location`](https://github.com/alexdebrie/dynamodbguide.com/tree/master/examples/starbucks/get_store_location.py) script provided in the repo. By default, it will use our default Store Number:
Run the [`get_store_location`](https://github.com/alexdebrie/dynamodbguide.com/tree/master/examples/starbucks/get_store_location.py) script provided in the repo. By default, it will use our default Store Number: "5860-29255"

It should print out the details for our retrieved Item:

Expand Down
10 changes: 5 additions & 5 deletions content/lessons/data-modeling-examples/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ This chapter is intended to grow over time. Are there particular use cases you'd

### Available examples:

- [**Building a global leaderboard using write sharding**](./leaderboard-write-sharding)
- [**Modeling hierarchical data***](./hierarchical-data)

This example shows how to model hierarchical data. **It includes a full code sample that uses >25,000 Starbucks store locations.** Learn how to satisfy multiple access patterns, including finding all stores in a particular state, all stores in a particular city, and all stores in a particular zip code.

- [**Building a global leaderboard using write sharding**](./leaderboard-write-sharding)
Comment on lines +17 to +21
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this first because it comes first in the list

6.1  Overview
6.2  Hierarchical Data
6.3  Leaderboard & Write Sharding


Learn how to organize your DynamoDB to allow for leaderboard-like queries -- "What are the most-viewed items in my table?" "Which users have the top score in my game?"

You will also learn how to use write-sharding and scatter-gather queries to alleviate write throttling for high-usage keys.

- [**Modeling hierarchical data***](./hierarchical-data)

This example shows how to model hierarchical data. **It includes a full code sample that uses >25,000 Starbucks store locations.** Learn how to satisfy multiple access patterns, including finding all stores in a particular state, all stores in a particular city, and all stores in a particular zip code.


### Planned examples:
Expand Down
4 changes: 2 additions & 2 deletions content/lessons/multi-item-actions/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Filter expressions are used to apply server-side filters on Item attributes _bef

## Breakdown of a DynamoDB API Call

For the DynamoDB Query and Scan operations, there are three separate steps happening on the DynamoDB server:
For the DynamoDB Query and Scan operations that have a `Limit` parameter, there are three separate steps happening on the DynamoDB server:

1. **Retrieve** the requested data. This step looks at Starting Token (if provided) for both types of operations, and the Key Expression in a Query operation.
1. **Retrieve** up to `Limit` items. This step looks at Starting Token (if provided) for both types of operations, and the Key Expression in a Query operation.

2. (Optionally) **Filter** the data retrieved in step 1. This includes applying filters as described in this section or projection expressions as discussed in previous lessons.

Expand Down
2 changes: 1 addition & 1 deletion content/lessons/multi-item-actions/scans.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ You can see the response only has 11 items, rather than the full 25:
}
```

Segments are zero-indexed, though I had trouble when trying to use Segment "0" with DynamoDB Local -- it kept returning 0 elements.
Segments are zero-indexed. Note that [if you are using DynamoDB Local, the Segment and TotalSegments parameters are ignored](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.UsageNotes.html).

In the next section, we'll learn about [filtering](./filtering) your Query and Scan operations.
4 changes: 2 additions & 2 deletions content/lessons/resources/additional-reading.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type: "lesson"
- [Awesome DynamoDB](https://github.com/alexdebrie/awesome-dynamodb) -- A GitHub repo with DynamoDB links and resources.
- [DynamoDB landing page](https://aws.amazon.com/dynamodb/)
- [AWS Developer Guide Docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)
- [AWS CLI reference for DynamoDB](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html)
- [AWS CLI reference for DynamoDB](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html)
- [Boto3 (Python client library for AWS) docs](http://boto3.readthedocs.io/en/latest/reference/services/dynamodb.html)
- [Javascript client library for AWS](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html)
- [Javascript client library for AWS](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/)
- [Document Client cheat sheet (Javascript)](https://github.com/dabit3/dynamodb-documentclient-cheat-sheet). Created by [Nader Dabit](https://twitter.com/dabit3).
2 changes: 1 addition & 1 deletion content/lessons/single-item-actions/anatomy-of-an-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ date: "1/1/2018"
type: "lesson"
---

An _item_ is the core unit of data in DynamoDB. It is comparable to a row in a relational database, a document in MongoDB, or a simple object in a programming language. Each item is _uniquely identifiable_ by a primary key that is set on a table level.
An _item_ is the core unit of data in DynamoDB. It is comparable to a row in a relational database, a document in MongoDB, or a simple object in a programming language. Each item is _uniquely identifiable_ by a primary key that is set on a table level. Each item cannot exceed 400KB in size.

An item is composed of _attributes_, which are bits of data on the item. This could be the "Name" for a User, or the "Year" for a Car. Attributes have types -- e.g., strings, numbers, lists, sets, etc -- which must be provided when writing and querying Items.

Expand Down
2 changes: 1 addition & 1 deletion content/lessons/single-item-actions/inserting-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ $ aws dynamodb get-item \

Sometimes you may want to retrieve only certain attributes when getting an Item. This can be particularly helpful for saving network bandwidth when working with large items.

Use the `--projection-expression` option to return only particular elements from an item:
Use the `--projection-expression` option to return only particular attributes from an item:

```bash
$ aws dynamodb get-item \
Expand Down