NoSQL Database Design

NoSQL Database Design

Guides a coding agent in designing NoSQL schemas for MongoDB and DynamoDB: document structure, embedding versus referencing, indexes and denormalisation.

Skill files9 files

references/

scripts/

templates/

SKILL.md93 lines
1
---
2
name: nosql-database-design
3
description: >
4
Design NoSQL database schemas for MongoDB and DynamoDB. Use when modeling
5
document structures, designing collections, or planning NoSQL data
6
architectures.
7
---
8
9
# NoSQL Database Design
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Design scalable NoSQL schemas for MongoDB (document) and DynamoDB (key-value). Covers data modeling patterns, denormalization strategies, and query optimization for NoSQL systems.
22
23
## When to Use
24
25
- MongoDB collection design
26
- DynamoDB table and index design
27
- Document structure modeling
28
- Embedding vs. referencing decisions
29
- Query pattern optimization
30
- NoSQL indexing strategies
31
- Data denormalization planning
32
33
## Quick Start
34
35
Minimal working example:
36
37
```javascript
38
// Single document with embedded arrays
39
db.createCollection("users");
40
41
db.users.insertOne({
42
_id: ObjectId("..."),
43
email: "john@example.com",
44
name: "John Doe",
45
createdAt: new Date(),
46
47
// Embedded address
48
address: {
49
street: "123 Main St",
50
city: "New York",
51
state: "NY",
52
zipCode: "10001",
53
},
54
55
// Embedded array of items
56
orders: [
57
{
58
orderId: ObjectId("..."),
59
date: new Date(),
60
total: 149.99,
61
},
62
{
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Document Structure Design](references/document-structure-design.md) | Document Structure Design |
73
| [Indexing in MongoDB](references/indexing-in-mongodb.md) | Indexing in MongoDB |
74
| [Schema Validation](references/schema-validation.md) | Schema Validation |
75
| [Table Structure](references/table-structure.md) | Table Structure |
76
| [Global Secondary Indexes (GSI)](references/global-secondary-indexes-gsi.md) | Global Secondary Indexes (GSI) |
77
| [DynamoDB Item Operations](references/dynamodb-item-operations.md) | DynamoDB Item Operations |
78
79
## Best Practices
80
81
### ✅ DO
82
83
- Follow established patterns and conventions
84
- Write clean, maintainable code
85
- Add appropriate documentation
86
- Test thoroughly before deploying
87
88
### ❌ DON'T
89
90
- Skip testing or validation
91
- Ignore error handling
92
- Hard-code configuration values
93

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…