AWS database operations and hour price - amazon-web-services

I need to host Accounting desktop application on Windows server. SQL database of this application will be used as a source for ecommerce website, so there will be quite often read/write operations to this database (from different linux server). Is using AWS a good idea here? Does the read/write database operations count for usage? Meaning, if I have a cron that reads DB every 5 minutes, does it mean I will be billed for 24/7 usage?
Thanks.

In databases PaaS = RDS (like in EC2, so with VMs) you're paying per hour of instance that you have available, it doesn't matter if you use it or not.
Answering your question - it doesn't matter if you will be querying the DB every 5 minutes, 1 second or 1 hour. You will pay for the database the same amount (transfer costs are in most cases negligible when compared to EC2/RDS costs) = for the availability you need. If you need it to be available 24x7, you will pay for 24x7. If you need your database to run only during specific hours during the day (or only Mon-Fri) you can automate starting/stopping it (e.g. with CloudWatch Events + AWS Lambda) to lower your cost.
But then I guess if it's ecommerce, you anyway need the database to be available 24x7 :)

Depends. If you want to setup your own SQL server on an EC2 instance or use AWS RDS.
In case of former you SQL server is like any other application running on an EC2 instance and the costs are simply a factor of EC2 pricing
In case of latter refer AWS RDS pricing for SQL Server

Related

AWS EC2 On-Demand Pricing

I'm new to AWS EC2, and I wanted to deploy a web server in it. However I'm concerned about the price because the app will only be used for a few hours per day and I saw in the AWS Calculator that there's a Utilization per month as part of the billing computation https://calculator.aws/#/createCalculator/EC2.
What does the Utilization mean? Let's say I have a running EC2 instance. How do I reduce the charges?
Does it depend on the amount of times the server APIs are invoked in the app? So for the hours that the APIs are NOT being invoked, I won't get charged?
Or
Will it keep on charging me as long as the EC2 instance is running so I should shut it down during idle hours to save up on costs?
Amazon EC2 is charged at an hourly price. The price varies by the Instance Type and the Operating System. Basically, machines with more memory and more CPUs are more expensive, and Windows is more expensive than Linux. There is also a charge for Data Transfer, which is traffic that goes out to the Internet.
If you have a small application, an alternative would be to use Amazon Lightsail, which offers a simple monthly price for both the computer and the traffic.
I've added my response to each of your questions -
What does the Utilization mean? Let's say I have a running EC2 instance. How do I reduce the charges? - You will be charged for the time you let that EC2 instance running, start with a t2.micro under free tier account, you are allowed to run it for 750 hours a month!
Does it depend on the amount of times the server APIs are invoked in the app? So for the hours that the APIs are NOT being invoked, I won't get charged? - No, for EC2, it's the runtime and not the API queries.
Will it keep on charging me as long as the EC2 instance is running so I should shut it down during idle hours to save up on costs? - Shut it down, I would also to setup billing alarms to get an alert once my bill crosses a certain threshold
As long as the servers are up and running you will be charged for it. So yes, you should shut it down during idle hours if you want to save costs.
If you just want to try it out for a simple Rest API server, you can create a new account for a 12-month free tier that will basically entitle you to the smallest 24/7 running (750 hours/month) server.
I've used this server for one of my smaller projects, and it was enough to serve about 100 users in total, with about maximum 10 people coming in and out time to time per day. Had no problem with it.

AWS RDS Pricing

I just followed a tutorial to create an RDS database. Since the time of creating my will I be charged every hour for which my database instance is active or will I be charged for everytime I make a query to the database?.
The simple answer is that you're charged for every hour your RDS instance is running, and (broadly) not how much you actually use it. There may be some small charges for large volumes of queries, but keeping the instance running is the main cost.
However if you're a new customer you can have a small RDS instance free for a year. Look for 'free-tier eligible' on the management console.
AWS has detailed pricing category for different DB which should be clear enough. Taking mysql "On-Demand DB Instances" as an example, it charges based on the type and duration, however for RDS T3 DB instances which uses unlimited mode it may involve extra fees if your average CPU usage exceed baseline.

AWS Lightsail MySql Database

I have taken a AWS Lightsail Unix Instance for one of my pilot project, I wanted to explore AWS ecosystem and thought this would be a easy playground to start with. The plan I opted was a USD 5 per month, which gives 1 GB Memory, 1 Core Processor, 40 GB SSD Disk and 2 TB Transfer.
After subscribing I created a LAMP instance and a Plesk Instance, assigned static IPs to both instances and setup connections from my PC to transfer files using PuTTY; also setup access to Plesk and phpMyAdmin to start work.
In the first month itself, I am seeing a huge bill of USD 985 for using AWS RDS, details in bill are as below:
Amazon Relational Database Service for MySQL Community Edition
$1.080 per RDS db.r4.xlarge Multi-AZ instance hour (or partial hour) running MySQL
My question is - When I created LAMP, does it create a AWS RDB service automatically, I have hardly used MySql for anything. It seems AWS Lightsail is throwing hidden charges without notifying customers about actuals.
No, creating a LAMP stack on Lightsail does not create an RDS instance on your behalf. With the LAMP stack on Lightsail, the MySQL database is installed on that instance alongside PHP and Apache - there is no charge beyond the $5.00 / month (in your case) as long as you don't go over the data transfer limit.
I can't say why you're getting charged for RDS, but it's not because you fired up Lightsail instances.
Thank you folks!
I tried to go through several docs AWS provides on pricing. There is no indication that AWS RDB services automatically starts on LAMP installation. I wanted to take second opinion before raising a complaint with them. I have opened a case, and they have confirmed to revert the charges, however there is no clarity how AWS RDS service has started. At present I have removed all DB snapshots and backups.

What AWS Service should I use?

We are currently runs in-house hardware that we would like to potentially move to AWS. Our main application uses MySQL on a Linux machine (200GB Disk, 32GB RAM, 4 Cores) serving content to customers through a hardware load balancer (around 1 million unique users per month).
We also use a 500 GB CDN hosted by a third party that we would like to move to AWS potentially. What AWS services would you recommend we look at to achieve comparable functionality and would you have a rough monthly cost estimate?
The main reason we would like to move to AWS would be for cost reduction in hardware and better backup strategies.
Thanks!
1.You can host your application using two or more EC2 instances and you can use elastic load balancer to distribute load amongst these EC2 instances.
2.You could use amazon aurora MySQL(server less) which offers you pay as you go service which will allow to get maximum benefits minimising your cost.It is the very best option for your MySQL database as your users are very high and so as the load on the database.
3.For CDN you could go for aws cloudfront and s3. it offers higher availability to your application and it also has less costing.You just need to make some proper configuration and you are ready to go.
AWS is the best cloud option for you as it provides service for your each problem so can use services according to your use and make most of it.
It also provides very good costing options whcih makes your tasks easy.
Please go through aws docs and costing before you choose aws.
Comparable functionality would be to use AWS RDS to replace your MySQL database, one or more EC2 instances to run your application, and then AWS Load Balancer to distribute the load amongst those EC2 web instances. A combination of S3 and Cloudfront to use as a CDN.
Cost is going to depend on how many ec2 instances you use, and the size and options you use for RDS database(s) plus storage and bandwidth - impossible for me to estimate for you
But you can do your own estimates here: https://awstcocalculator.com/

AWS architecture help for running database dumps

I have mysql running on one ec2-instance and tableau uses this database. mysqldump runs from production servers every 4 hours during which the system is down for probably 10-15 mins due to the dump. I am planning to have another ec2 instance with mysql running and and elb on top of these two instances so that the system wont be down trough the dump. For this I might have to de-register the instances from elb during the dump and register them back after the dump. Is this the right way to do it in the situations like this?
You can't use an ELB with MySQL servers. The ELB wouldn't know which server was master and which was slave, so it wouldn't know which to send updates to.
Is there any reason you aren't using Amazon's RDS service for your database servers? It provides automated snapshots that don't cause any down-time. It also makes it easy to create a read-replica against which you could perform mysqldumps without affecting the main server.
Currently you are taking logical backups of your system every 4 hours. Logical backups in most cases should only be used in a worst case scenario. In the event of a restore, logical backups are very slow compared to alternatives, such as snapshots and binary backups. If snapshoting using Amazon RDS or any of the other multitude of alternatives out there in your environment is not an option, I would look into Xtrabackup. This is a free stand alone HOT online binary backup tool that can be used with a Vanilla install of MySQL. This should not bring down your production server, assuming you are using InnoDB and not an alternative storage engine such as MyISAM. I personally used it for hot online binary backups and to automate building slaves in my previous work environment. A binary backups bottleneck is your network speed in terms of the restore process and is exponentially faster than a logical backup.
If setting up another MySQL instance is your only option look into GTID replication and/or Master-Passive HA environment in order to take the mysqldump off of the secondary non-active production server so that your production environment does not go down.
The bottom line is that you should not be taking production down to do a logical backup every 4 hours. This is def not ideal in any production environment.
Have a look at Amazon Database Migration Service (https://aws.amazon.com/dms/). It allows you to do zero-downtime database migration or just synchronization.