Object Storage in Oracle Cloud Infrastructure (OCI) is a cloud-based service that lets you store and access any kind of digital file—like photos, videos, documents, or backups—easily and securely. Instead of using folders like on your computer, it organizes everything in containers called “buckets,” where each file is an “object.” It’s designed to handle large amounts of data, so you don’t have to worry about running out of space, and your files are safely stored and always available when you need them.
In OCI Object Storage, there are different storage tiers depending on how often you need to access your files:
- The Standard tier is for data you use regularly—it's fast and always ready.
- The Archive tier is for files you don’t need very often, like old backups or logs; it’s much cheaper, but it takes a few hours to access the data when you need it.
You can also set retention rules to make sure certain files can’t be deleted for a specific period—this is useful for legal or compliance reasons. And if you want your data to be safer or closer to users in different regions, you can use replication policies to automatically copy your files to another location in OCI. That way, your data stays protected and accessible, even if something happens in one region.
Uploading an Object to a Bucket in OCI
Let’s see how to upload an object to a bucket in two different ways:
1. Using the OCI Console:
This is the simplest way and great for beginners. Just go to the Oracle Cloud Console, open the Object Storage service, choose your bucket, and click on “Upload.” Then you can select the file from your computer and upload it directly to the cloud.
2. Using the OCI CLI (Command Line Interface):
If you prefer using the terminal, you can upload files with a simple command. First, make sure you have the OCI CLI installed and configured. Then you can run a command like this:
oci os object put --bucket-name <my_bucket> --file <myfile.txt>
1. Downloading from the OCI Console:
Go to your bucket in the OCI Console, find the object you want, click on the three dots (⋮) next to it, and choose “Download.” The file will be downloaded directly to your computer.
2. Using the OCI CLI:
If you're using the command line, you can run this command to download a file:
oci os object get --bucket-name <my_bucket> --name <myfile.txt> --file <myfile.txt>
This will download the object and save it locally with the same name.
3. Generating a Pre-Authenticated URL:
Sometimes, you might want to share a file with someone without giving them access to your OCI account. For that, you can create a pre-authenticated request (PAR)—a special link that lets anyone download the file for a limited time. In the OCI Console, go to the object, click the three dots, and select “Create Pre-Authenticated Request.” You can set an expiration date and get a unique URL to share.