Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically create DynamoDB table on application startup using Spring Data DynamoDB?

I am using spring-data-dynamodb Spring Data extension to integrate AWS DynamDB with Spring Boot 2.0. I was able to make it work.

My question is, is there a way that the table is automatically created on application startup if it doesn't already exists, similar to what Hiberate offers via hibernate.hbm2ddl.auto ?. Right now, I have to create the table manually or in the application using the AWS DynamoDB sdk. Many Thanks.

like image 370
Cheeta Avatar asked Jun 25 '18 10:06

Cheeta


People also ask

How do I use AWS DynamoDB in spring boot?

Create a DynamoDB Table on AWS Console and add a sample value. Setup the Java Spring Boot Micro Service on your local using Spring Initializr. Integrate the DynamoDB code into your Java Application using AWS SDK and successfully read the sample value.

Does DynamoDB automatically replicate?

DynamoDB would then automatically replicate data changes among those tables so that changes to CustomerProfiles data in one Region would seamlessly propagate to the other Regions.

What is Spring data DynamoDB?

The primary goal of the Spring® Data project is to make it easier to build Spring-powered applications that use data access technologies. This module deals with enhanced support for a data access layer built on AWS DynamoDB. Technical infos can be found on the project page.

Does hibernate work with DynamoDB?

You can use Hibernate to map object-oriented domain models to a traditional relational database. The tutorial below shows how to use the CData JDBC Driver for Amazon DynamoDB to generate an ORM of your Amazon DynamoDB repository with Hibernate.


Video Answer


1 Answers

Right now there is no such feature but there is an open feature request: https://github.com/derjust/spring-data-dynamodb/issues/17 (which I'm actually working on these days)

Note: I'm the maintainer of this GitHub project.

like image 121
Sebastian J. Avatar answered Oct 16 '22 13:10

Sebastian J.