Reader small image

You're reading from  Mastering DynamoDB

Product typeBook
Published inAug 2014
PublisherPackt
ISBN-139781783551958
Edition1st Edition
Concepts
Right arrow
Author (1)
Tanmay Deshpande
Tanmay Deshpande
author image
Tanmay Deshpande

Tanmay Deshpande is a Hadoop and big data evangelist. He currently works with Schlumberger as a Big Data Architect in Pune, India. He has interest in a wide range of technologies, such as Hadoop, Hive, Pig, NoSQL databases, Mahout, Sqoop, Java, cloud computing, and so on. He has vast experience in application development in various domains, such as oil and gas, finance, telecom, manufacturing, security, and retail. He enjoys solving machine-learning problems and spends his time reading anything that he can get his hands on. He has great interest in open source technologies and has been promoting them through his talks. Before Schlumberger, he worked with Symantec, Lumiata, and Infosys. Through his innovative thinking and dynamic leadership, he has successfully completed various projects. He regularly blogs on his website http://hadooptutorials.co.in. You can connect with him on LinkedIn at https://www.linkedin.com/in/deshpandetanmay/. He has also authored Mastering DynamoDB, published in August 2014, DynamoDB Cookbook, published in September 2015, Hadoop Real World Solutions Cookbook-Second Edition, published in March 2016, Hadoop: Data Processing and Modelling, published in August, 2016, and Hadoop Blueprints, published in September 2016, all by Packt Publishing.
Read more about Tanmay Deshpande

Right arrow

Chapter 9. Developing Mobile Apps Using DynamoDB

Today, one of the coolest things every developer wants to do is to create their own mobile application, launch it for public access, have it go viral, and then have some big technology firm buy it for billions of dollars, isn't it? Of course! Why not? Today we see that mobile devices are more popular than regular desktops. It would not be an exaggeration if I say, in a decade or so, most of the nonmobile devices would vanish away.

Keeping this in mind, mobile applications are very important in all perspectives. In this chapter, we will see:

  • Why you should choose DynamoDB as a backend to your mobile application

  • What options to implement authentication and authorization it gives

  • How you should perform various operations using the AWS SDK for Android and iOS

Many of you might have already developed an Android or iOS application, for which you would have been using some web server where your application and database would be accessed from. Having a...

Authentication and Authorization


I am sure that by now, you would have started thinking about developing an app using DynamoDB as the backend database. But wait! There is one small problem with it, that is, mobile application codes always need to be deployed on each app user's mobile. This means that if we need to access AWS resources, we would also need to send in the security credentials with each app, which is not a good thing to do from the security point of view. Encrypting the credentials would help in reducing the risk, but it would not completely make the app secure as by putting in some effort, hackers would also get hold of the encrypted credentials.

Also, considering that eventually the app would have a huge number of users, we cannot create separate user accounts in IAM. So, even this would not help us. So what can be done in this case? For that we have two options:

  • Use web identity federation

  • Create your own custom authentication

Let's try to understand the process in detail.

Using...

Performing operations using mobile SDKs


Amazon has given an SDK to leading mobile platforms, such as iOS and Android. We can make use of it to perform operations in a mobile application. With these simplified SDK APIs, it is very easy to do normal database operations on DynamoDB. You just need to create a design database schema, and invoke various requests to add/delete and update database entries.

With the ease of integration with other AWS services, using DynamoDB for your mobile application gives you a great advantage. You can download the SDKs from the following URLs:

To get started, you can download sample Android applications from GitHub from the following URL:

https://github.com/awslabs/aws-sdk-android-samples

Now, let's get started with understanding operations for the iOS and Android platforms.

Writing data to DynamoDB

We have...

Summary


In this chapter, we discussed considering AWS DynamoDB as a backend database for your mobile applications. We started with discussing the challenges in using traditional in-house databases for mobile applications. We then discussed how DynamoDB can be helpful if you chose it as a backend database for mobile applications.

We talked about how WIF can help you to reduce the time to market for mobile applications by integrating the authentication and authorization with Facebook, Google, and Amazon accounts. We also saw how the AWS STS helps in securing our mobile applications by generating temporary access tokens for mobile application requests on AWS resources. For those who want to use their own identity credentials, we saw how that can be performed as well.

Later, we discussed the best practices in DynamoDB data modeling for a mobile considering an example use case of an e-commerce mobile application. Taking this example as a reference, we understood how various operations can be performed...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering DynamoDB
Published in: Aug 2014Publisher: PacktISBN-13: 9781783551958
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Tanmay Deshpande

Tanmay Deshpande is a Hadoop and big data evangelist. He currently works with Schlumberger as a Big Data Architect in Pune, India. He has interest in a wide range of technologies, such as Hadoop, Hive, Pig, NoSQL databases, Mahout, Sqoop, Java, cloud computing, and so on. He has vast experience in application development in various domains, such as oil and gas, finance, telecom, manufacturing, security, and retail. He enjoys solving machine-learning problems and spends his time reading anything that he can get his hands on. He has great interest in open source technologies and has been promoting them through his talks. Before Schlumberger, he worked with Symantec, Lumiata, and Infosys. Through his innovative thinking and dynamic leadership, he has successfully completed various projects. He regularly blogs on his website http://hadooptutorials.co.in. You can connect with him on LinkedIn at https://www.linkedin.com/in/deshpandetanmay/. He has also authored Mastering DynamoDB, published in August 2014, DynamoDB Cookbook, published in September 2015, Hadoop Real World Solutions Cookbook-Second Edition, published in March 2016, Hadoop: Data Processing and Modelling, published in August, 2016, and Hadoop Blueprints, published in September 2016, all by Packt Publishing.
Read more about Tanmay Deshpande