NoSQL Workbench lets you design DynamoDB tables visually, but the real magic is how it translates those visual models into actual, runnable DynamoDB schema definitions and even generates backfill code.

Here’s a quick look at it in action. Imagine we’re building a simple catalog for a game. We’ll need a table to store game information.

First, you open NoSQL Workbench and create a new "Data Model." You’ll see a blank canvas. On the left, there’s a "Model" pane. You drag and drop "Entities" onto the canvas. Let’s create an entity called Games.

Now, we define the attributes for Games. We’ll need a gameId (which will be our partition key), a title, a genre, and a releaseYear. You click on the Games entity, and in the "Attributes" section, you add these. For gameId, we specify it as the "Partition key."

This visual representation is powerful because it directly maps to DynamoDB’s core concepts: entities become tables, and attributes with designated keys become your primary key structure. NoSQL Workbench isn’t just a drawing tool; it’s a schema definition engine.

Once you’ve defined your Games entity, you can add relationships. For instance, we might want to store information about the developers who made these games. We create another entity, Developers, with a developerId (partition key), name, and foundedYear.

To link Games and Developers, we can define a relationship. In NoSQL Workbench, you’d draw a line between the Games entity and the Developers entity. You can specify the type of relationship. For a many-to-many relationship (one developer can make many games, one game can have multiple developers), you’d typically model this with a junction entity or by embedding data. Let’s say for simplicity, we’ll add a developerIds attribute (a list of developer IDs) to our Games entity. You can define this as a "List" type attribute.

The real power emerges when you need to translate this visual model into DynamoDB. NoSQL Workbench has a "DynamoDB Actions" menu. You can select "Create DynamoDB Table." This will open a dialog where you can choose your region, provide a table name (e.g., GameCatalog), and select the provisioned throughput mode (On-Demand or Provisioned). If you choose Provisioned, you’ll specify read and write capacity units.

Clicking "Create" generates the actual CloudFormation template or AWS CLI commands to create your GameCatalog table with the gameId as the partition key. It handles the underlying complexities of provisioning the table infrastructure for you.

But it gets deeper. You can also "Generate Sample Data." NoSQL Workbench can create realistic-looking JSON data based on your entity definitions. For our Games entity, it might generate entries like:

{
  "gameId": "uuid-1234-abcd",
  "title": "Cyberpunk 2077",
  "genre": "RPG",
  "releaseYear": 2020,
  "developerIds": ["dev-xyz-789"]
}

This sample data generation is invaluable for testing your application logic and query patterns before you even have real data. You can then use another action, "Load Sample Data to DynamoDB," to populate your newly created table. This feature directly interacts with your AWS account, using the AWS SDK under the hood to perform PutItem operations.

Beyond basic table creation, NoSQL Workbench aids in designing access patterns. You can define "Queries" and "Scans" directly within the workbench. For example, you could define a query to find all games by a specific genre. This involves specifying the partition key (gameId) and potentially a sort key (if you had one). NoSQL Workbench then shows you the potential cost and latency of such a query based on your table’s schema and provisioned throughput. This iterative design process, where you visualize, define, create, and test, is crucial for building efficient DynamoDB applications.

The tool also helps you think about secondary indexes. If you wanted to query games by releaseYear effectively, you’d add a Global Secondary Index (GSI). In NoSQL Workbench, you’d select the Games entity, go to "Indexes," and add a GSI. You’d specify releaseYear as the partition key for the GSI, and potentially a sort key if needed. The workbench then generates the necessary configuration for the GSI, which can also be provisioned via the "Create DynamoDB Table" action. This visual representation of indexes makes it much easier to understand how your data will be organized for different query needs.

What most users miss is that the "Generate Backfill Script" option is not just for populating initial data. It’s a powerful tool for schema migrations. If you decide to add a new attribute or change the key structure of an existing table, you can visually model the new schema, then use the backfill script generator to create code that reads from your old table and writes to a new table (or updates the existing one in-place, though this is riskier) with the desired structure. This allows for gradual rollout of schema changes without significant downtime.

The next step in mastering DynamoDB design is understanding how to optimize for specific access patterns with composite primary keys and global secondary indexes.

Want structured learning?

Take the full Dynamodb course →