kitar/laravel-dynamodb
Seamlessly integrate Amazon DynamoDB into Laravel with Eloquent-style models, a fluent query builder, and local DynamoDB support for development and testing. Ideal for scalable, serverless-friendly NoSQL applications.
Persistence-layer selection for new services. This package removes "we'd lose Eloquent and rewrite our data layer" from the DynamoDB column of the decision matrix. That reframes the choice as cost/latency/access-pattern trade-offs instead of a framework-ergonomics penalty — which is exactly the comparison a PM wants the team making.
Build vs. buy for the adapter layer. Attribute marshalling, GSI query construction, pagination, conditional writes, and batch operations are weeks of undifferentiated work plus permanent maintenance. Buying an MIT-licensed adapter is defensible if the abstraction is thin enough that we can fork or replace it.
Serverless / Vapor roadmap. DynamoDB is a Lambda-native datastore: no VPC-attached connection pool, no connection-limit cliff under burst scaling. If the roadmap includes per-request autoscaling or scale-to-zero, this package keeps the application layer unchanged while the infrastructure changes underneath.
Use cases this unlocks without a re-platform:
Unit-economics and packaging decisions. On-demand capacity replaces instance-hours with request units, which changes COGS from a step function to a variable cost. That materially affects free-tier design, per-seat vs. usage-based pricing, and gross-margin modeling for a SaaS launch.
Incremental migration sequencing. Because the API stays Eloquent-shaped, one bounded context (e.g., the activity feed) can move to DynamoDB while the transactional core stays on Postgres. This makes "strangler-fig the monolith" a sequencing option rather than a rewrite project.
Time-to-market de-risking. Teams already fluent in Eloquent ship a DynamoDB-backed MVP without waiting on a DBA or a data-modeling specialist, which compresses the gap between "we need a database decision" and "we have a working service."
Adopt when:
Look elsewhere when:
Reasonable alternatives: raw AWS SDK calls behind a repository layer (more code, more control, no bus factor), or staying on Postgres/Aurora Serverless v2 with Laravel's first-party support.
For executives (30 seconds): "We can use DynamoDB — AWS's fully managed, serverless database — without giving up the Laravel codebase our team is already fast in. That removes the main reason we kept defaulting to managed SQL. It means we can choose the database on cost and scaling behavior rather than on framework familiarity, and we can do it one service at a time instead of a rewrite."
Business framing: variable cost instead of capacity planning; no DBA hire for the new service; faster time-to-market on the next launch; lower lock-in risk than a replatform, because the application code stays standard Laravel and the data layer is swappable per bounded context.
For engineering: you keep Eloquent models, the query builder, collections, and model events; the package handles attribute marshalling, GSI queries, and pagination. Caveats stated plainly: it is an adapter, not a relational emulator — access patterns must be designed up front, relationships and joins are limited, and the library is small (~193 stars, single-maintainer risk). Mitigations: pin versions, hide it behind internal repository interfaces, and validate the top access patterns in a spike before committing.
The ask: a 1–2 week spike putting one non-critical bounded context — an activity feed or session store — on DynamoDB via this package, benchmarked against the Postgres baseline on p99 latency, projected monthly cost at expected volume, and developer hours to first working feature. Decision gate at the end: proceed, expand scope, or revert with the abstraction intact.
Risks to name out loud: bus factor on a small OSS dependency; an AWS-specific skills gap on the team; and the cost of reversing a bad key design. Each has a concrete mitigation — repository abstraction, version pinning, an internal modeling review, and a raw-SDK exit plan — which is what makes this a reversible bet rather than a commitment.
How can I help you explore Laravel packages today?