Database Reference
In-Depth Information
Chapter 3. Tools and Libraries of AWS
DynamoDB
We have understood the strength of the Eclipse plugin in the previous chapter on interfaces.
We have seen a few of the basic operations using three interfaces. But along with those in-
terfaces, DynamoDB supports lots of tools and libraries. In this chapter, we will see one
such tool that is used along with the Eclipse IDE. We will mostly perform DynamoDB op-
erations using the Java SDK. In this chapter, we will cover the following topics:
• Creating an SDK project
• SDK operations
• DynamoDB Local
We can easily create tables, indexes, attributes, and items. After doing all of these offline,
we can commit or save to AWS DynamoDB. This is the use of DynamoDB Local.
If we need to insert event data (which is available as a CSV file) into DynamoDB, are we
comfortable looking at the CSV file manually and creating one item for every event and fi-
nally put it into the table? Is it possible to perform the operation if the item size of the CSV
file goes beyond a million records? Obviously the answer is no, because it requires a lot of
patience and some errors might occur as we are all human and to err is human .
Another possible case is that we have developed a web application (let's say, a JSF applica-
tion) for the library catalogue, which we have discussed in Chapter 2 , DynamoDB Inter-
faces , and we have decided to use DynamoDB as the database. Now the biggest challenge
would be integrating DynamoDB with Java. This is where the SDK comes into the picture.
By importing and including certain DynamoDB libraries, we can play with DynamoDB us-
ing simple Java code.
Along with Java, DynamoDB supports SDK for PHP and .NET too. Some limited support
is available for JavaScript, Python, Android, iOS, and Ruby too. Since Java is the one that
is easy to learn, and is open source as well, we will discuss Java AWS SDK in this chapter.
If you're able to recall, before performing a DynamoDB operation using either the Eclipse
plugin or AWS CLI, we authenticated ourselves to AWS using our credentials. We need to
do the same here as well. So in order to proceed further we must configure our Eclipse to
access DynamoDB. Refer to the The Eclipse plugin section in Chapter 2 , DynamoDB Inter-
faces .
Search WWH ::




Custom Search