> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nami.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Comparison

> Choose the right Nami Cloud storage service for your needs

<Note>
  Nami Cloud offers two ways to interact with decentralized storage. Both services use Walrus as the underlying storage layer, but provide different interfaces and feature sets. This guide helps you choose between S3-Compatible Storage and Walrus Publisher Raw API based on your specific requirements.
</Note>

## Service Comparison Overview

| Feature                | S3-Compatible Storage         | Walrus Publisher API            |
| ---------------------- | ----------------------------- | ------------------------------- |
| Latency                | Several hundreds milliseconds | \~10s upload + 10s availability |
| Storage Renewal        | Automatic (hands-free)        | Manual epoch management         |
| API Style              | Standard S3 REST API          | Custom Walrus Protocol          |
| Learning Curve         | Minimal (familiar S3)         | Moderate (new concepts)         |
| Existing Tool Support  | Full AWS SDK support          | Custom integration required     |
| Performance            | Fast with Railgun (Beta)      | Direct network access           |
| Analytics & Monitoring | Support metrics               | Support metrics                 |
| Storage Epoch Control  | Automated (hands-free)        | Manual control available        |
| Web3 Integration       | Abstracted layer              | Direct blockchain access        |

## Detailed Service Analysis

### **S3-Compatible Storage**

#### When to Choose S3-Compatible

* **Migrating from AWS S3** - Zero code changes required
* **Rapid prototyping** - Get started immediately with familiar tools
* **Simple storage needs** - Just upload/download files without complexity
* **Team familiarity** - Developers already know S3 APIs
* **Third-party integrations** - Using tools that expect S3 endpoints

#### Advantages

<div className="border border-green-200 rounded-lg p-4 bg-green-50 mb-4">
  <ul className="text-sm text-green-700 space-y-2">
    <li>**Zero Migration Friction** - Works with existing S3 code and tools</li>
    <li>**Automatic Management** - Built-in encryption, renewal, and optimization</li>
    <li>**Familiar Interface** - Standard S3 operations (PUT, GET, DELETE, LIST)</li>
    <li>**Railgun Acceleration** (Beta) - Built-in performance optimization</li>
    <li>**SDK Support** - Works with AWS SDK in all major languages</li>
    <li>**Quick Setup** - Start storing data in minutes</li>
  </ul>
</div>

#### Disadvantages

<div className="border border-red-200 rounded-lg p-4 bg-red-50 mb-4">
  <ul className="text-sm text-red-700 space-y-2">
    <li>**Limited Visibility** - Less insight into underlying Walrus operations</li>
    <li>**S3 Limitations** - Constrained by S3 API design patterns</li>
  </ul>
</div>

### **Walrus Publisher Raw API**

#### When to Choose Publisher API

* **Web3 applications** - Need direct blockchain verification and control
* **Custom workflows** - Building specialized storage integrations

#### Advantages

<div className="border border-green-200 rounded-lg p-4 bg-green-50 mb-4">
  <ul className="text-sm text-green-700 space-y-2">
    <li>**Multi-Endpoint Management** - Control multiple publishers across regions</li>
    <li>**Comprehensive Analytics** - Detailed metrics, logs, and performance data</li>
    <li>**Direct Walrus Access** - Full control over storage epochs and blockchain operations</li>
    <li>**Flexible Configuration** - Custom settings for specific use cases</li>
  </ul>
</div>

#### Disadvantages

<div className="border border-red-200 rounded-lg p-4 bg-red-50 mb-4">
  <ul className="text-sm text-red-700 space-y-2">
    <li>**Higher Latency** - 10s upload + 10s availability</li>
    <li>**Manual Management** - Need to manage storage epochs</li>
    <li>**Steeper Learning Curve** - Need to understand Walrus protocol concepts</li>
    <li>**Custom Integration** - No existing SDK support, must build own client</li>
    <li>**More Complex Setup** - Requires configuration of endpoints and monitoring</li>
    <li>**No S3 Tool Support** - Cannot use existing S3 CLI tools or libraries</li>
    <li>**Higher Development Cost** - More time needed for implementation</li>
  </ul>
</div>

## Performance & Scalability Comparison

### Latency & Throughput

<CardGroup cols={2}>
  <Card title="S3-Compatible Storage" icon="clock">
    * **Railgun Acceleration** (Beta): Sub-100ms globally
    * **Single Endpoint**: Optimized for simplicity
    * **Auto-caching**: Built-in edge acceleration
    * **Standard Operations**: PUT/GET with S3 semantics
  </Card>

  <Card title="Walrus Publisher API" icon="rocket">
    * **Direct Network Access**: Native Walrus performance
    * **Multi-Endpoint**: Load balancing across publishers
    * **Geographic Optimization**: Route to nearest publisher
    * **Batch Operations**: Efficient bulk upload/download
  </Card>
</CardGroup>

### Code Examples Comparison

<CodeGroup>
  ```javascript S3-Compatible Storage theme={null}
  import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

  const s3Client = new S3Client({
    endpoint: "https://my-bucket.storage.nami.cloud",
    credentials: {
      accessKeyId: "your-access-key", 
      secretAccessKey: "your-secret-key"
    }
  });

  // Upload file - standard S3 API
  await s3Client.send(new PutObjectCommand({
    Bucket: "my-bucket",
    Key: "file.jpg",
    Body: fileBuffer
  }));
  ```

  ```javascript Walrus Publisher API theme={null}
  // Direct HTTP API call to Walrus Publisher
  const endpointKey = 'your-endpoint-key';
  const response = await fetch(
    `https://walrus-mainnet-publisher.nami.cloud/${endpointKey}/v1/blobs?epochs=5`, 
    {
      method: 'PUT',
      body: fileBuffer
    }
  );

  const result = await response.json();
  if (result.newlyCreated) {
    console.log(`Stored at: ${result.newlyCreated.blobObject.blobId}`);
    console.log(`Valid until epoch: ${result.newlyCreated.blobObject.storage.endEpoch}`);
    console.log(`Storage cost: ${result.newlyCreated.cost}`);
  } else if (result.alreadyCertified) {
    console.log(`Already exists: ${result.alreadyCertified.blobId}`);
    console.log(`Valid until epoch: ${result.alreadyCertified.endEpoch}`);
  }
  ```
</CodeGroup>
