AMAZON S3 VERSIONING
Chandana Yandapalli
Contact Center Developer |AWS Cloud| IVR |Genesys Cloud|Python|Amazon Lex|Amazon lambda|Amazon Connect|DynamoDb
In pervious blog we seen about basic functions of S3 with different components?in s3 now in this blog we discuss detailed about the versioning component in amazon s3(simple storage service) with an?real time example.
Amazon S3 Versioning :-
Amazon S3 (Simple Storage Service) provides a versioning feature that allows you to keep multiple versions of an object within a bucket. When versioning is enabled for a bucket, each new version of an object is assigned a unique version ID, and previous versions are preserved.
Here are the key aspects of versioning in Amazon S3:
1. Enabling Versioning: You can enable versioning for a bucket using the AWS Management Console, AWS CLI, or AWS SDKs. Once enabled, all subsequent uploads or modifications of objects in the bucket will create a new version.
2. Unique Version IDs: Each version of an object is assigned a unique version ID, which can be either a string of characters or an automatically generated UUID (Universally Unique Identifier). Version IDs are immutable and can be used to access or reference specific versions of an object.
3. Object Operations: With versioning enabled, typical operations on objects behave differently:
??- PUT: When uploading a new object with the same key as an existing object, S3 creates a new version of the object, preserving the previous version.
??- GET: By default, a GET request retrieves the latest version of an object. However, you can specify the version ID to retrieve a specific version.
??- DELETE: When deleting an object, S3 marks the object as deleted but retains the previous versions. Deleted objects can be restored if needed.
4. Listing Object Versions: You can list all versions of objects in a bucket, including both current and previous versions. The listing provides information about the version ID, size, last modified timestamp, and whether the version is the latest or a previous version.
5. Bucket Lifecycle Policies: Versioning integrates with bucket lifecycle policies, allowing you to define rules for transitioning or expiring versions of objects based on specified criteria. This enables automated data lifecycle management.
领英推荐
6. Access Control: Access control for versioned objects is managed using bucket policies, IAM policies, and Access Control Lists (ACLs). Permissions can be set at the bucket level, object level, or specific version level.
7. Storage Costs: With versioning enabled, each version of an object incurs storage costs. This includes the current version as well as previous versions. Therefore, enabling versioning may impact your storage costs.
now with an real time scenario we can see how the "versioning "was help us
Imagine you own a restaurant and you have a menu that lists all the dishes you offer. You regularly update the menu to add new dishes or modify existing ones based on customer preferences and feedback.
Now, let's say you decide to enable versioning for your menu. This means that instead of directly replacing the previous version of the menu whenever you make changes, you create a new version and preserve the old ones.
For example, if you introduce a new dish called " DESI BURGER" and update the menu accordingly, instead of erasing the previous version of the menu, you create a new version that includes the " DESI BURGER" along with all the previous dishes. Each version of the menu has a unique identifier or version number.
Enabling versioning for your Amazon S3 bucket works similarly. Each time you upload a file (like a menu) or make changes to an existing file, instead of replacing it, a new version is created with its own unique version ID.
This versioning system allows you to keep track of changes made to the menu over time. If a customer asks for an older version of the menu or if you want to review the changes you made, you can retrieve specific versions based on their version IDs.
In the restaurant example, versioning in Amazon S3 enables you to preserve and access previous versions of files (like menus), allowing you to maintain a history of changes. It's as if you have a record of every menu version that your restaurant has ever had, making it easier to review, restore, or retrieve specific versions as needed.
Thank you for reading !
Believe yourself to create magic around you