Containerised Web Application which connects to Relational DB - amazon-web-services

Can anyone point me in the direction of some demo code/app that I can use for a demo.
The app should have the ability to connect to a relational database and ideally be able to demonstrate the persistence of having the DB.
I.e. You can save values into the DB from the web app
I'm planning to deploy this onto AWS ECS for testing, alongside RDS.
Thanks in advance

Here is an AWS tutorial that shows how to write a Java Spring Boot Web app that is deployed to Elastic Beanstalk ( Elastic Beanstalk is an AWS service that leverages Amazon EC2 and S3 and deploys, manages and scales your web applications for you. It uses managed containers that support Node. js, Java, Ruby, Docker and more) and uses RDS to store and update data.
Creating the Amazon Relational Database Service item tracker
So most of what you are looking for is there - including how to setup the RDS instance and interact with it from a web app deployed to the cloud. If you follow this step by step (there is a lot of Java code) -- you will get this Sample Web App running on the cloud and it will teach you how to interact with RDS from a web app.
Also - this covers invoking additional services such as Simple Email Service from the web app.

Related

What are the differences: Django, Apache, AWS

I'm studying web and confused about the concepts of Django, Apache, and AWS.
I have an experience of developing web backend with Django and AWS.
Django handled the interactions between web browser and server.
AWS enabled the clients to share the same server and data.
But, what is Apache? This wasn't considered during the development.
According to my research, Apache is web server application.
But, I can't tell the exact difference of it with AWS.
Does AWS include Apache?
Please help me make sure what Apache is. Thanks :)
Django
Django itself is web framework used for developing web applications based on python. Which is used for making development proccess more simple and easy. It provides various built in things such as Django ORM, Forms, Security, Authentication, Admin and many third party packages that are available on django packages. Which enables you to develop your application rapidly.
AWS
AWS stands for amazon web services which provides cloud applications such as computation units, cloud storage, databases, cache servers and so on. It provides computation units to deploy your web apps on. i.e EC2 intances (Elastic compute cloud). As well as it provides database such as RDS (Amazon relational database) along with S3 buckets (Amazon storage) for storing media files and serving static ones.
Apache
Apache is web server which is used to deploy web applications on production. You can setup Apache web server on you premises or let you setup in cloud platform such as Amazon EC2 instances. By defalt Django or any other web apps run on single thread which do not give better performance. Apchae web server enables you to run multiple threads/ workers to handle parallel request simultaneously.
By putting all together You can develop you application using Django framework. Than choose AWS for deployment steps. i.e EC2 instance for Apache web server setup, RDS or any other database instance and S3 bucket for storage option.
Please note that this setup may be vary upon your requirements
These are two completely different services/software. AWS (Amazon Web Services) is a cloud platform where you run applications and softwares.
Apache on the other hand is a SOFTWARE that run on servers. So, essentially you can run Apache on AWS.
That is the basic idea. AWS is a platform and Apache can run on top of AWS.
The stated goal for Django is to offer a web application framework that enables quick development and minimal code.That goal can be accomplished with a simple single-threaded web server that simply facilitates development and testing.
The goal of Apache httpd, Nginx, IIS, etc. on the other hand is to offer exceptionally scalable and performant web servers. These applications are highly configurable as all applications differ and there's no one size fits all. They also require different expertise to design, implement and maintain.

Database connections with RDS not working after deploying

I have developed a Dynamic web App, which leverages Amazon RDS. Servlet talks with RDS fetches data and presents it using JSP. The process is working fine. Next, I uploaded the war file of project on AWS Elastic beanstalk. But Database connections are not working.
Could you please guide me here? Why my connection variables are not working after deploying?
I made few changes to the early deployment and now App takes forever to load.

Hosting web services project in Amazon

Hi We have built a java based web services project with using jboss server. How do I host this application with Amazon cloud? This web services act as back end for a mobile android app.
I am looking for PaaS option of Jboss server and Postgres database. I could create a postgres database. But could not find Jboss server.
My understanding is in PaaS, Jboss and Postgres should be able to scale up itself as per demand.
Another option provided by Amazon is EC2 as far as I have understood. But if I go with EC2, I will have install and set up jboss and postgres on my own. Then does it scale up by itself as per demand?
Please guide.
If you want to deploy your web application to AWS and ensure its scalability, you have basically two options:
EC2 instance [IaaS] - The disadvantage is, as you mentioned in your question, that you have to configure everything manually. Some external mechanism for scaling has to be used. Amazon provides its AutoScaling service which can be configured to launch new EC2 instances based on utilization or some other metric.
Elastic Beanstalk [PaaS] - This service has the auto-scaling already built in and manages the EC2 instances with your application on its own (it takes care about launching them, deploying the app etc). The disadvantage is that JBoss server is not support at the moment (you would have to switch to Tomcat).
There is a way, how to make JBoss work on Elastic Beanstalk, however. ELB has newly added the support for Docker so if you make your JBoss API run in Docker, you can deploy it to ELB and scale it without much effort and configuration.
As for the database, mentioned in your question, Amazon has plenty of choices, Postgres included, in their RDS service.

Deploying J2EE Web Application on Amazon Web Services

I had been working on amazon web services from couple of days and it is giving me a hard time. All the want it to deploy my J2ee web application on Amazon web Services. I had used the following approach:
1) In had installed the AWS toolkit on eclipse.
2) I had deployed the sample web application of the amazon web services but it is without database. It's a static web page.
But i want to deploy my j2ee web application on aws with apache tomcat 7 as server and mysql database server. Can any one explain me how to deploy the j2ee web app on the aws? I would be highly thankful to you.
I would suggest you try AWS Elastic Beanstalk
If you use tomcat with your Java EE application, it become easier because it already have some templates for that. Creating and Deploying Elastic Beanstalk Applications in Java Using AWS Toolkit for Eclipse
As for mysql, AWS also has the RDS which can do it perfectly. Just modify your database.config in your Java EE application according to this.
Hope it will help.

AWS Elastic Beanstalk necessary for Websites (vs. web apps)?

The documentation only refers to web applications. Do I use the Elastic Beanstalk for my website or is it strictly for web apps? I've launched an EC2 instance that is not connected to the Elastic Beanstalk, however the default instance is running in the Elastic Beanstalk environment.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
Elastic Beanstalk can be used for several type of applications:
Web App. Websites are included in "Web App" but it could be just a simple REST Api used by a mobile app and it would work as well.
Worker Application. Typically an application that would get message from a queue like SQS.
Elastic Beanstalk is a tool to help deployment of an entire infrastructure, from installing a webserver to deploy the code of the application and applying custom installation script. If you have a website using any technology supported by Elastic Beanstalk (Java, Node.js, PHP, Python, Ruby, and .NET) , I would definitely suggest that you use it as it is very simple to use and gives you a lot of advantages over a single ec2 instance.
You can read documentation for workers application here : http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html
And I would suggest that you read the FAQ for more details:
http://aws.amazon.com/elasticbeanstalk/faqs/
As an example, in my company we set up beanstalk for more than 15 websites: internal Backend tool in PHP, workers to send sms or emails, website with thousands of simultaneous users. One of the important point to mention is to be able to have a new website infrastructure up in about 20 minutes (new server with all configuration and code deployed).
Hope this helped you to understand Elastic Beanstalk. Don't hesitate to ask some more question and check Stackoverflow, there is a lot of information about it.