cpliakas/dynamo-db-odm
A lightweight PHP object-document mapper for Amazon DynamoDB. Map PHP classes to DynamoDB tables with annotations, then persist, load, and query records through repositories built on the AWS SDK for PHP.
Architecture fit
cpliakas/dynamo-db-odm is a standalone document-mapper for DynamoDB: it hydrates PHP objects from DynamoDB items and persists them back, with attribute mapping and a query/persistence layer. It is not an Eloquent driver, does not extend Illuminate\Database\Eloquent\Model, and has no awareness of Laravel's container, config, events, or lifecycle. Architecturally it competes with, rather than complements, Eloquent — which means introducing a second persistence idiom into the codebase alongside the relational one. For a Laravel shop this is the central fit question: an ODM earns its place only where the data is genuinely document-shaped and access patterns are known up front (high-volume event/telemetry/ledger entities, session or feature-flag stores, single-table designs). For anything relational-shaped it is a net negative.
Integration feasibility
Feasible but non-trivial, and almost certainly not as a straight composer require. Expect the following work regardless of environment:
DynamoDbClient and publish a config/dynamodb.php.The library predates AWS SDK for PHP v3 and is archived, so the first real task is a fork-and-vendor exercise: repoint the marshaller at Aws\DynamoDb\DynamoDbClient, modernize autoloading (PSR-0 era code), and confirm it parses and runs on PHP 8.2/8.3. That is days of work, not weeks, but it is work that has no upstream to send a patch to.
Technical risk High, driven by three compounding factors:
Mitigating factor: the surface area is small and the code is MIT, so the fork is legible and cheap to audit. This is a "we own it" risk, not an unknowable risk.
Key questions
TransactWriteItems? If yes, this ODM likely cannot express them and the answer is the raw SDK.Stack fit
Poor as-is, workable behind a thin internal package. The recommended shape is: app/Support/DynamoDb (or a private company/laravel-dynamodb) that vendors the forked ODM, exposes one service provider, one facade, one config file, and one abstract DynamoModel base. Application code then depends on our namespace, not on cpliakas/*. This preserves the option to swap the mapper later without touching call sites — important precisely because upstream is dead.
Migration path
Aws\DynamoDb v2 types, and estimate the patch.packages/ with a path repository, or publish to a private Composer registry. Pin the fork with a commit hash.AWS_ENDPOINT overrides for DynamoDB Local.If step 1 reveals deep coupling to SDK v2 internals, the fallback decision point is: reimplement the mapper in ~300 lines against SDK v3, or drop the ODM for a repository layer. Both are defensible; both are cheaper than a long fork-maintenance tail.
Compatibility
Assume breakage on PHP 8 (dynamic properties, each()-era idioms, loose type juggling, PSR-0 autoloading). Verify against the Laravel version's minimum PHP, and check that the AWS SDK v3 version we standardize on satisfies Laravel's HTTP client and any existing aws/aws-sdk-php consumer in the app. Marshalling edge cases — binary attributes, string/number sets, nested maps, empty strings — are where compatibility bugs surface, and they surface as data corruption rather than exceptions.
Sequencing Fork-and-validate (PoC, time-boxed) → internal package + provider → IaC for tables and indexes → single-entity pilot → second entity as template → retire the Eloquent path only for entities explicitly justified. Do not sequence this ahead of a real DynamoDB requirement; the package is a means, not a driver.
Maintenance The dominant cost. This is a permanent fork. Budget roughly 0.25–0.5 FTE for the first quarter (SDK v3 port, PHP 8 compatibility, test coverage) and a standing 2–5% of an engineer's time thereafter for dependency bumps and bug triage. Add the AWS SDK itself to the patch cadence — the ODM's maintenance burden is coupled to a dependency we must track anyway. Ownership must be named, not implied.
Support Effectively zero external support: archived, ~10 stars, no maintainer response, no community to search. Internal runbooks, tests, and a documented "how to add an entity" guide are not optional — they are the support model. On the plus side, MIT licensing removes legal friction for forking and internal redistribution.
Scaling
Scaling is AWS's problem for capacity and ours for modeling. DynamoDB scales on partition-key design and index strategy; the ODM neither helps nor hinders there, but it will happily execute a Scan if the team reaches for one. Enforce review rules: no scans in request paths, mandatory pagination, capped batch sizes, retry/backoff configuration exposed in config rather than buried in the client. On-demand capacity mode plus per-table CloudWatch alarms on ThrottledRequests and consumed capacity give adequate early warning.
Failure modes
Ramp-up Low technical ramp-up, moderate conceptual ramp-up. The API is small and readable; engineers will be productive in days. The real learning curve is DynamoDB itself — access-pattern-first design, key cardinality, GSI projection cost, and the discipline to model for queries rather than for entities. Plan for one engineer to own the DynamoDB competency and run a short internal session before the second entity lands. Because the ODM is archived, all of that knowledge is internal and undocumented upstream, which raises the cost of turnover on this component relative to a maintained package.
How can I help you explore Laravel packages today?