Live-coded for the Clean Coders software engineering book club for a hands-on demonstration of how easy it is to get up and running with modern NoSQL databases, showing basic usage of different NoSQL database types.
-
Clone
git clone https://github.com/camball/nosql-learning
-
Install dependencies (ensure you have Python ^3.13 and Poetry installed on your machine)
poetry install
-
Install MongoDB
brew tap mongodb/brew brew update brew install mongodb-community@8.0
-
Start a local instance of MongoDB in the background
brew services start mongodb-community@8.0
Tip
With the above command, MongoDB will stay running on the machine until it is manually stopped—even across system reboots. You can stop the service with brew services stop mongodb-community.
-
Add documents to MongoDB and query for them
poetry run mongo
-
Install Redis
brew install redis
-
Start a local instance of Redis in the background
brew services start redis
Tip
Like our MongoDB instance, starting Redis this way will stay running on the machine until it is manually stopped, and can be stopped with brew services stop redis.
-
Store a key/value pair in Redis and retrieve that key's value
poetry run redis
-
Ensure the Docker Desktop app is open on your machine (install with
brew install --cask dockerif needed) -
Pull Dgraph image (per Dgraph's instructions)
docker pull dgraph/dgraph:latest
-
Run a standalone Dgraph cluster
docker run -it -p 8080:8080 -p 9080:9080 -v ~/dgraph:/dgraph dgraph/standalone:latest -
Add some graph nodes and query for them via GraphQL
poetry run dgraph
graph TD
A(name: Alice) -->|follows| B(name: Bob)
B -->|follows| C(name: Charlie)
C -->|follows| A
A -->|follows| C
D(name: David) -->|blocks| C