Member-only story

Revolutionize Your Rails App with DynamoDB: Unleash Speed and Scalability!

When developing a new service, we realized that a core model would be well-suited for storage in DynamoDB, Amazon’s fast and scalable NoSQL solution.

Phil Smy
5 min readJul 29, 2023
Photo by Shubham’s Web3 on Unsplash

Why DynamoDB?

In my experience, when developing apps, the data primarily shown to users is often kept in a separate structure than the underlying database. Users rarely need to see raw data; they prefer summaries, denormalized representations, and charts. For our existing service, Zonmaster, we store user-facing data in an Elasticsearch database, which has served us well. However, for a new project, we wanted to explore alternative options, and that’s where DynamoDB comes into play.

What is DynamoDB?

To quote Amazon:

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don’t have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling. DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.

In essence, DynamoDB is an optimized NoSQL database that is fully managed.

Getting Started

The first step, of course, is to set up DynamoDB for development.

Personally, I prefer using Docker Compose to manage my database elements, such as MySQL, Redis, Elasticsearch, etc. Fortunately, there’s a Docker image available for a local version of DynamoDB, making it easy to run in a development environment. Here’s what my docker-compose.yml looks like:

Here’s what my docker-compose.yml looks like:

version: "3.7"
services:
dynamodb:
image: amazon/dynamodb-local
ports:
- ${DYNAMODB_PORT}:8000
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb"]
mysqldb:
image: mysql:8.0
container_name: zmrm_mysql
volumes:

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Phil Smy
Phil Smy

Written by Phil Smy

Thinker, musician, writer and chief cook and code washer at ZonMaster.com. He’s also a published fiction author.

No responses yet

Write a response