DynamoDB example apps
A runnable DynamoDB app that builds on Nimbus with the stock
@aws-sdk/client-dynamodb client. The @nimbus/dynamodb helper supplies the
endpoint, region, and credentials. Everything else is the unchanged AWS SDK API.
Read the overview first if you have not pointed an AWS
SDK at Nimbus yet.
The example lives under
examples/dynamodb/
in the source repository. Run it in place from a checkout.
Run the example
Section titled “Run the example”nimbus devnimbus dev starts a local server with the DynamoDB listener on a dedicated
endpoint. The default is 127.0.0.1:8000. When it detects the AWS SDK
dependency, the command writes the NIMBUS_DYNAMODB_* connection variables to
.env.local. The access key ID selects the Nimbus tenant.
Then run the example app from its directory. Its README gives the command. The app reads those variables and drives the DynamoDB endpoint directly. It has no Nimbus function bundle to deploy.
The app
Section titled “The app”Tasks
is a headless task list against the DynamoDB endpoint. It creates a tasks
table with a single string partition key, id, then drives the shared
tasks spec
through standard AWS SDK commands:
PutItemcreates an incomplete task with a stable id and creation time.Scanreads every task without ordering the results. The app sorts the results client-side bycreatedAt, newest first.UpdateItemtoggles a task’scompletedflag.DeleteItemremoves a task.
The app polls for live updates
Section titled “The app polls for live updates”DynamoDB has no live-query view on this surface. The app cannot meet the
spec’s no-polling subscription behavior. To complete the live-update flow, the
app scans tasks repeatedly until a later read observes the change. This
process polls DynamoDB. It does not provide a live subscription. The example
records that gap and does not emulate a subscription.