DynamoDB best practices include:
- Keep item sizes small.
- If you are storing serial data in DynamoDB that will require actions based on data/time use separate tables for days, weeks, months.
- Store more frequently and less frequently accessed data in separate tables.
- If possible compress larger attribute values.
- Store objects larger than 400KB in S3 and use pointers (S3 Object ID) in DynamoDB.
-Serverless
-Suited for Read heavy operation.
-VPC endpoint is avaiable.
Encryption in transit using ssl/tls. at rest using KMS.
Glonal Tables- Cross Region Replication. Useful for low latency, DR purpose, Must enable DaynamoDB stream.
If burst credits are empty, we will get a 'ProvisionedThroughputException'
-Eventual consistency takes around 1 sec. Enable Strong consistency for latest data.
-You are charged on basis of Provisioned throughput configuration.
-Combined key or Range key.
-A subset of attributes from a table, along with an alternate key to support Query operations.
- A table can have multiple secondary indexes, which give your applications access to many different query patterns.
- The key schema for the index—every attribute in the index key schema must be a top-level attribute
Global secondary index:
- An index with a partition key and a sort key that can be different from those on the base table ie. different hash/range keys per index.
- Queries on the index can span all of the data in the base table, across all partitions.
A global secondary index is stored in its own partition space away from the base table and scales separately from the base table.
-Separate throughput can be provisioned.
-Eventual consistency in writes due to asynchronously replication .
- You can use either a simple or a composite key schema.
- With global secondary index queries or scans, you can only request the attributes that are projected into the index. DynamoDB will not fetch any attributes from the table.
There are no size restrictions for global secondary indexes.
Local secondary index
- An index that has the same partition key as the base table, but a different sort key.One hash key per table
- Every partition of a local secondary index is scoped to a base table partition that has the same partition key value.
You do not need to specify read and write capacity unit settings.
DAX:
% mins TTL for cache by default.
Streams has 24 hrs of data retention
Transactions supported/ On Demand.
On Demand: When spikes are unpredicatble or the application is very low throughput. More expensive than Planned capacity provision.
A DynamoDB Accelerator (DAX) cluster is a cache that fronts your DynamoDB tables and caches the most frequently read values.
-VPC endpoint is avaiable.
Encryption in transit using ssl/tls. at rest using KMS.
Glonal Tables- Cross Region Replication. Useful for low latency, DR purpose, Must enable DaynamoDB stream.
If burst credits are empty, we will get a 'ProvisionedThroughputException'
-Eventual consistency takes around 1 sec. Enable Strong consistency for latest data.
-You are charged on basis of Provisioned throughput configuration.
-Combined key or Range key.
Hash and Range key: This is used when we want primary keys to be dependent on more than one columns. eg. Id and firstname if set both cannot be null
Hash and Global secondary index . The attribute can be null
Secondary Index:-A subset of attributes from a table, along with an alternate key to support Query operations.
- A table can have multiple secondary indexes, which give your applications access to many different query patterns.
- The key schema for the index—every attribute in the index key schema must be a top-level attribute
Global secondary index:
- An index with a partition key and a sort key that can be different from those on the base table ie. different hash/range keys per index.
- Queries on the index can span all of the data in the base table, across all partitions.
A global secondary index is stored in its own partition space away from the base table and scales separately from the base table.
-Separate throughput can be provisioned.
-Eventual consistency in writes due to asynchronously replication .
- You can use either a simple or a composite key schema.
- With global secondary index queries or scans, you can only request the attributes that are projected into the index. DynamoDB will not fetch any attributes from the table.
There are no size restrictions for global secondary indexes.
Local secondary index
- An index that has the same partition key as the base table, but a different sort key.One hash key per table
- Every partition of a local secondary index is scoped to a base table partition that has the same partition key value.
You do not need to specify read and write capacity unit settings.
DAX:
% mins TTL for cache by default.
Streams has 24 hrs of data retention
Transactions supported/ On Demand.
On Demand: When spikes are unpredicatble or the application is very low throughput. More expensive than Planned capacity provision.
A DynamoDB Accelerator (DAX) cluster is a cache that fronts your DynamoDB tables and caches the most frequently read values.