What is the Recovery Point Objective (RPO) of a single RDS instance? - amazon-web-services

I know there are automatic snapshots created every 24 hours, and that you can recover point in time in a minute timeframe. But what is the Recovery Point Objective (RPO)? Is this a minute? Or 24 hours because you need the latest daily snapshot? The documentation is not clear about this.

RPO Should be 5 mins https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html
RDS uploads transaction logs for DB instances to Amazon S3 every 5 minutes. To determine the latest restorable time for a DB instance, use the AWS CLI describe-db-instances command and look at the value returned in the LatestRestorableTime field for the DB instance. In the AWS Management Console, this property is visible as the Latest restore time for the DB instance. You can restore to any point in time during your backup retention period.
Someone tested it back in 2012 with a powershell script. https://www.yobyot.com/aws/aws-rds-backup-recovery/2016/02/09/
As you can see in the screenshot below, a simple PowerShell script that ran for 20 minutes demonstrates that AWS is, indeed, making that very tight RPO possible. My little test instance was off only twice, by an insignificant minute or so.
Archived Link: http://archive.vn/8ZbuS https://web.archive.org/web/20190102131221/https://www.yobyot.com/aws/aws-rds-backup-recovery/2016/02/09/

Related

Stop AWS OpenSearch service temporarily for cost savings

I am looking at doing some cost savings in AWS and want to know if we can stop and then start the AWS Opensearch service for a couple of days.
My scenario is that the application which uses the OpenSearch service (Elasticsearch) remains down during 2 days every week... During this time OpenSearch remains active and incurs costs...
I know one option to save the costs is to downgrade the node type and reduce the number of nodes during the application downtime.
But let me know if there are any other options where I can entirely "Switch Off" and "Switch On" the service just like we can do with EC2 instances.
There is no way to stop the cluster today. What I have seen to reduce bill was that team edited the cluster to reduce the instance type to a t2.small (or smaller ones) instance which is significantly cheaper than the previous instance.
Then when they needed to resume testing they changed the instance type back to what they required.
One other thing maybe is to take a snapshot of your domain, the disable Opensearch for the weekend. Finally restore it back on monday with the snapshot you got.
AWS launched OpenSearch Serverless during reInvent 2022 but still in preview.
This is the ideal solution which would not require you manage clusters.
https://aws.amazon.com/opensearch-service/features/serverless/
Until then, go for downsizing the instance during non peak hours.
[Edit]: It is GA now as on 25th Jan 2023
https://aws.amazon.com/blogs/big-data/amazon-opensearch-serverless-is-now-generally-available/

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.

AWS run instance for exact amount of full billing cycles

I'm trying to optimize cost for my project for some valid reasons we're running it on very expensive instances.
To the best of my knowledge Amazon charges by hours. For instance, if I'm running my EC2 instance for 1 hour and 4 minutes I'll be charged 2 hours.
What would be the best way to shut down instance closest to the next billing cycle, but not exceeding current one?
I was trying to do this based on uptime, but there is some difference between aws billing and uptime value.
I'm looking to use watchdog sitting on the instance itself. So I can pass parameters during provision and it will shut down itself say after 2 full billing cycles.
You can get the time that Amazon starts billing from the EC2 instance (assumes you have jq installed)
curl -s http://169.254.169.254/latest/dynamic/instance-identity/document/ | jq .pendingTime
and you could run a shell script once a minute to shut down after, say 58 minutes.
But this is a pain. If your processing is able to handle interruptions of an instance running then you should look at using spot instances perhaps with a fixed duration. This allows you to run at a reduced price for a known period of time without any additional costs because of running over.
If your workload is complete before the full hour, stop/terminate your instance right away when the work is complete. No need to keep the instance idle for the remainder of the hour.
The only time this may not be efficient is if you may have more work coming in before the full hour, and then you want to keep it running to process that new work. But that will only be the case if work is sporadic. And if it is sporadic, then it just may be better to keep it running.

RDS incremental backup

We are trying to take incremental back for mysql in RDS. We are unable to find any methods to take incremental backup . How can this be done in RDS ? In FAQ we read that we can restore the data up to last five minutes. But we are not sure how to do that?
You can use AWS Data Pipeline to do this.
It supports full RDS dump or incremental dump and restore.The problem is you cannot reuse a pipeline. You will have to clone the pipeline and create a new one using AWS Lambda or Jenkins or some other job scheduling system each time you want to create a Backup or Restore.
Check out this blog to find more information on that.
a. RDS provides Native incremental backup feature - RDS snapshots and also has a feature called Point in time recovery (PITR). This allows you to restore a state of RDS instance from last 5 minutes upto max 35 days in the past (35 days being the max automatic backup retention period).
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html
b. You can also trigger Manual snapshots in RDS - which is once again incremental (which means that if you have a running RDS server of 1TB your first/base snapshot will be 1TB) and any subsequent snapshots of the same server will only capture the modified blocks. In manual snapshots there is not retention period. You can keep as long as you wish unless you want to delete it manually. But the PITR feature is not available over Manual snapshots (i.e not longer than the configured automatic backup retention window)
In both the above features, you are dependent upon the RDS API/platform to take backup, list all the backups and restore RDS from backup. You dont have any control over the raw data / row level data.
For raw data backup, you need to consider Mysqldumps and restore - but that is an expensive operation (both backup and restore). You can use some third party tools like (percona) which provides good utilities to perform the same - but you cant use few tools because RDS does not allows you with RDS host access - so unless you run your own Mysql on VM/EC2, you are limited to the above 2 options. hope this helps.
https://www.percona.com/doc/percona-xtrabackup/2.3/innobackupex/incremental_backups_innobackupex.html
https://www.percona.com/doc/percona-xtrabackup/2.3/backup_scenarios/incremental_backup.html

RDS - Why is a backup created on creation

I am working with RDS and I have noticed that when I create the database it seems to create an automated snapshot.
I can understand this when the instance is being shutdown by why is one made when the database is actually created, and is there any way to stop this from happening?
You can set the instance's backup retention period to 0 which will disable backups. However, as far as I know there is no way to create an instance in this state.
RDS uses this snapshot along with the MySQL binary log (or equivalent for other dbs) to provide point in time recovery with 5 minute granularity, as well as restoring the whole snapshot.
This is RDS doing a backup for you. It defaults to every 30 minutes, but it can be increased up to every 3 hours. You are not able to disable this as it is core functionality for RDS's disaster recovery implementation so that the database can be restored to a 30 minute relative point in time whenever necessary.