Amazon DynamoDB
Retrieve
2 samples, from the least code that works to complete workflows.
What a read does
| Rule | On DynamoDB |
|---|---|
| One item | By its full key (GetItem), strongly consistent by default; not found is null. By other columns that give a partition key (of the table or an index): a query, and several items are ARX2003 |
| Lookups | A declared lookup reads back as an ArxEntityReference whose Name is null: DynamoDB makes no joins, so a .DisplayName(...) in the catalog isn't read (read the referenced item yourself where you need its name) |
| Attribute names | Case-sensitive in DynamoDB: an attribute the catalog declares (the id, a key, the version, the display name, a declared column) is stored with its declared spelling whatever the case of the entity's name; an undeclared one by its exact spelling (Name and name are two attributes) |
| Execute | Not offered: DynamoDB has no stored procedures (ARX8001) |
Reference
Value types read back
| Stored as | Read back as |
|---|---|
| S (string) | string, or the preloaded type (Guid, DateTime, DateOnly, …) |
| N (number) | decimal (a double past decimal's range), or the preloaded type |
| BOOL | bool |
| B (binary) | byte[] |
| M (map) | ArxJsonB |
| L (list) | string[] or decimal[] when every element is that kind; otherwise ArxJsonB |
| SS, NS, BS (sets) | string[], a number array, byte[][] |
| NULL, or no attribute | null |
| a declared lookup | ArxEntityReference |
The samples
Basics
The least code that works.
1Retrieve one recordProgressiveRead one item by its key, in three scenarios: a product by its id, an order by its full key with its customer read back as a lookup, and an id no item has.
Advanced cases
Dependency injection, transactions, batch scopes and setting the service up.
1Set up the service from DynamoDB's tablesAdvancedThe service set up from DynamoDB's description of the lead table, in two scenarios: preload at startup, then read with Strict on, where only the declared attributes may be asked for.