DynamoDB Dynomite Associations
Important: These docs are for the outdated Jets 5 versions and below. For the latest Jets docs: docs.rubyonjets.com
Dynomite supports Associations. Associations are connections between 2 models. For example, a User
can have_many
Posts
.
- DynamoDB Dynomite Has Many
- DynamoDB Dynomite Belongs To
- DynamoDB Dynomite Has One
- DynamoDB Dynomite Has And Belongs To Many
- DynamoDB Dynomite Associations Querying
- DynamoDB Dynomite Single Table Inheritance
- DynamoDB Dynomite Limits
- DynamoDB Dynomite Associations Test Data
Id Field as Primary Key
Associations work by storing the id
to association-managed fields like users.posts_ids
, posts.user_id
, etc. The id
field should be the Primary Key Partition Key. Otherwise, dynomite uses where("id.in": ids)
to find the associated items. This results in a slow scan
operation. When the id
field is a partition key, dynomite can use the fast get_item
operation in parallel.