Repository navigation
1.0.0-ALPHA #31
MatejNedic
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Spring Data DynamoDB 1.0.0-ALPHA Release Notes
What's New
Spring Data DynamoDB 1.0.0-ALPHA is the first official release of Spring Data support for Amazon DynamoDB. This module brings the familiar Spring Data programming model to DynamoDB with first-class support for single-table design patterns.
📗 Reference Documentation
🚀 Why Spring Data DynamoDB?
DynamoDB's power lies in its ability to model multiple entity types within a single physical table, enabling efficient access patterns through strategic use of partition keys, sort keys, and secondary indexes. Traditional ORM approaches often obscure this design philosophy.
Spring Data DynamoDB embraces DynamoDB's core principles:
(partition key, sort key)model is closer to Cassandra than to traditional document stores; this library makes that modeling explicit and readable✨ Key Features
Repository Support
findByPkAndSkStartingWith(...)@Queryexpressions — write DynamoDB key condition and filter expressions when derivation isn't enoughSingle-Table Design Features
@Tableand@Embeddedannotations — model multiple entity types in a single physical table with prefix-based routing usingstartsWith,endsWith, orregexpatterns@SecondaryIndexviews over GSIs and LSIs that automatically setIndexName@SortKeyTemplateand decompose them automatically on read@ItemCollectionViewfor grouping heterogeneous rows from a partition into a single typed aggregateDynamoDB-Native Features
Window<T>pagination backed by DynamoDB'sLastEvaluatedKeycursor (no offset-based pagination)@Version-based conditional writes for safe concurrent updatessaveAll()usesBatchWriteItem, automatically chunked at 25 items with retry logic for unprocessed itemsDynamoDbOperationsandDynamoDbTemplatefor operations beyond repository methodsIndexQueryBuilderfor validated, fluent queries with automatic attribute name aliasingDeveloper Experience
@EventListenerand functional callback interfaces@ValueConverterAbstractDynamoDbConfigurationfor full control@AllowScan, and incorrect entity mappings fail at application startup, not at runtime📦 Compatibility
🎯 Getting Started
Add the dependency:
With Spring Cloud AWS (recommended)
Add the DynamoDB starter:
Configure the module:
Configure the client through properties:
Standalone Configuration
Define an entity:
Create a repository:
📝 Example: Single-Table Design
One table, multiple entity types:
Polymorphic single-table container:
Item collection view for grouped reads:
Type-safe queries:
Keyset pagination:
Template API and IndexQueryBuilder:
Single-item updates:
🔧 What's Not Included
This module is intentionally focused on data access patterns:
Page<T>orSlice<T>— DynamoDB cursors don't support offset-based pagination; useWindow<T>instead@AllowScan🛡️ Fail-Fast Validation
Spring Data DynamoDB validates repository methods and entity mappings at application startup, not at runtime:
@AllowScanare rejected to prevent accidental full-table scansPage<T>,Slice<T>) on repository methods are rejected during initialization📋 Core Annotations Reference
@Table@SecondaryIndex@PartitionKeyorderfor multi-attribute keys)@SortKeyorderfor multi-attribute keys)@Column@EmbeddedstartsWith/endsWith/regexrouting@ItemCollectionView@ItemCollectionMember@SortKeyTemplate@Derived@Version@Query@Update@AllowScan@ValueConverter🙏 Author
Matej Nedic (@MatejNedic)
🔗 Resources
📄 License
Apache License 2.0
Full Changelog: https://github.com/awspring/spring-data-dynamodb/commits/v1.0.0-ALPHA
This discussion was created from the release 1.0.0-ALPHA.
All reactions