Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which jar to use for Dynamodb with java

I'm trying to write a DAO for DynamoDB using Java 8 and there seems to be several ways. Classes are primarily defined under the following two packages:

  • com.amazonaws.services.dynamodbv2
  • software.amazon.awssdk.services.dynamodb

Both of them appear to be doing what I'd like - but since I'm starting fresh, I'd rather choose the latest one

I've looked at these two links:

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Java.03.html

https://docs.aws.amazon.com/sdk-for-java/v2/migration-guide/whats-different.html

The thing that confuses the most is that the com.amazonaws.services.dynamodbv2.AmazonDynamoDB says v2 and software.amazon.awssdk.services.dynamodb.DynamoDbClient doesn't.

like image 731
Prith Avatar asked Aug 09 '19 16:08

Prith


People also ask

Does DynamoDB support JDBC?

The DynamoDB JDBC Driver is a powerful tool that allows you to easily connect-to live Amazon DynamoDB data through any JDBC capable application or tool! With the Driver users can access Amazon DynamoDB the same way that they would connect to any other JDBC data source.

Does Entity Framework work with DynamoDB?

This article shows how to access Amazon DynamoDB data using an Entity Framework code-first approach. Entity Framework 6 is available in . NET 4.5 and above. Entity Framework is an object-relational mapping framework that can be used to work with data as objects.

Does DynamoDB store data in JSON?

You can store a JSON document as an attribute in a DynamoDB table. To do this, use the withJSON method of Item . This method parses the JSON document and maps each element to a native DynamoDB data type.


Video Answer


1 Answers

The aws-sdk-java-v2 repository uses the package name software.amazon.awssdk whereas v1 of the Java SDK uses com.amazonaws. v2 was written with Java 1.8 features in mind, making it a lot easier to develop with over v1.

I personally recommend using v2 over v1 where possible, even though both SDKs are still actively maintained on GitHub. However, there may be features that are missing from v2 that are contained in v1, so it's possible that you'll end up adding both as dependencies to your project.

To answer your question, com.amazonaws.services.dynamodbv2 is a package in v1 of the Java SDK, as seen here.

like image 64
Jacob G. Avatar answered Sep 28 '22 12:09

Jacob G.