A Serverless Application on AWS - Part 3 : The Data Tier

A Serverless Application on AWS - Part 3 : The Data Tier

This article in the series talks about the Data Tier for the serverless application. Please refer post 1 for the Architecture Overview and post 2 for the Web Tier.

The Data Tier is concerned with storing the data for the application. The data includes application data as well as user information. Application data is managed with DynamoDB and user data is managed with Cognito.

DynamDB

Amazon DynamoDB is a no SQL managed database from AWS that provides very fast performance in terms of database operations. It is a fully managed AWS service. This means we do not need to manage servers, scalability and availability. All these are managed by Amazon. It supports ACID transactions, thus business critical , enterprise applications can be reliably built using DynamoDB. It can be used for serverless web apps, in mobile back-ends or as a data store for microservices or IoT.

In the serverless application architecture the structured data (tables) and unstructured data (documents) can be managed in the DynamoDB. Documents can also be managed in S3. We can use MySQL Workbench to work with the database. We need to create a MSQL database in the AWS account’s RDS Service. Please refer this article for detailed instructions on creating the MySQL database in AWS RDS and using MySQL workbench to access it

Amazon Cognito

At first, it might seem irrelevant to find discussion about Cognito in the Data Tier. Cognito is the user management service from Amazon. It allows us to add user sign-up, sign-in, and access control to our web and mobile apps. Among other features, it also allows us to manage millions of users as a user store. Hence I have added it in the Data Tier of the application architecture. It supports sign-in with social identity providers, such as Facebook, Google, and Amazon, and enterprise identity providers via SAML 2.0.

The serverless application would use Amazon Cognito User Pools to implement authentication. Configuration is needed to set up Cognito User Pool, create a user directory and adding the serverless application to the user pool. This would allow to create and manage users from the Cognito User Pool. By using an Amazon Cognito user pool, you can create and maintain a user directory, and add sign-up and sign-in to your mobile app or web application. A detailed step-by-step process is documented in this article. We can also enable Social Sign in for a user pool if needed.

What Next?

We would continue to elaborate on Business Logic tier of the the architecture in the next post. Later I would also try to continue sharing some more practical tips about working with this application and how the authentication and authorization can be planned.

Please feel free to comment,suggest,praise or criticize. It would help us learn and grow :)

To view or add a comment, sign in

More articles by Uday Joshi

Explore content categories