DEV.co
Open-Source Databases · sensedeep

dynamodb-onetable

OneTable is a TypeScript/JavaScript library that simplifies working with DynamoDB by providing a schema-driven, high-level API for single-table designs. It handles type marshaling, validations, and query generation while maintaining full access to underlying DynamoDB capabilities.

Source: GitHub — github.com/sensedeep/dynamodb-onetable
716
GitHub stars
113
Forks
TypeScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorysensedeep/dynamodb-onetable
Ownersensedeep
Primary languageTypeScript
LicenseMIT — OSI-approved
Stars716
Forks113
Open issues20
Latest releasev2.7.7 (2025-02-25)
Last updated2025-09-11
Sourcehttps://github.com/sensedeep/dynamodb-onetable

What dynamodb-onetable is

OneTable abstracts DynamoDB operations (CRUD, transactions, batch, GSI/LSI queries) through a schema-based model layer with automatic TypeScript type inference. It manages key templating, expression generation (conditional, filter, key, update), and supports both AWS SDK v2 and v3 clients.

Quickstart

Get the dynamodb-onetable source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/sensedeep/dynamodb-onetable.gitcd dynamodb-onetable# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Single-table DynamoDB designs with multiple entity types

Ideal for teams building serverless applications that leverage one-table patterns with complex key hierarchies and global secondary indexes, where schema validation and type safety reduce operational errors.

TypeScript-heavy Node.js backends requiring strong entity typing

Automatic type generation from schemas enables compile-time validation of entity attributes, queries, and responses, reducing runtime bugs in API layers and business logic.

Multi-tenant SaaS applications with tenant isolation via key design

The library's support for templated keys, compound key management, and sparse GSIs simplifies multi-tenant data isolation and cross-tenant query patterns.

Implementation considerations

  • Schema design is critical: invest time in defining keys, GSI/LSI structure, and attribute packing before implementation; mistakes are costly to refactor at scale.
  • Type safety is automatic but requires TypeScript adoption and use of `as const` in schema definitions; JavaScript codebases lose compile-time validation benefits.
  • Audit DynamoDB cost implications of query patterns, especially filter expressions and full table scans, as the library abstracts but does not prevent inefficient access.
  • Plan for migrations early using OneTable Migrate or OneTable CLI if schema evolution is expected; schema versioning is supported but requires discipline.
  • Encrypted fields are supported but key management (rotation, storage) must be handled outside the library; consider AWS KMS or application-level encryption strategy.

When to avoid it — and what to weigh

  • You need relational join semantics or complex transactions across entities — While OneTable supports transactions and batch operations, it does not provide cross-entity relationship management or distributed transaction coordination beyond DynamoDB's native capabilities.
  • Your team is unfamiliar with single-table design patterns — OneTable requires solid understanding of DynamoDB's key design, sparse indexes, and overloading strategies. Misuse can lead to inefficient queries or poor access patterns.
  • You require Python, Go, or other non-Node.js runtimes — OneTable is Node.js/TypeScript only. Other languages will need alternative DynamoDB libraries or clients.
  • You need real-time data synchronization or change data capture (CDC) — OneTable does not include CDC, event streaming, or replication features. You would need to integrate DynamoDB Streams separately.

License & commercial use

MIT License. Permissive OSI-approved license allowing free use, modification, and distribution in commercial and private projects with attribution.

MIT license permits commercial use without restriction. No vendor lock-in, licensing fees, or proprietary agreements. Attribution required in redistributions. Verify your internal license compliance policy but no barriers to production use identified.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Library does not enforce DynamoDB authorization or authentication—those are AWS SDK client concerns. Field-level encryption supported but key management is the application's responsibility. No security audit details published. Validate encryption strategy and DynamoDB IAM policies independently. Logging is controllable but sensitive data (PII in keys/attributes) requires explicit handling in schema design.

Alternatives to consider

AWS SDK v3 DynamoDB client (low-level)

Direct AWS SDK offers maximum control and minimal abstraction but requires manual expression generation, type management, and validation. Suitable if you prefer explicit control over OneTable's convenience trade-offs.

Dynamoose (Node.js ODM)

Similar schema-driven approach with TypeScript support, but follows traditional ODM patterns. May be easier for teams with SQL/Mongoose backgrounds but less optimized for single-table designs.

TypeORM with DynamoDB dialect (experimental)

Brings familiar ORM semantics to DynamoDB but dialect support is limited and community-driven. Overkill for single-table patterns but may suit teams deeply invested in TypeORM.

Software development agency

Build on dynamodb-onetable with DEV.co software developers

Evaluate OneTable for your DynamoDB single-table architecture. We can assess schema design, integration points, and cost optimization with your AWS infrastructure.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

dynamodb-onetable FAQ

Does OneTable handle DynamoDB provisioning and capacity management?
No. OneTable provides `CreateTable` and `DeleteTable` operations but does not manage provisioned throughput, on-demand billing, or auto-scaling. Use AWS CloudFormation, Terraform, or AWS Console for capacity planning.
Can I migrate from a multi-table to single-table design with OneTable?
OneTable supports this via OneTable CLI and OneTable Migrate tools (separate packages), but the process requires manual schema redesign and data backfill. No automated migration is provided.
Is OneTable suitable for real-time applications or high-frequency updates?
OneTable can handle high throughput, but performance depends on DynamoDB provisioning, query patterns, and network latency. Batch and transaction support allow bulk operations, but OneTable adds minimal overhead. Monitor with CloudWatch and SenseDeep for production insight.
What happens if my schema changes after data is in production?
OneTable supports schema versioning in the schema definition, but data migration is manual. Plan schema evolution carefully; use OneTable Migrate or application-level migration scripts. Backwards compatibility must be managed by your application.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like dynamodb-onetable into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Ready to build serverless with OneTable?

Evaluate OneTable for your DynamoDB single-table architecture. We can assess schema design, integration points, and cost optimization with your AWS infrastructure.