LAB 16 ‐ Object Storage Configuration - DevWithNehaCloud/Oracle-Cloud-Infrastructure-wiki GitHub Wiki

Object Storage in OCI

Overview

Object Storage in Oracle Cloud Infrastructure (OCI) is a highly scalable, durable, and cost-effective storage service used to store large amounts of unstructured data such as images, videos, backups, logs, and documents.

Data is stored as objects inside buckets, instead of traditional file systems.


Key Concepts

  • Bucket
    A logical container that stores objects.

  • Object
    The actual file/data (e.g., .zip, .jpg, .log).

  • Namespace
    A unique identifier assigned to each OCI tenancy.

  • Storage Tier

    • Standard (frequent access)
    • Archive (rare access, lower cost)

Features

  • Highly durable and scalable
  • Secure access using IAM policies
  • Lifecycle management (auto move to archive)
  • Accessible via Console, CLI, SDK, and API

Example (Use Case)

Backup Storage Example

  • Bucket Name: app-backups
  • Object: backup-01.zip
  • Use: Store daily backups of your application

Simple Analogy

  • Bucket = Folder (like Google Drive)
  • Object = File

When to Use Object Storage

  • Backup and restore
  • Media storage (images/videos)
  • Logs and analytics data
  • Static website hosting

Summary

Object Storage in OCI allows you to store unlimited unstructured data securely and cost-effectively. It is ideal for backups, media storage, and long-term data retention.

Pre-Authenticated Request (PAR) in OCI

Overview

A Pre-Authenticated Request (PAR) in Oracle Cloud Infrastructure (OCI) allows you to grant access to objects in Object Storage without requiring users to log in or have IAM permissions.

It generates a unique URL that can be shared with others to access specific resources securely.


Key Features

  • Provides temporary access via a URL
  • No OCI login required
  • Can be time-limited (expiry date)
  • Supports read, write, or read/write access
  • Can be created for a single object or entire bucket

Types of Access

  • Object Read → Download a specific file
  • Object Write → Upload a file
  • Object Read/Write → Both upload and download
  • Bucket Access → Access all objects in a bucket

Example (Use Case)

File Sharing Example

  • Object: report.pdf
  • Create PAR with Read Access
  • Share generated URL with user

➡️ User can download the file without logging into OCI


When to Use PAR

  • Share files without IAM access
  • Temporary file uploads
  • External user access
  • Secure download links

💼 Real-Time Scenarios (Very Important)

  1. Client File Sharing

You need to send a report to a client:

Upload file to Object Storage Create PAR (Read access) Share URL

➡️ Client downloads file without OCI login

Summary

Pre-Authenticated Request (PAR) in OCI is a simple and secure way to share Object Storage resources using a temporary URL without requiring user authentication.

Retention Rule in OCI Object Storage

Overview

A Retention Rule in Oracle Cloud Infrastructure (OCI) Object Storage is used to prevent objects from being modified or deleted for a specified period of time.

It ensures data protection by enforcing a write-once-read-many (WORM) model.


Why Use Retention Rules?

  • Protect critical data from accidental deletion
  • Meet compliance and regulatory requirements
  • Ensure data integrity
  • Prevent unauthorized modifications

Key Features

  • Time-based data protection
  • Applies at the bucket level
  • Objects cannot be deleted or overwritten during retention period
  • Supports governance and compliance use cases

Types of Retention

  • Time-Bound Retention
    Objects are locked for a specific duration (e.g., 30 days, 1 year)

  • Indefinite Retention
    Objects are locked until the rule is manually removed (if allowed)


Example (Use Case)

Compliance Data Protection

  • Bucket: finance-records
  • Retention Rule: 90 days

➡️ Any file uploaded cannot be deleted or modified for 90 days


Important Notes

  • Once applied, objects cannot be deleted or modified until retention expires
  • Retention rules can impact cost (data stays longer)
  • Be careful while enabling — cannot be easily bypassed

When to Use

  • Financial records
  • Legal documents
  • Audit logs
  • Backup data requiring protection

Summary

Retention Rule in OCI is used to lock objects for a defined period, ensuring data cannot be deleted or modified, which helps in compliance and data protection.

Lifecycle Policy vs Retention Rule in OCI

Overview

In Oracle Cloud Infrastructure (OCI) Object Storage:

  • Lifecycle Policy is used to manage objects automatically (move/delete)
  • Retention Rule is used to protect objects from deletion/modification

Both serve completely different purposes.


Key Difference

  • Lifecycle Policy → Data Management (Automation)
  • Retention Rule → Data Protection (Locking)

Comparison Table

Feature Lifecycle Policy Retention Rule
Purpose Manage object lifecycle Protect data
Action Move/Delete objects Prevent delete/modify
Control Type Automatic Restrictive (Lock)
Use Case Cost optimization Compliance & security
Flexibility Can modify anytime Limited changes
Deletion Allowed Yes (as per rule) Not allowed during retention
Level Bucket level Bucket level

Lifecycle Policy (Explanation)

Lifecycle Policy automatically performs actions like:

  • Move objects to Archive tier
  • Delete objects after specific days

Example:

  • Move files to Archive after 30 days
  • Delete files after 90 days

➡️ Helps reduce storage cost


Retention Rule (Explanation)

Retention Rule locks objects for a specific duration.

Example:

  • Retention: 60 days

➡️ Objects cannot be deleted or modified for 60 days


Real-Time Scenario

Scenario 1: Backup Cost Optimization

Use Lifecycle Policy
➡️ Move old backups to Archive to save cost


Scenario 2: Legal/Compliance Data

Use Retention Rule
➡️ Prevent deletion of important records


Important Note

If both are applied:

  • Retention Rule overrides Lifecycle Policy

➡️ Even if lifecycle says "delete", object will NOT delete until retention expires


Summary

  • Use Lifecycle Policy for automation and cost saving
  • Use Retention Rule for data protection and compliance

Steps to configure object storage

Step 1 : Explore the Object Storage

Click on the Burger Menu in left side, select storage than go to the object storage & archive storage.

Click on create Bucket, Fill in all the details required to create a bucket

**A bucket in Oracle Cloud Infrastructure (OCI) is like a folder in the cloud where you can store your files — things like photos, videos, documents, or backups. **

Now Bucket is created .

Step 2 : Upload objects in bucket

Scroll down to the left side of the bucket. Under Resources, select Objects, and then click Upload

And your object(file) is now uploaded.

Step 3 . Create Pre-Authenticated request

pre-authenticated request (PAR) for a bucket in Oracle Cloud Infrastructure (OCI), you're basically giving someone a special link that lets them interact with that bucket — without needing to log in.

Under Resources, select Pre-Authenticated request, and then click Create Pre-Authenticated request

"After clicking on Create Pre-Authenticated Request, a tab will appear on the screen containing a Pre-Authenticated Request URL address. You need to copy and save that URL because it will not be shown again.

Just share this URL with the person you want to give access to for that particular object. They only need to copy that address and paste it into Google to open the object. They can execute read/write actions depending on the access type given to them

file will open

Step 4 : Lifecycle Rule

A lifecycle rule in a bucket (like in Oracle Cloud Infrastructure) is a way to automatically manage your files over time — kind of like setting up a cleaning schedule for your digital storage.

This could be:

  • Move to archive (for long-term, cheaper storage)
  • Delete (to free up space)
  • Move to infrequent access (if you don’t use the file often) In the screen below, you can see that Auto-Tiering is enabled

Step 5 : Create Retention rule

A retention rule in an OCI bucket is like putting a “do not delete or change” sticker on your files — for a set amount of time.

  • During that time, nobody can delete or change those files — not even admins.

  • You can choose between: (a) Time-bound rules (e.g. keep for 90 days) (b) Indefinite rules (keep forever until you remove the rule) And if you lock the rule, it becomes permanent — even Oracle Support can’t undo it. So it’s powerful, but you’ve got to use it carefully.

Under Resources, select Retention rule, and then click Create rule. fill all the details and click create

Now Retention rule is created