Need to create Database on Amazon EC2 instance - amazon-web-services

I need to save data in a single table for later reference. The volume will not be more than 1000 per day and there will not be any joins. The DB will contain only single table.
I do not want to create on Amazon RDS as the cost is high for my corporation and also the connectivity between EC2 and RDS will require approvals and will take time.
I have root access, so is there a DB I can create on EC2 on any port which my web app running on port 80 can use?

Just access the EC2 instance via SSH and install a mySQL database.
Guide for Ubuntu, but should work for Amazon Linux as well:
https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/
However, if it is that low volume, you may want to check out DynamoDB. That may be a much more cost-effective (and easier to maintain) solution

If you have ssh access and root permissions then you can install any community edition of databases.
For an RDBMS, mysql can be an easier choice
For a noSQL DB, mongoDB is quite easy to setup

Related

Update Amazon RDS for MySQL database instance

How to apply a new operating system (OS) update with critical security fixes update for Amazon RDS for MySQL database instance with little/no downtime?
In my case, I have the following database with multi-AZ to be update
in US-EAST-1 Region:
MySQL-cad-57-replica
MySQL-cad-57-rds
cad-DB-prod
Can someone guide what should be the best strategy to reduce the downtime? and Is there a way to know how much downtime would be applied?
Amazon Relational Database Service (RDS) is a fully-managed service. You do not have any access to the operating system or database installation. AWS is fully responsible for maintaining the infrastructure (In fact, there is no way to even know what Operating System is being used!)
You can, however, control updates to the database engine. You can configure Amazon RDS to automatically perform minor updates during a specified maintenance window. Major updates require you to specifically request the update.
See: Upgrading a DB instance engine version - Amazon Relational Database Service
During such updates, there will be some downtime. You can avoid the downtime by using High availability (Multi-AZ) for Amazon RDS - Amazon Relational Database Service, which deploys two database servers. While one server is being updated, the other server will service requests. The active server will then be switched. There is only momentary downtime and any current connections to the database will be closed.

Migrating on premise web application to AWS ec2

Can some one please advise the steps required for migrating a web application which is currently running on tomcat server at onpremise to AWS ec2 instance. I understand this is not a straight forward and requires some detailed process.
The code is wrriten in Java and database used as oracle.
So it would be helpfull if someone can suggest me any relavent document or any website which gives some demo to refer me and proceed with this scenario.
If it's a personal project then I would recommend Lightsail as the simplest way to deploy existing Java application.
For a database a small instance of MySQL or if relational database is not needed then a document database like DynamoDB. https://aws.amazon.com/products/databases/?nc2=h_m1
There are multiple choices one how to migrate a Java application to AWS.
You could potentially use existing AWS services like:
Lightsail - https://aws.amazon.com/lightsail/
Beanstock - https://aws.amazon.com/elasticbeanstalk/
or
EC2 instance and install Tomcat manually
Use ECS with Docker https://aws.amazon.com/getting-started/tutorials/deploy-docker-containers/?nc2=type_a
As for Database solution Oracle is an option but quite expensive one.
When moving to AWS it's better to use one of the RDS managed databases like MySQL, Postgress or more expensive like Aurora.
In order to propose an architecture some details would be needed on predicted load, the size of the application and volume of data. Is the product regional or global, are there any additional issues that need to be addressed while moving to a cloud (performance, availability etc), how users are authenticated (are any other services needed).

Accessing a database inside an EC2 instance

Is it possible to create a database server (MySQL or PostgreSQL) inside an EC2 instance (running Windows 2016) and access it the way we access an RDS or do I need to have a separate RDS for that purpose?
My plan was to have an EC2 instance and use it as a server for accessing some Windows applications to my (small) company as well as an always-available database to store our reports.
Please let me know if I am on the wrong path.
Yes, you can install MySQL or PostgreSQL on an EC2 instance, just like you would for a server that was within your company.
You of course won't have all of the extra redundancy/backup features that RDS provides for you - unless you start adding all of that yourself i.e. automated backups, slave/master configurations, read replicas etc. (and if you do start adding all of those extra features in I would reconsider your decision not to use RDS).
I do this for some smaller, less mission critical solutions I support, and generally have not had many issues; I still prefer RDS when possible, but its not always an option for me.
You can install and configure DB on windows and access from your app. the endpoint will be windows machine IP and running service port. you have to allow the application from the security group.

Daily automatic backup of mysql database Amazon RDS snapshot to an via SSH

I would like to copy/clone the the database inside the newest RDS snapshot on Amazon RDS to a specific server outside of Amazon. I'm looking for a way to backup the mySQL database of it. I would like also to use a daily cron job that triggers a mysqldump from the newest RDS snapshot directly and copy this mySQL dump to a location on a different server via SSH or FTP.
At the moment the steps are way too time consuming. You need to replicate the snapshot to a new RDS instance, access the database via SSH, dump the database on the local PC and then upload it on another server.
Is there perhaps a different approach or alternative? Thanks already for any good hint, advice and help!
RDS snapshots are an AWS specific thing.
What you are describing is traditional database snapshots, which is pretty much your only option since you cannot download an RDS snapshot. There are offerings to do this, but what you are doing is pretty much the most common way. The only other option is to use an AWS instance to do this on a cron.
If you really want the data from an RDS snapshot, it will add time, but you could clone the RDS snapshot into a temporary instance and back that up to a file.
There is no way to do a mysqldump directly from an RDS snapshot. You have to restore the snapshot to a new server instance and then take a mysqldump of that new server instance.
It sounds like you need to forget about the RDS snapshots and just do daily mysqldumps directly from the database server, via a cron job.

Amazon AWS RDS vs EC2 with SQL Server [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
We have a web application on Windows Server and SQL Server and want to move it to Amazon AWS.
We will have an EC2 Windows Server running IIS but we have a question about if it better to have an RDS SQL Server database or if we should better have an EC2 bundled with SQL Server.
For performance and replication what do you recommend?
I appreciate your help.
We recently migrated a SQL database with some deadlock issues to AWS and looked carefully at AWS -- it was not a match for us due to a huge performance risk vis a vis deadlocks, so we went with EC2 instances. The users have been very happy with the performance.
From a performance perspective, Amazon's provisioned IOPS features are excellent, and these are available on both RDS and on the EC2 server instances. RDS also has killer automated backup capabilities. It's truly a set up and forget type of system.
AWS RDS does not support SQL Server replication. If your intent is to replicate something from your site to the AWS instance, then your options are to use a Windows Server base instance with your own SQL Server ISO/license, or to use a pricier EC2 AMI based on SQL Server. RDS has its own replication system that will support replication to another RDS instance (even on a different availability zone) to increase resilience or automate failover. With RDS you could also roll your own site to cloud snapshot replication by using bcp on prem, but that might require you to alter your application or schema.
A couple of advantages we found to using an EC2 instance over RDS:
With an EC2 instance, you get sysadmin on the database instance and administrator on the underlying Windows Server. RDS does not allow this, and in fact, with RDS you lose access to the shell and to the underlying Windows Server administration tools. This means that you cut out some basic tools for performance management: System Monitor, tracerpt.exe, Windows System Resource Manager, etc.
With an EC2 instance, you can use SQL Server Agent to run jobs that include command line or powershell scripts. RDS does not allow this.
Assuming your IIS is on one EC2 instance and SQL on another EC2 vs RDS...
RDS performance vs EC2 performance vs price seems fluid but there is one major impact for Microsoft SQL Server users and RDS that may help you decide.
You can not use Backup / Restore to move DBs in and out of RDS.
If this matters, EC2 is the only way to go.
Of course, there are a number of options other than Backup / Restore including a decent data migration designed to work with Azure that also works with RDS but it often fails for some complex environments.
Its clearly best practice to keep the DB and web layer on separate machines, so an EC2 instance for your IIS and RDS for the database would work fine.
You could also use 2 EC2 instances, one for IIS and one for the DB - that will also work.
RDS is probably the best option, if you don't take into account price - without knowing the traffic on your site, how important the DB is (i.e. could you afford to be down for 8 hours? could you afford to lose the last 15 minutes worth of db changes etc), there is no right answer...your budget and your requirements will be the deciding factors...
All that said, I have some low traffic sites that run with IIS and SQL Server express on a single EC2 instance, and they run just fine - and is very affordable and easy way to get on AWS, with the option of improving that config as your budget allows and traffic dictates.
Answering after experiencing both -
if all new development -fresh database(no production level data) - no need to think and just go with RDS.
But if working with existing application and database. easiest way is SqlServer Instance on EC2. this will save you lot of hassle of datatype errors not supported by RDS.
Moving existing Data to RDS can be a big pain. i learned my lesson by hard way. And end up using ec2 sql server instance.
Have a look at the AWS Architecture Center. The Web Application Hosting datasheet fits your scenario. Deploying each application layer to a suitable infrastructure service will help you building a reliable and performant application.
You have to definitely go with RDS. Moving existing data to RDS used to be a big pain for us too, before we found the Cloudbasic SQL RDS AlwaysOn tool on the AWS Marketplace:
https://aws.amazon.com/marketplace/pp/B00OU0PE5M/ref=_ptnr_blg_’blg4’
This tool was designed to continuously geo-replicate RDS from one region to another for HA/DR and reporting. But it can also be used for moving data in and out of RDS. The best part is, it supports DB instance replication for SQL Server Web Edition. You can even replicate from SQL Standard to Web edition, from SQL 2008 to 2014 etc.
Another reason RDS is recommended over EC2 with SQL Server is the Multi-AZ HA feature. However note that it works for the pricey Standard and Enterprise editions only, and the replica is not accessible (it is for mySQL and oracle, but is not for SQL Server). It cannot be used for reporting. You just know it is there but cannot actually access it. And Multi-AZ works within the AWS region only. If you are fine with the cost and the limitations, it is definitely recommended. Alternatively you can use the Cloudbasic tool to continuously replicate RDS SQL Web edition from i.e. your primary AWS Virginia RDS to RDS in Oregon for reporting and DR. And it costs a lot less compared to RDS Multi-AZ with SQL Standard.