online survey using amazon web services
TRANSCRIPT
Project Name: Survey on Cloud
Highlights:
Cloud Platforms
DynamoDB design
Configuring AWS Elastic Beanstalk
Analyzing intelligent data and statistics
Application deployment, establishing connection from POSTMAN to EBS
Data insertion into DynamoDB and mapping
Coding part of Enterprise Service Application
Description on involvement of Enterprise and Cloud
Computing.
Amazon Web Services Elastic Beanstalk is used to deploy and manage applications in Cloud and Amazon
DynamoDB database cloud service. The first reason for us to opt for Amazon Web Services is because of the hand-
on experience which came handy due to performing our labs using AWS. As we have seen part of our course
Cloud Computing has three main types that are commonly referred to as Infrastructure as a Service (IaaS),
Platform as a Service (PaaS), and Software as a Service (SaaS). Selecting the right type of cloud computing can help
to strike the right balance of control and the avoidance of undifferentiated heavy lifting. The AWS cloud
computing platform provides the flexibility to build application regardless of variety in use case or industry.
The reason we chose AWS Elastic Beanstalk in our project is for its ability to support Java which we are using and
many other languages and is ideal for web applications. However, due to Elastic Beanstalk’s open architecture,
non-web applications can also be deployed using Elastic Beanstalk. AWS Elastic Beanstalk runs on the Amazon
Linux AMI and the Windows Server 2012 R2 AMI. Both AMIs are supported and maintained by Amazon Web
Services and are designed to provide a stable, secure, and high-performance execution environment for Amazon
EC2 Cloud computing. Another very important aspect is we can use the AWS Toolkit for Eclipse for Java
applications and the AWS Toolkit for Visual Studio for .NET applications. The toolkits allow us to develop our
application, deploy it to Elastic Beanstalk, and even test it out without having to switch our focus away from our
IDE. Once the application is running, Elastic Beanstalk automates management tasks–such as monitoring,
application version deployment, a basic health check–and facilitates log file access. AWS Elastic Beanstalk does
not restrict you to any specific data persistence technology. We can choose to use Amazon Relational Database
Service (Amazon RDS) or Amazon DynamoDB, or use Microsoft SQL Server, Oracle, or other relational databases
running on Amazon EC2. We chose Amazon DynamoDB as it enables users to offload the administrative burdens
of operating and scaling distributed databases to AWS, so we don’t have to worry about hardware provisioning,
setup and configuration, replication, software patching, or cluster scaling. DynamoDB automatically partitions and
re-partitions data and provisions additional server capacity as our table size grows or increase our provisioned
throughput. In addition, Amazon DynamoDB synchronously replicates data across three facilities in an AWS
Region, giving you high availability and data durability. So, it is a fully managed cloud database and supports both
document and key-value store models. Its flexible data model and reliable performance make it a great fit for
mobile, web and many other applications like our application.
Testing Idea.
Below is the detailed explanation of testing the project idea starting from Collecting survey information to
publishing the analytical data.
1. Creating and Posting the Survey information.
Under this segment, we are getting the survey on the favorites car. Before taking the survey, the user is supposed
to give his personal information which includes the details of email id, nationality, age. After having provided the
details, proceeds to take the survey. The survey form is as shown below.
Ones the user selects the option and clicks on submit, the survey data from the web application is sent to AWS
platform for further process. Right now, we are using POSTMAN to send our survey information to AWS database.
Postman lets us send almost any kind of HTTP request. The body editor is divided into 4 areas and has different
controls depending on the body type. The URL is the first thing that you would be setting for a request. The URL
input field stores URLs used previously and will show an auto complete dropdown as you begin entering your
URL.
The Postman interface is divided into two areas as you can see in our below image. The sidebar on the left and the
request builder on the right. The request builder lets you create almost any kind of request quickly. The four parts of an
HTTP request are the URL, method, headers, and the body. Postman gives you tools to work with each of these parts.
Here is the jSON structure showing post request where you can see the survey parameters email, age, nationality and
favCar as shown in the above description.
2. AWS Elastic BeansTalk and DynamoDB configuration
Elastic BeansTalk configuration is lot easier and straight forward because most of the configuration options have default
values that are applied automatically by Elastic Beanstalk. Provisioning, load balancing, autoscaling, and application
health monitoring are all automatically handled. Below is our configuration with the default setting provided by AWS.
Here, our port is 8080, Scaling is single instance, Instance type is t1.micro and we are using Spring Boot Framework to
design our application.
For creation of table and storing data in DynamoDB we used the AWS SDK for Java programming and wrote
programs to perform the following Amazon DynamoDB operations:
Create a table called survey_data with columns email, age, American, European, favcar and
load sample data in JSON format.
Perform create, read, update, and delete operations on the table.
Run simple queries.
DynamoDB also provides feasibility to query using attributes option and see the result. Here, in the below screen
we can see the number of records for American Nationality using attributes option.
3. Establishing Communication and working.
Here is the technical structure of what happens in the background when the data is pushed using POST service,
the survey controller accepts the POST request and Survey service logic helps to store data in DynamoDB. The
logic here is written using JAVA in the platform provides by Elastic Beanstalk. The process is facilitating with the
war file which is created when the data is posted from postman service.
Below is the logic written for Survey Controller and Survey Service using Java.
Ones the data is in DynamoDB, we have written logics to fetch the intelligent data from the information collected in the
database. Email is a primary key and one unique email represents one unique row which has variety of information
stored in respective columns. So, the logic is written to compute count of people having different choices of cars with
respect to age for a country. i.e. If 2 people like Honda, then the result will be 2 (total). Below is the logic written to
prepare analytical data.
Technically, as per the logics shown above in the JAVA class named Analytic_controller.java and
Analytic_service.java, analytics controller accepts the analytic request and Analytics service uses DynamoDB data
to compute the stored data. Here is the technical architecture.
So, for now, let say the user wants to see the feedback, he can see the responses through POSTMAN GET
responses which can be seen in the below screen. the intelligent data is retrieved after the computation happen
in AWS platform and published to user as statistical data. As we can see the in the below image, the statistic is
listed based on the age of the survey providers.
We can change the survey result by changing url in the below screen from survey 1 to survey 2 if want to see the results
for American as the above result show for European nationality.
http://lowcost-env.mepngaqcem.us-west-2.elasticbeanstalk.com/analytics/survey1
to
http://lowcost-env.mepngaqcem.us-west-2.elasticbeanstalk.com/analytics/survey2
4. Reporting:
In a load, balanced environment, Elastic Load Balancing sends a request to each instance in an environment every
30 seconds to confirm that instances are healthy. By default, the load balancer is configured to open a TCP
connection on port 80. If the instance acknowledges the connection, it is considered healthy. If a health check URL
is configured, Elastic Load Balancing expects a GET request that it sends to return a response of 200 OK. We can
see in the GET screen of POSTMAN, as was demonstrated during presentation (same has been shown in above
mentioned GET screen), we got 200 OK message which means successful completion of request. Below is the
heath check report of our project which represents information related to Environment, CPU utilization, Max
network in and Max network out report.
After the computation is done, we can publish the statistics in the below screen in Elastic Beanstalk which is the
outcome of number of people interested in below highlighted cars per their respective ages. The presentation can
be done both for American and European nationality separately and combined as per the requirement. Same
information can be published to users via app in whichever format is favorable to see the computation
information. For now, we have seen that survey 1 and survey 2 urls represent result for each nationality in
POSTMAN using GET command. Below we have captured for American Nationality, depicted age in the x axis and
population count as y axis. All the 3 cars are assigned to different colors facilitated be Elastic BeansTalk. As
demonstrated, when we move the cursor along the x-axis, to know the exact count of car lovers with respective to
age. The design of the below statistics can be changed as per the user’s requirement.
Conclusion:
Glad to be able to pull together all the important aspects of Cloud Computing inclusive of all the reviews provided
to make one unified solution required for online survey.