I am developing a project in Java, and I am using the AWS SDK. I am using Dynamo DB. I am using the mapper, and it is very useful for me because I can perform basic operation directly on a java entity.
Recently, I have seen the library that allows to add transactionality to Dyanamo DB: https://github.com/awslabs/dynamodb-transactions
Such library works really fine, but it does not allow me to use the mapper. It only works with GetRequest, PutRequest, ...
I have no problem when getting results, because I can use the method "marshallIntoObject(Class, Map)" for obtaining the java entity from the results of a query.
How can I perform the same operation for saving/updating an item? I would really like to have a method that takes in input a java entity and converts it to a Map. I would use the returned map for performing query through the transaction engine. Is it available somewhere?
Moreover, are there any plans to make the project "dynamodb-transactions" able to support the mapper?
Thanks
The AWS SDK for Java provides a DynamoDBMapper class, allowing you to map your client-side classes to Amazon DynamoDB tables. To use DynamoDBMapper , you define the relationship between items in a DynamoDB table and their corresponding object instances in your code.
Amazon DynamoDB transactions simplify the developer experience of making coordinated, all-or-nothing changes to multiple items both within and across tables. Transactions provide atomicity, consistency, isolation, and durability (ACID) in DynamoDB, helping you to maintain data correctness in your applications.
The DynamoDBMapper class is the entry point to Amazon DynamoDB. It provides access to a DynamoDB endpoint and enables you to access your data in various tables. It also enables you to perform various create, read, update, and delete (CRUD) operations on items, and run queries and scans against tables.
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.
Following up on this: The linked feature request has now been implemented.
The DynamoDB transaction library now supports using the DynamoDB Mapper. Take a look at the examples and the javadocs to get started with it, and feel free to open questions in the github project if you have any.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With