The EBS (Elastic Block Store) Volume is known to offer a persistent data. If we launch an instance and in order to make the data persistent, we attach an EBS Volume to it. Even if the instance terminates, the volume will still be there and the data will not be lost.
Suppose there is an AMI type directly available. In that scenario, when we launch an instance it would always have an EBS volume attached to root device only. So, whatever data the user is storing will always be persistent with EBS. If the instance is terminated, we can configure EBS volume to avoid termination. Whenever the root volume is not terminated, we launch new instance and attach EBS volume to that and all the data will be available.
EBS is a faster AMI to boot. When such AMI is launched, Amazon automatically creates an Amazon EBS volume and attaches as root volume. All the data in root storage is always persistent with EBS Volume. Only warning for the user is that when it is created all the data will be available.
Suppose we launch an instance where there is an EBS volume attached to that. The cost of the EBS volume along with the instance running cost will be charged. Basically, the EBS volume will cost 5 cents per GB. In case if we create a 10 GB volume, there will be an additional 50 cents for the entire month.
S3 (Instance Store-Backed) AMI
To explain instance store-backed AMI let’s take a scenario where we launch an instance. By default it would have 1TB, 2TB attached to it and it would be in the ephemeral storage. As long as the instance runs, the storage will be there.
For example, if you launch an instance and deploy the database, in that scenario if instance terminates, all the data will be lost. To cope up with that challenge, we attach additional EBS volume and we store all the data in EBS. A point to note is that the EBS volume is not the root volume but an additional volume. Here, instance store-backed AMI will not give persistent storage since all the data is ephemeral storage and if instance is terminated, all the data will be lost.
Why EBS-backed AMI is more popular?
When we launch instance, it would first be pending before it runs and shuts down. Amazon will charge you only for the cost of running.
In the EBS-backed AMI, instance would be built in running cost, but it can be stopped. When we stop the instance, the running cost is not charged. Instance running cost is applicable only when instance is running. But there is also an additional cost called the EBS storage cost, which is very minimal. For example, if someone wants to run instance for 4 hours a day with instance costing 10 cents per hour, we won’t be able to stop the instance with a total monthly cost of $72.
In the EBS-backed scenario, we run instance on only 4 cents. If we create a 100 GB volume, when the instance is stopped, it would charge only $12. If we take the storage cost of 100 GB, it would come to $5. The total cost will be $17 and we will be able to save $50. If we want to stop instance for 1-2 hours, we can use EBS-backed instance.
Apart from that, EBS-backed instance has the advantage of creating an AMI, having faster boot and support stop-stare. EBS-backed instance is often used 90% by those part of Amazon Web Service. If we start and stop instance multiple times in an hour, it will charge on an hourly basis.
For Example, if we start an instance at 9:00 AM and stop at 9:15 AM and again start at 9:30 AM and stop at 9:45 AM or start at 9:50 AM and stop at 10:00 AM, every time you stop Amazon would round off to the nearest hour. Starting and stopping every 15 minutes is not practical. But the point to note is that every time the user starts and stops, it would be charged.
Got a question for us? Mention them in the comments section and we will get back to you.