đžObject Storage
CloudNexus Object Storage provides scalable, durable, and S3-compatible storage for your data. Store anything from images and videos to backups and logs with 99.999% durability guarantee.
Overview
Object Storage is a cloud storage architecture that stores data as objects within a flat address space. Each object consists of the data itself, a globally unique identifier, and metadata. It is designed for storing unstructured data at massive scale.
Our object storage is fully S3-compatible, meaning any application or SDK that works with Amazon S3 will work with CloudNexus Object Storage without modification.
CloudNexus Object Storage implements the full S3 API. Use aws-sdk, boto3, or any S3-compatible tool â just point it to our endpoint URL.
Key Features
- 99.999% Durability â Data is replicated across multiple facilities and availability zones for maximum durability.
- Unlimited Scale â No capacity limits. Store bytes or petabytes â it scales automatically.
- S3-Compatible API â Drop-in replacement for Amazon S3 with full API compatibility.
- Versioning â Keep multiple versions of objects to protect against accidental deletion or overwrites.
- Lifecycle Policies â Automatically transition objects to cheaper storage tiers or expire them.
- CORS Support â Configure Cross-Origin Resource Sharing for browser-based access.
- Server-Side Encryption â Encrypt objects at rest using AES-256 or customer-provided keys.
- Pre-signed URLs â Generate temporary access URLs for secure object sharing.
Storage Tiers
Choose the right storage tier based on your access patterns and performance needs.
| Tier | Use Case | Storage Cost | Retrieval Cost | Min. Retention |
|---|---|---|---|---|
| Standard | Active data, frequent access | $0.023 / GB/mo | $0.0004 / req | None |
| Infrequent | Backups, archives, less-frequent | $0.0125 / GB/mo | $0.001 / req | 30 days |
| Glacier | Long-term archives, compliance | $0.004 / GB/mo | $0.01 / GB retrieved | 90 days |
| Deep Glacier | Regulatory archives, rarely accessed | $0.00099 / GB/mo | $0.02 / GB retrieved | 180 days |
Getting Started
Prerequisites
- A CloudNexus account with an active project
- An Access Key ID and Secret Access Key
- Optional: Install the
cn-clitool for command-line management
Creating a Bucket
A bucket is a container for objects stored in CloudNexus Object Storage. Every object must reside in a bucket.
Using the Console
- Navigate to Storage â Object Storage in the CloudNexus Console
- Click "Create Bucket"
- Enter a globally unique bucket name (e.g.,
my-app-assets) - Select a region for data residency
- Choose a default storage tier
- Click "Create"
Using the CLI
cn storage bucket create my-app-assets \n --region us-east-1 \n --tier standard \n --versioning true
Using the S3 API
const S3Client = require("@aws-sdk/client-s3").S3Client;
const CreateBucketCommand = require("@aws-sdk/client-s3").CreateBucketCommand;
const client = new S3Client({
endpoint: "https://s3.us-east-1.cloudnexus.io",
credentials: {
accessKeyId: process.env.CN_ACCESS_KEY,
secretAccessKey: process.env.CN_SECRET_KEY,
},
region: "us-east-1",
forcePathStyle: false,
});
await client.send(new CreateBucketCommand({
Bucket: "my-app-assets",
}));
Bucket names must be 3â63 characters, start with a lowercase letter or number, and can contain lowercase letters, numbers, hyphens, and dots. They are globally unique across all CloudNexus accounts.
Common Operations
Uploading Objects
Objects are stored as key-value pairs within a bucket. The key (or path) uniquely identifies the object.
Simple Upload
import boto3
s3 = boto3.client(
"s3",
endpoint_url="https://s3.us-east-1.cloudnexus.io",
aws_access_key_id=os.environ["CN_ACCESS_KEY"],
aws_secret_access_key=os.environ["CN_SECRET_KEY"],
)
# Upload a file
s3.upload_file(
Filename="/path/to/photo.jpg",
Bucket="my-app-assets",
Key="images/photo.jpg",
ExtraArgs={"ContentType": "image/jpeg"},
)
Multipart Upload (Large Files)
For files larger than 100 MB, use multipart upload to split the file into parts and upload them in parallel.
# Upload large file with multipart
cn storage object upload my-app-assets \n --key "backups/db-dump-2025-01.sql.gz" \n --file ./db-dump-2025-01.sql.gz \n --part-size "50MB"
Downloading Objects
const GetObjectCommand = require("@aws-sdk/client-s3").GetObjectCommand;
const fs = require("fs");
const response = await client.send(new GetObjectCommand({
Bucket: "my-app-assets",
Key: "images/photo.jpg",
}));
# Stream to file
const writer = fs.createWriteStream("./photo.jpg");
response.Body.pipe(writer);
Listing Objects
# List all objects in a prefix
cn storage object ls my-app-assets \n --prefix "images/" \n --max-keys "100"
# List with pagination
cn storage object ls my-app-assets \n --prefix "logs/" \n --page-size "500" \n --all
Pre-signed URLs
Generate temporary URLs that grant time-limited access to private objects without exposing credentials.
import boto3
s3_client = boto3.client(
"s3",
endpoint_url="https://s3.us-east-1.cloudnexus.io",
aws_access_key_id="your-access-key",
aws_secret_access_key="your-secret-key",
)
# Generate a download URL valid for 1 hour
url = s3_client.generate_presigned_url(
ClientMethod="get_object",
Params={
"Bucket": "my-app-assets",
"Key": "reports/annual-2024.pdf",
},
ExpiresIn=3600, # 1 hour in seconds
)
print(url)
Deleting Objects
# Delete a single object
cn storage object delete my-app-assets "images/old-banner.jpg"
# Delete all objects matching a prefix (with confirmation)
cn storage object delete my-app-assets \n --prefix "temp/" \n --recursive \n --confirm
Deleted objects are irretrievable unless versioning is enabled. Always enable versioning on buckets containing critical data before performing bulk deletes.
REST API Reference
All Object Storage operations follow standard S3 API conventions. The base URL for API requests is:
https://s3.{region}.cloudnexus.io
# Available regions:
https://s3.us-east-1.cloudnexus.io
https://s3.eu-west-1.cloudnexus.io
https://s3.ap-south-1.cloudnexus.io
https://s3.sa-east-1.cloudnexus.io
Bucket Operations
Create a Bucket
Creates a new storage bucket. Bucket names are globally unique and immutable once created.
| Parameter | Type | Required | Description |
|---|---|---|---|
| bucket-name | string | Required | Unique name for the bucket (3â63 chars) |
| x-amz-region | string | Optional | Target region (defaults to us-east-1) |
List All Buckets
Returns a list of all buckets owned by the authenticated account.
Delete a Bucket
Deletes a bucket. The bucket must be empty before deletion. Returns 409 Conflict if the bucket contains objects.
Object Operations
Upload an Object
Uploads or overwrites an object in a bucket. Supports optional headers for metadata, content type, and encryption.
| Parameter | Type | Required | Description |
|---|---|---|---|
| bucket-name | string | Required | Name of the destination bucket |
| key | string | Required | Object key (path within the bucket) |
| Content-Type | string | Optional | MIME type of the object |
| x-amz-storage-class | string | Optional | Storage tier: STANDARD, INFREQUENT, GLACIER |
| x-amz-server-side-encryption | string | Optional | Encryption: AES256 or aws:kms |
Download an Object
Retrieves an object from a bucket. Supports range requests for partial downloads via the Range header.
List Objects in a Bucket
Lists objects in a bucket with optional filtering by prefix, delimiter, and pagination.
| Query Param | Type | Required | Description |
|---|---|---|---|
| prefix | string | Optional | Filter objects by key prefix (e.g., images/) |
| delimiter | string | Optional | Group keys by delimiter (e.g., / for folder-like structure) |
| max-keys | integer | Optional | Max results per page (default: 1000) |
| continuation-token | string | Optional | Token for paginated results |
Delete an Object
Permanently deletes an object. If versioning is enabled, adds a delete marker instead.
Advanced Features
Object Versioning
Enable versioning to retain, retrieve, and restore every version of every object in your bucket.
# Enable versioning on a bucket
cn storage bucket versioning my-app-assets \n --status Enabled
# List all versions of an object
cn storage object versions my-app-assets "config/settings.json"
# Restore a specific version
cn storage object restore my-app-assets "config/settings.json" \n --version-id "v3f8a2b1-7d9c-4e11"
Lifecycle Policies
Automate object transitions and expiration using lifecycle configuration rules.
{
"Rules": [
{
"ID": "archive-old-logs",
"Status": "Enabled",
"Filter": {
"Prefix": "logs/"
},
"Transitions": [
{
"Days": 30,
"StorageClass": "INFREQUENT"
},
{
"Days": 90,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 365
}
}
]
}
Server-Side Encryption
Protect your data at rest using server-side encryption. CloudNexus supports two modes:
| Method | Header | Description |
|---|---|---|
| AES-256 (SSE-S3) | x-amz-server-side-encryption: AES256 |
CloudNexus-managed keys, no additional cost |
| KMS (SSE-KMS) | x-amz-server-side-encryption: aws:kms |
Customer-managed keys with CloudNexus KMS, includes audit trail |
CORS Configuration
Configure Cross-Origin Resource Sharing for browser-based applications:
{
"CORSRules": [
{
"AllowedOrigins": ["https://app.example.com"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag", "x-amz-version-id"],
"MaxAgeSeconds": 3000
}
]
}
SDK Integration
CloudNexus Object Storage works with any S3-compatible SDK. Below are examples for popular languages:
AWS SDK (v3)
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
const s3 = new S3Client({
endpoint: "https://s3.us-east-1.cloudnexus.io",
credentials: {
accessKeyId: process.env.CN_ACCESS_KEY,
secretAccessKey: process.env.CN_SECRET_KEY,
},
region: "us-east-1",
});
await s3.send(new PutObjectCommand({
Bucket: "my-app-assets",
Key: "uploads/file.pdf",
Body: fs.readFileSync("./file.pdf"),
ContentType: "application/pdf",
}));
Boto3 (Python)
import boto3
from boto3.s3.transfer import S3Transfer
s3 = boto3.resource(
"s3",
endpoint_url="https://s3.us-east-1.cloudnexus.io",
aws_access_key_id="your-access-key",
aws_secret_access_key="your-secret-key",
)
transfer = S3Transfer(s3)
transfer.upload_file(
"./large-video.mp4",
"my-app-assets",
"videos/tutorial.mp4",
Callback=lambda bytes: print(f"Uploaded: {bytes} bytes"),
)
AWS CLI
# Sync an entire directory
aws s3 sync ./dist/ s3://my-app-assets/static/ \n --endpoint https://s3.us-east-1.cloudnexus.io \n --no-sign-request # if using pre-signed or public bucket
# Copy between buckets
aws s3 cp s3://source-bucket/data.csv \n s3://my-app-assets/import/data.csv \n --endpoint https://s3.us-east-1.cloudnexus.io
Best Practices
Follow these best practices to get the most out of CloudNexus Object Storage.
Performance
- Use multipart uploads for files > 100 MB to improve throughput and enable resumable transfers
- Enable HTTP caching headers (
Cache-Control) for static assets to reduce request costs - Use range requests for streaming media and large file downloads
- Deploy your application in the same region as your storage bucket to minimize latency
Cost Optimization
- Use lifecycle policies to automatically transition cold data to cheaper tiers
- Set expiration rules for temporary files (logs, temp uploads, session data)
- Enable requester pays buckets for shared data to distribute costs
- Monitor storage usage with CloudNexus Monitoring dashboards
Security
- Enable server-side encryption on all buckets by default
- Use bucket policies and IAM roles instead of sharing access keys
- Use pre-signed URLs with short expiration times for temporary access
- Enable access logging to audit who is accessing your objects
- Never set production buckets to public-read unless explicitly required
Troubleshooting
Common Errors
| Error | HTTP Code | Cause | Solution |
|---|---|---|---|
AccessDenied |
403 | Invalid credentials or missing permissions | Verify access key/secret and bucket policy |
NoSuchBucket |
404 | Bucket name is misspelled or does not exist | Check bucket name spelling and region |
NoSuchKey |
404 | Object key does not exist | Verify the object key (path) is correct |
RequestTimeout |
408 | Request exceeded timeout | Retry with exponential backoff; check network |
SlowDown |
503 | Too many requests (rate limiting) | Implement throttling or use multipart upload |
BucketNotEmpty |
409 | Attempting to delete a non-empty bucket | Delete all objects and versions first |
EntityTooLarge |
413 | Single PUT exceeds 5 GB limit | Use multipart upload for large files |
Debug Tips
- Enable verbose logging on the CLI:
cn storage --debug - Use curl to test raw API requests and inspect response headers
- Check the Access Logs for detailed request auditing
- Verify your endpoint URL matches the region where the bucket was created
If you connect to the wrong region endpoint for a bucket, you'll receive a 301 Moved Permanently redirect. Always use the correct regional endpoint to avoid latency and potential redirect loops.