Bean & Bark: set up the table

View .md

Before the first lesson you need two things: a table called BeanAndBark, and the sample data inside it. Both take a couple of minutes. Pick the path that matches how you want to run — import the ready-made file straight into DynoStudio (no AWS account, nothing to install beyond the app), or stand up a free local DynamoDB and load it with one command. Either way you end up in the same place: the studio pointed at a loaded table, ready to query.

You'll learn
  • Create the BeanAndBark table — the one-table, pk/sk shape the whole series is built on
  • Load the ~5,900-item sample, either by importing it into DynoStudio or seeding DynamoDB Local
  • Point DynoStudio at your data and confirm it with a single cheap query

Get the files

One download covers both paths: the bundle below holds the dataset, the table definition, the local seed script, and the dataset README. Prefer single files? Each one is listed after it. The .ddb.json file is what you import into DynoStudio; schema.json and the seed script are for the run-it-locally path.

Download
  • Everything — bean-and-bark.zip The whole dataset in one file. Extract it and you're ready for either path below.
  • Bean & Bark sample (DynamoDB-JSON) The dataset — ~5,900 items in DynamoDB-typed form. This is the file you import into DynoStudio.
  • Table definition The BeanAndBark key schema (pk HASH / sk RANGE, on-demand) — used by aws dynamodb create-table and by the seed script.
  • Local seed script A zero-dependency loader for DynamoDB Local — only needed for the run-it-locally path below. Uses the aws CLI you already have.

Path A — Import into DynoStudio

The fastest way in: nothing to install beyond the app, no AWS account. You create an empty table, then import the file into it. Two steps.

1. Create the table. In DynoStudio, create a new table named BeanAndBark with partition key pk (String) and sort key sk (String), billed on-demand. Prefer to type it? Run this statement in the query box — DynoStudio lowers it to the native CreateTable call and shows you the plan in the "Executes as" strip before anything runs:

sql
CREATE TABLE "BeanAndBark" (  PARTITION KEY pk STRING,  SORT KEY sk STRING) WITH BILLING = ON_DEMAND

That's the exact key shape the lessons assume. CREATE TABLE is a DynoStudio dialect surface — DynamoDB's own PartiQL has no DDL; see CREATE TABLE for the full syntax. A read-only stage refuses it, which is why the studio discloses the control-plane call first.

2. Import the data. Open the table, choose Import from CSV & JSON, pick the bean-and-bark.ddb.json you downloaded, and review the key-aware preview before it writes. That loads the ~5,900 items — and you're ready to query.

Path B — Run it locally with DynamoDB Local

Prefer to run the PartiQL against your own endpoint, offline and free? Stand up DynamoDB Local and let the seed script create the table and load every item for you. You need the aws CLI and a way to run DynamoDB Local — Docker is easiest. From the folder you downloaded:

bash
# 1. run DynamoDB Local (Docker shown; any method works)docker run -p 8000:8000 amazon/dynamodb-local# 2. from the folder you downloaded, create the table and load ~5,900 items#    (defaults to localhost:8000 — no AWS account, dummy creds injected for you)node seed-bean-and-bark.mjs

The script creates BeanAndBark from schema.json if it's missing, then batch-writes every item in chunks of 25, retrying anything DynamoDB leaves unprocessed — so it's safe to re-run. When it finishes, point DynoStudio at the same endpoint (http://localhost:8000) and open the table.

Confirm it worked

However you loaded it, open BeanAndBark in DynoStudio and run one cheap keyed read. If Dana's three orders come back, the data is in and the keys are right:

sql
SELECT OrderId, Placed, Status, Total FROM "BeanAndBark"WHERE pk = 'CUSTOMER#c-014' AND begins_with(sk, 'ORDER#')

You should get three rowsOrder#8842, Order#9013, Order#9188. That's the opening move of the very first lesson, so if it works you're fully set up. (If it errors on the table name or returns nothing, the import/seed didn't land — re-run the path above.)

Recap
  • The table is BeanAndBark, keyed by pk (string) + sk (string), billed on-demand — one table for every entity.
  • Import path: create the table (the DynoStudio UI, or a CREATE TABLE statement in the query box), then Import from CSV & JSON with bean-and-bark.ddb.json.
  • Local path: docker run … amazon/dynamodb-local, then node seed-bean-and-bark.mjs, then point DynoStudio at http://localhost:8000.
  • A keyed read on pk = 'CUSTOMER#c-014' returns Dana's three orders — proof the data landed.
AWS reference
Was this page helpful?