shopware / dynamodb-dal-bundle
A data abstraction layer for DynamoDB
Package info
github.com/shopware/dynamodb-dal-bundle
Type:symfony-bundle
pkg:composer/shopware/dynamodb-dal-bundle
Requires
- php: >=8.4
- async-aws/dynamo-db: ^3.11
- symfony/config: ^7.3 || ^8.0
- symfony/console: ^7.3 || ^8.0
- symfony/dependency-injection: ^7.3 || ^8.0
- symfony/http-foundation: ^7.3 || ^8.0
- symfony/http-kernel: ^7.3 || ^8.0
- symfony/service-contracts: ^3.5
Requires (Dev)
- async-aws/async-aws-bundle: ^1.17
- friendsofphp/php-cs-fixer: ^3.95.2
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.1.55
- phpstan/phpstan-phpunit: ^2.0.16
- phpstan/phpstan-strict-rules: ^2.0.11
- phpstan/phpstan-symfony: ^2.0.18
- phpunit/phpunit: ^13.2.2
- symfony/clock: ^7.3 || ^8.0
- symfony/framework-bundle: ^7.3 || ^8.0
- symfony/http-client: ^7.3 || ^8.0
- symfony/stopwatch: ^7.3 || ^8.0
- symfony/uid: ^7.3 || ^8.0
- symfony/web-profiler-bundle: ^7.3 || ^8.0
- symfony/yaml: ^7.3 || ^8.0
Suggests
- async-aws/async-aws-bundle: Provides the AsyncAws DynamoDbClient service the DAL clients autowire
- symfony/framework-bundle: Needed for the profiler panel (DynamoDbDataCollector)
- symfony/uid: Enables Symfony Uid (Uuid/Ulid) entity properties
- symfony/web-profiler-bundle: Renders the DynamoDB profiler panel
Provides
None
Conflicts
None
Replaces
None
- dev-trunk
- 0.3.0
- 0.2.0
- 0.1.0
- dev-feat/update-expression-builder
- dev-fix/restrict-updates-to-existing-rows
- dev-feat/document-exceptions-explicitly
- dev-fix/refuse-multiple-entities-per-table
- dev-fix/int-backed-enums
- dev-fix/stricter-entity-definition-restrictions
- dev-fix/change-dynamodb-default-port
- dev-fix/remove-exclude-attribute
- dev-fix/enable-phpstan-for-tests
- dev-fix/respect-limit-for-searches
- dev-refactor/address-client-operations-by-entity-class
- dev-fix/package-owner
- dev-fix/field-serializer-priority
- dev-feat/add-better-documentation
This package is auto-updated.
Last update: 2026-09-24 14:56:25 UTC
README
A data abstraction layer for DynamoDB, as a Symfony bundle.
Entities are plain PHP classes annotated with #[Table] and #[Field]. The bundle compiles them into definitions
when the container is built, then reads and writes them through AsyncAws. You work
with entities and PHP values; DynamoDB's attribute format stays inside the bundle.
- Typed fields: strings, numbers, booleans, dates, backed enums, Uids, lists and maps, and types of your own
- Get, query, scan and count, with one
Filterbuilder for key conditions, filters and write conditions - Puts, partial and nested updates, deletes and transactions, batched and retried for you
- Opaque, URL-safe pagination tokens that page forward and backward
- A definition dump, schema baselines for CI and a profiler panel
Getting started
The quick setup covers the requirements, installation, a first entity and how to read and write it.
Documentation
- Quick setup: requirements, installation, a first entity and its use
- Basics: entities, reading by key, queries, scans, counts, puts and deletes
- Updates, conditions and transactions
- Paginated listing: previous and next links, page numbers, and pages merged from several queries
- Custom types, normalizers and filters
- Architecture decisions
Development tooling
In the dev environment, the bundle adds three console commands:
| Command | Output |
|---|---|
dal:definition [entity] |
The compiled definition of an entity: its table, keys and indexes, and every field's type, nullability, default and serializer |
dal:baseline:required-fields |
JSON listing each entity's required fields. Commit it and diff it in CI to catch a field becoming required while stored rows may lack it |
dal:baseline:table-schema |
JSON with the key and index schema of the live tables, for the same kind of check |
With symfony/web-profiler-bundle installed, the profiler gets a DynamoDB panel. It lists each DynamoDB call a
request made, with its caller and duration, and the serializer timings. The panel reads the calls from Symfony's
traced HTTP client, so AsyncAws has to send them through a client named aws.base-client:
framework: http_client: scoped_clients: aws.base-client: scope: '.*' async_aws: http_client: aws.base-client
Setting async_aws.http_client turns off the retrying HTTP client that AsyncAws builds by default. To keep
retries, wrap aws.base-client with AsyncAws\Core\HttpClient\AwsHttpClientFactory::createRetryableClient().
Contributing
Read the guidelines before opening a pull request.
docker compose up -d # DynamoDB Local on port 8345; point DYNAMODB_ENDPOINT elsewhere to use another composer phpunit # the integration suite fails when no DynamoDB answers composer phpstan composer ecs