{"id":107981,"date":"2020-12-11T07:00:00","date_gmt":"2020-12-11T05:00:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=107981"},"modified":"2020-12-09T17:46:30","modified_gmt":"2020-12-09T15:46:30","slug":"aws-sdk-2-for-java-and-storing-a-json-in-dynamodb","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html","title":{"rendered":"AWS SDK 2 for Java and storing a Json in DynamoDB"},"content":{"rendered":"<p>AWS DynamoDB is described as a NoSQL key-value and <b>a document database<\/b>. In my work I mostly use the key-value behavior of the database but rarely use the document database features, however&nbsp; the document database part is growing on me and this post highlights some ways of using the document database feature of DynamoDB <a href=\"https:\/\/github.com\/bijukunjummen\/aws-sdk2-dynamo-json-helper\" target=\"_blank\" rel=\"noopener noreferrer\">along with introducing a small utility library<\/a> <a href=\"https:\/\/docs.aws.amazon.com\/sdk-for-java\/latest\/developer-guide\/home.html\" target=\"_blank\" rel=\"noopener noreferrer\">built on top of AWS SDK 2.X for Java<\/a> that simplifies using document database features of AWS DynamoDB<\/p>\n<p>The treatment of the document database features will be very high level in this post, I will plan a follow up which goes into more details later<\/p>\n<h3 class=\"wp-block-heading\">DynamoDB as a document database<\/h3>\n<p>So what does it mean for AWS DynamoDB to be treated as a document database. Consider a json representation of an entity, say something representing a Hotel:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">{\n    \"id\": \"1\",\n    \"name\": \"test\",\n    \"address\": \"test address\",\n    \"state\": \"OR\",\n    \"properties\": {\n        \"amenities\":{\n            \"rooms\": 100,\n            \"gym\": 2,\n            \"swimmingPool\": true                    \n        }                    \n    },\n    \"zip\": \"zip\"\n}<\/pre>\n<p>This json has some top level attributes like &#8220;id&#8221;, a name, an address etc. But it also has a free form &#8220;properties&#8221; holding some additional &#8220;nested&#8221; attributes of this hotel.&nbsp;<\/p>\n<p>A document database can store this document representing the hotel in its entirety OR can treat individual fields say the &#8220;properties&#8221; field of the hotel as a document.&nbsp;<\/p>\n<p>A naive way to do this will be to simply serialize the entire content into a json string and store it in, say for eg, for the properties field transform into a string representation of the json and store in the database, this works, but there are a few issues with it.&nbsp;<\/p>\n<ol class=\"wp-block-list\">\n<li>None of the attributes of the field like properties can be queried for, say if I wanted to know whether the hotel has a swimming pool, there is no way just to get this information of of the stored content.&nbsp;<\/li>\n<li>The attributes cannot be filtered on &#8211; so say if wanted hotels with atleast 2 gyms, this is not something that can be filtered down to.&nbsp;<\/li>\n<\/ol>\n<p>A document database would allow for the the entire document to be saved, individual attributes, both top level and nested ones, to be queried\/filtered on.&nbsp;<\/p>\n<p>So for eg, in the example of &#8220;hotel&#8221; document the top level attributes are &#8220;id&#8221;, &#8220;name&#8221;, &#8220;address&#8221;, &#8220;state&#8221;, &#8220;zip&#8221; and the nested attributes are &#8220;properties.amenities.rooms&#8221;, &#8220;properties.amenities.gym&#8221;, &#8220;properties.amenities.swimmingPool&#8221; and so on.<\/p>\n<h3 class=\"wp-block-heading\">AWS SDK 2 for DynamoDB and Document database support<\/h3>\n<p>If you are writing a Java based application to interact with a AWS  DynamoDB database, then you would have likely used the new <a href=\"https:\/\/docs.aws.amazon.com\/sdk-for-java\/latest\/developer-guide\/home.html\" target=\"_blank\" rel=\"noopener noreferrer\">AWS SDK 2 library <\/a> to make the API calls. However one issue with the library is that it natively does not support a json based document model. Let me go into a little more detail here.\u00a0\u00a0<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>From the AWS SDK 2 for AWS DynamoDB&#8217;s perspective every attribute that is saved is an instance of something called an\u00a0<a href=\"https:\/\/sdk.amazonaws.com\/java\/api\/latest\/software\/amazon\/awssdk\/services\/dynamodb\/model\/AttributeValue.html\" target=\"_blank\" rel=\"noreferrer noopener\">AttributeValue<\/a>.\u00a0A row of data, say for a hotel, is a simple map of &#8220;attribute&#8221; names to Attribute values, and a sample code looks something like this:<\/p>\n<pre class=\"brush:bash\">\nval putItemRequest = PutItemRequest.builder()\n    .tableName(TABLE_NAME)\n    .item(\n        mapOf(\n            ID to AttributeValue.builder().s(hotel.id).build(),\n            NAME to AttributeValue.builder().s(hotel.name).build(),\n            ZIP to AttributeValue.builder().s(hotel.zip).build(),\n            STATE to AttributeValue.builder().s(hotel.state).build(),\n            ADDRESS to AttributeValue.builder().s(hotel.address).build(),\n            PROPERTIES to objectMapper.writeValueAsString(hotel.properties),\n            VERSION to AttributeValue.builder().n(hotel.version.toString()).build()\n        )\n    )\n    .build()\ndynamoClient.putItem(putItemRequest)\n<\/pre>\n<p>Here a map of each attribute to an AttributeValue is being created with an appropriate &#8220;type&#8221; of content, &#8220;s&#8221; indicates a string, &#8220;n&#8221; a number in the above sample.<\/p>\n<p>There are other AttributeValue types like &#8220;m&#8221; representing a map and &#8220;l&#8221; representing a list.<\/p>\n<p>The neat thing is that &#8220;m&#8221; and &#8220;l&#8221; types can have nested AttributeValues, which maps to a structured json document, however there is no simple way to convert a json to this kind of an Attribute Value and back.<\/p>\n<p>So for eg. if I were to handle the raw &#8220;properties&#8221; of a hotel which understands the nested attributes, an approach could be this:<\/p>\n<pre class=\"brush:bash\">\nval putItemRequest = PutItemRequest.builder()\n    .tableName(TABLE_NAME)\n    .item(\n        mapOf(\n            ID to AttributeValue.builder().s(hotel.id).build(),\n            NAME to AttributeValue.builder().s(hotel.name).build(),\n            ZIP to AttributeValue.builder().s(hotel.zip).build(),\n            STATE to AttributeValue.builder().s(hotel.state).build(),\n            ADDRESS to AttributeValue.builder().s(hotel.address).build(),\n            PROPERTIES to AttributeValue.builder()\n                .m(\n                    mapOf(\n                        \"amenities\" to AttributeValue.builder()\n                            .m(\n                                mapOf(\n                                    \"rooms\" to AttributeValue.builder().n(\"200\").build(),\n                                    \"gym\" to AttributeValue.builder().n(\"2\").build(),\n                                    \"swimmingPool\" to AttributeValue.builder().bool(true).build()\n                                )\n                            )\n                            .build()\n                    )\n                )\n                .build(),\n            VERSION to AttributeValue.builder().n(hotel.version.toString()).build()\n        )\n    )\n    .build()\n<\/pre>\n<p>See how the nested attributes are being expanded out recursively.\u00a0\u00a0<\/p>\n<h3 class=\"wp-block-heading\">Introducing the Json to AttributeValue utility library<\/h3>\n<p>This is exactly where the utility library that I have developed comes in.&nbsp;<br \/>Given a json structure as a&nbsp;<a href=\"https:\/\/github.com\/FasterXML\/jackson\" target=\"_blank\" rel=\"noreferrer noopener\">Jackson JsonNode<\/a>&nbsp;it converts the Json into an appropriately nested AttributeValue type and when retrieving back from DynamoDB, can convert the resulting nested AttributeValue type back to a json.&nbsp;<br \/>The structure would look exactly similar to the handcrafted sample shown before. So using the utility saving the &#8220;properties&#8221; would look like this:<\/p>\n<pre class=\"brush:bash\">\nval putItemRequest = PutItemRequest.builder()\n    .tableName(TABLE_NAME)\n    .item(\n        mapOf(\n            ID to AttributeValue.builder().s(hotel.id).build(),\n            NAME to AttributeValue.builder().s(hotel.name).build(),\n            ZIP to AttributeValue.builder().s(hotel.zip).build(),\n            STATE to AttributeValue.builder().s(hotel.state).build(),\n            ADDRESS to AttributeValue.builder().s(hotel.address).build(),\n            PROPERTIES to JsonAttributeValueUtil.toAttributeValue(hotel.properties),\n            VERSION to AttributeValue.builder().n(hotel.version.toString()).build()\n        )\n    )\n    .build()\ndynamoClient.putItem(putItemRequest)\n<\/pre>\n<p>and when querying back from DynamoDB, the resulting nested AttributeValue converted back to a json this way(Kotlin code in case you are baffled by the &#8220;?let&#8221;):<\/p>\n<pre class=\"brush:bash\">\nproperties = map[PROPERTIES]?.let { attributeValue ->\n    JsonAttributeValueUtil.fromAttributeValue(\n        attributeValue\n    )\n} ?: JsonNodeFactory.instance.objectNode()\n<\/pre>\n<p>The neat thing is even the top level attributes can be generated given a json representing the entire Hotel type. So say a json representing a Hotel is provided:<\/p>\n<pre class=\"brush:bash\">\nval hotel = \"\"\"\n    {\n        \"id\": \"1\",\n        \"name\": \"test\",\n        \"address\": \"test address\",\n        \"state\": \"OR\",\n        \"properties\": {\n            \"amenities\":{\n                \"rooms\": 100,\n                \"gym\": 2,\n                \"swimmingPool\": true                   \n            }                    \n        },\n        \"zip\": \"zip\"\n    }\n\"\"\".trimIndent()\nval attributeValue = JsonAttributeValueUtil.toAttributeValue(hotel, objectMapper)\ndynamoDbClient.putItem(\n    PutItemRequest.builder()\n            .tableName(DynamoHotelRepo.TABLE_NAME)\n            .item(attributeValue.m())\n            .build()\n    )\n<\/pre>\n<h3 class=\"wp-block-heading\">Using the Library<\/h3>\n<p>The utility library is available&nbsp;<a href=\"https:\/\/github.com\/bijukunjummen\/aws-sdk2-dynamo-json-helper\" target=\"_blank\" rel=\"noreferrer noopener\">here &#8211; https:\/\/github.com\/bijukunjummen\/aws-sdk2-dynamo-json-helper<\/a>&nbsp;and provides details of how to get the binaries in place and use it with code.<\/p>\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n<p>AWS SDK 2 is an excellent and highly performant client, providing non-blocking support for client calls. I like how it provides a synchronous API and an asynchronous API and remains highly opionionated in consistenly providing a low level client API for calling the different AWS services. This utlility library provides a nice bridge for AWS SDK 2 to remain low level but be able to manage a json based document persistence and back. All the samples in this post are available in my github repository\u00a0<a href=\"https:\/\/github.com\/bijukunjummen\/dynamodb-document-sample\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>\u00a0&#8211; https:\/\/github.com\/bijukunjummen\/dynamodb-document-sample<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Biju Kunjummen, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/www.java-allandsundry.com\/2020\/11\/aws-sdk-2-for-dynamodb-and-storing-json.html\" target=\"_blank\" rel=\"noopener noreferrer\">AWS SDK 2 for Java and storing a Json in DynamoDB<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the document database features, however&nbsp; the document database part is growing on me and this post highlights some ways of using the document database feature of DynamoDB along &hellip;<\/p>\n","protected":false},"author":236,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[758,1365,1208],"class_list":["post-107981","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-aws","tag-dynamodb","tag-kotlin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-11T05:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Biju Kunjummen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Biju Kunjummen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\"},\"author\":{\"name\":\"Biju Kunjummen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\"},\"headline\":\"AWS SDK 2 for Java and storing a Json in DynamoDB\",\"datePublished\":\"2020-12-11T05:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\"},\"wordCount\":926,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"AWS\",\"DynamoDB\",\"Kotlin\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\",\"name\":\"AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2020-12-11T05:00:00+00:00\",\"description\":\"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2020\\\/12\\\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AWS SDK 2 for Java and storing a Json in DynamoDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\",\"name\":\"Biju Kunjummen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"caption\":\"Biju Kunjummen\"},\"sameAs\":[\"http:\\\/\\\/biju-allandsundry.blogspot.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Biju-Kunjummen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks","description":"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html","og_locale":"en_US","og_type":"article","og_title":"AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks","og_description":"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the","og_url":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2020-12-11T05:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Biju Kunjummen","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Biju Kunjummen","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html"},"author":{"name":"Biju Kunjummen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5"},"headline":"AWS SDK 2 for Java and storing a Json in DynamoDB","datePublished":"2020-12-11T05:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html"},"wordCount":926,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["AWS","DynamoDB","Kotlin"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html","url":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html","name":"AWS SDK 2 for Java and storing a Json in DynamoDB - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2020-12-11T05:00:00+00:00","description":"AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2020\/12\/aws-sdk-2-for-java-and-storing-a-json-in-dynamodb.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"AWS SDK 2 for Java and storing a Json in DynamoDB"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5","name":"Biju Kunjummen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","caption":"Biju Kunjummen"},"sameAs":["http:\/\/biju-allandsundry.blogspot.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/Biju-Kunjummen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/107981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/236"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=107981"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/107981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=107981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=107981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=107981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}