A proof of concept demonstrating different approaches to CRUD operations with DynamoDB, comparing implementations with and without Dynamoose ODM in TypeScript.
This project showcases three different approaches to working with DynamoDB:
- Dynamoose ODM - Object Document Mapping for DynamoDB with TypeScript support
- Raw AWS SDK - Direct DynamoDB DocumentClient usage (coming soon)
- Performance Comparison - Benchmarks between different approaches (coming soon)
- Node.js (v14 or higher)
- TypeScript (v5.2+)
- AWS Account with DynamoDB access
- AWS credentials configured
-
Clone the repository
git clone <repository-url> cd dynamoose-poc
-
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env # Edit .env with your AWS credentials -
Build the TypeScript project
npm run build
-
Run the application
npm start
npm run build- Compile TypeScript to JavaScriptnpm start- Run the main application (from dist/)npm run dev- Run with nodemon for developmentnpm run create- Example: Create a new usernpm run read- Example: Read/query usersnpm run update- Example: Update a usernpm run delete- Example: Delete a usernpm run setup- Create the DynamoDB tablenpm run clean- Clean the dist directory
Type Safety: Full TypeScript support with interfaces and type definitions Development Speed: High-level abstraction simplifies development Features: Built-in validation, schema enforcement, timestamps, and type conversion
| Aspect | Dynamoose ODM | Raw AWS SDK |
|---|---|---|
| Type Safety | Built-in TypeScript support | Manual interface definitions |
| Development Speed | Fast prototyping, less boilerplate | More verbose, full control |
| Performance | Slight overhead from abstraction | Minimal overhead, optimized |
| Learning Curve | Gentle, MongoDB-like syntax | Steeper, requires DynamoDB knowledge |
| Features | Validation, timestamps, schemas | Raw DynamoDB capabilities only |
| Bundle Size | ~200KB additional | ~50KB base AWS SDK |
Use Dynamoose when:
- Rapid development is priority
- Team is familiar with ODM patterns
- Built-in validation and schemas are needed
- TypeScript support is important
Use Raw AWS SDK when:
- Maximum performance is critical
- Fine-grained control over DynamoDB operations is needed
- Bundle size needs to be minimal
- Complex DynamoDB operations are required
The project supports both AWS DynamoDB and local development:
AWS DynamoDB:
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
DYNAMODB_TABLE_NAME=UsersLocal DynamoDB (Optional):
DYNAMODB_ENDPOINT=http://localhost:8000- Add raw AWS SDK implementation
- Performance benchmarks and comparisons
- Unit tests for both implementations
- Integration tests with local DynamoDB
- Error handling improvements
- Connection pooling and optimization
- Advanced query examples
- Dynamoose Documentation
- AWS DynamoDB Documentation
- AWS SDK v3 for JavaScript
- TypeScript Handbook
- DynamoDB Local Development Guide
MIT