INFINITE UPSIDE

Technology and operations

What Does S3 Versioning Protect After a Deletion?

A missing object can have a history. Whether that history survives is the more useful question.

A team opens a cloud-storage console and cannot find a report it used yesterday. The application returns “not found,” but a colleague says versioning was enabled and the file should still be there. Both observations can be true. The important question is what was deleted, which version is now current and what rules have run since then.

Amazon S3 Versioning can retain multiple versions of an object in a bucket. In a versioning-enabled bucket, an ordinary deletion that does not specify a version ID generally adds a delete marker as the current version instead of erasing the earlier versions. A normal request can then return a not-found response even though a previous version remains. The S3 Versioning documentation describes these behaviors and their limits.

That is useful protection against some overwrites and deletions, not a promise that every previous version exists forever. Specific-version deletion, lifecycle rules, permissions, account access and other settings can change the result. Treat recovery as a process to verify, not a property to assume.

One name, several versions

Think of an object key as the name an application uses to find an object in a bucket. When versioning is enabled and a new object is written under that key, S3 assigns a version ID. A later write under the same key creates another version; the earlier one becomes noncurrent rather than being overwritten in place in the same way as an unversioned object.

Suppose a fictional business stores a monthly reconciliation under the key reports/monthly.csv. On Monday it uploads version A. On Tuesday it uploads version B under the same key. A normal request for the key returns the current version B, while an authorized request that specifies version A can retrieve the earlier content if that version still exists. The labels A and B are illustrations; real S3 version IDs are assigned by the service.

The difference between a key and a version matters during investigation. “The file is there” could mean the current version is accessible. “An old version exists” could mean something recoverable is present even though the application is not reading it. A list of names without version information cannot answer every recovery question.

Why a deletion can look like a missing file

In a versioning-enabled bucket, a delete request without a version ID normally creates a delete marker. The marker becomes current, and an ordinary GET for the key behaves as though the object is deleted. Earlier versions can remain in the bucket. AWS’s delete-marker guide explains how the marker changes ordinary requests and why another unqualified delete does not necessarily remove the marker.

Imagine Tuesday’s version B is current and someone sends an ordinary delete request on Wednesday. A normal application read can now see a not-found response, while version A and version B may still be present as noncurrent versions. That does not mean the application is malfunctioning or that the deletion was harmless. It means the current state and the stored history need to be examined separately.

A marker is not the file’s contents. It is also not proof that every earlier version survived. If a version was specifically deleted, expired under a lifecycle rule or never created while versioning was enabled, the marker cannot manufacture it. Check the version list, timestamps and the relevant bucket configuration before promising a recovery.

Two different recovery decisions

If the desired prior version remains, an authorized operator can retrieve it by version ID. Depending on the situation and the documented workflow, a team might copy that version to a safe review location, make it current through an appropriate restore method, or remove the relevant current delete marker. These choices have different effects on what applications and people will see.

The S3 guide to retrieving versions describes ways to retrieve or restore a particular version. Before making a previous version current, identify the key, version ID, timestamp and owner. A document that appears to be the latest good copy may omit legitimate updates made after it. Restoring it without coordination can replace one problem with a quieter data-loss problem.

Preserve a copy of the evidence needed for the investigation, and test the proposed recovery in a non-disruptive location when practical. Check that the content opens and supports the business task; a successful API response is not proof that the restored report reconciles or that an application can use it. For a set of related objects, verify whether they belong to a consistent point in time rather than choosing the newest available version of each independently.

Versioning is not an indefinite archive

Versioning settings and lifecycle rules operate together. A lifecycle configuration can transition or expire versions according to the configured rules. AWS explains that a rule for noncurrent versions can permanently remove them; retention periods and other protections may affect particular objects. Read the actual configuration for the bucket and its relevant prefix or tags, rather than relying on a generic statement that “versioning is on.”

The AWS troubleshooting guide notes that a version deleted permanently is generally not recoverable from S3. A request that names a particular version can delete that version, subject to applicable permissions and protections. Someone with broad enough access, an unintended automation or an incorrect lifecycle rule can therefore affect the history that the team expected to use.

A bucket that has versioning suspended has different behavior from one with versioning enabled, particularly for objects with a null version ID. Objects created before versioning was enabled also need careful treatment. Do not extrapolate the enabled-bucket example to every historical object or operation. Check the provider’s current documentation and the exact state before acting.

The cost of keeping history

Each retained version is stored data. AWS says normal storage and transfer rates apply to versions; other applicable request and service charges can also matter. A small object that is updated frequently can accumulate many versions, while a large object replaced regularly can consume substantial storage even if the visible current file count does not change.

Consider a simplified example: a 2 GB object is uploaded as a new full version ten times and all ten versions remain. Ignoring metadata, different storage classes, billing units and other charges, those versions represent roughly 20 GB of stored object data. That is an illustration of quantity, not a bill or a claim that every update creates the same amount of billed storage in every workflow.

The answer is not automatically to delete history aggressively. Decide how much history supports a real recovery need, then compare that need with retention, cost and legal requirements. Test a lifecycle policy on an appropriate nonproduction scope before applying it broadly, and make the person who owns recovery part of the decision. Deleting noncurrent versions to reduce storage can also remove the version someone expected to restore.

Why versioning and backup answer different questions

Versioning makes prior versions available within the service and bucket arrangement, subject to its settings. A backup plan asks broader questions: what is protected, where another recovery copy lives, who can change or delete it, how long it is retained, and whether the business can restore useful work within the needed time.

For example, a version in the same bucket may help recover a recent overwrite. It may not satisfy a requirement for separation from the production account or protection against an operator who can delete both current and noncurrent versions. The right design depends on the failure scenarios, access controls, recovery objectives and budget. A second copy is not a tested recovery merely because a dashboard says a job completed.

Our guide to testing a business backup walks through choosing a representative restore and checking the result. Data-retention decisions should also identify who owns a category of information and when it is supposed to be removed; the retention-schedule guide covers that separate question. Preserving every version forever is not necessarily the right answer for cost, privacy or operational reasons.

A practical investigation when an object disappears

First identify the account, bucket, region, exact key and approximate time of the change. Confirm that the application is requesting the same location and that its permissions have not changed. A wrong key, a different account or denied access can look like missing data to a user even when the object itself has not been deleted.

Next, inspect the versions and delete markers using authorized tools. Record relevant version IDs and timestamps, the current bucket-versioning state and lifecycle configuration. Check the available audit records for the operation if the organization collects them. Avoid sharing sensitive object contents, access keys or private identifiers in a general incident channel.

Then agree on the target version with its business owner and follow the organization’s recovery procedure. Verify the recovered contents and the application’s behavior, document the result and investigate the cause. If the required version is absent, look to the separate backup and recovery plan; do not claim that a marker or a console setting can restore bytes that are no longer retained.

The real value of versioning is not the reassuring label on a bucket. It is the ability to identify a retained version, retrieve the right bytes and put them back into useful service without losing track of the work that came after it.

Explore Infinite Upside

For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.

Find your edition · Chapter companion

ABOUT THE CONTRIBUTOR

Luna Lim

DIRECTOR OF FINANCIAL RESEARCH & EDITORIAL STRATEGY

SHETH CAPITAL, INC.

Luna Lim writes about business, investing, and the judgment behind financial decisions. She joined PCH Exotics Inc. as Director of Operations in 2022, working across La Jolla and Miami. Today, she reports directly to Vijay Sheth at Sheth Capital, Inc., bringing an operator’s perspective to the ideas she covers.

Based in Pacific Beach, California, Luna is curious about the people behind the numbers: what they’re building, how they weigh uncertainty, and what makes a risk worth taking. Her articles for Infinite Upside follow those questions through the details, with clear explanations and a feel for how decisions play out in everyday business.

More from Luna Lim

The Infinite Upside store