Ephemeral buckets are actually just Couchstore buckets with a specific configuration that makes them behave differently.

Let’s see what that looks like. Imagine you’re building a real-time leaderboard for a game. You want player scores to update instantly, and you don’t need to keep historical data once the game session ends.

{
  "bucketType": "couchbase", // This is the default, but explicitly saying it is fine.
  "name": "leaderboard",
  "authType": "sasl",
  "saslPassword": "yoursecurepassword",
  "type": "memcached", // This is the key for Ephemeral behavior
  "bucketPriority": "high",
  "maxTTL": 0, // Ephemeral buckets don't have a max TTL by default
  "conflictResolutionType": "seqno",
  "durability": {
    "acceptedCount": 0, // Ephemeral buckets don't wait for durability
    "persistTo": 0,
    "masterEject": 0
  },
  "nodes": [
    "192.168.1.100",
    "192.168.1.101"
  ]
}

This leaderboard bucket, defined with type: "memcached", is an Ephemeral bucket. When data is written to it, it’s stored only in RAM. No disk writes. No replication to replicas (unless you explicitly configure them, which defeats the purpose of Ephemeral). If a node goes down, that data is gone. If the bucket is deleted, it’s gone. This makes it incredibly fast for writes and reads because the disk I/O bottleneck is entirely removed.

Now, contrast that with a standard Couchstore bucket. Let’s say you’re storing user profiles. You need that data to survive node failures, and you want it to be available even if a node restarts.

{
  "bucketType": "couchbase",
  "name": "user_profiles",
  "authType": "sasl",
  "saslPassword": "yoursecurepassword",
  "type": "couchbase", // This is the default for Couchstore behavior
  "bucketPriority": "normal",
  "maxTTL": 2592000, // Example: 30 days
  "conflictResolutionType": "seqno",
  "durability": {
    "acceptedCount": 1, // Wait for at least one replica to confirm write
    "persistTo": 1,     // Wait for data to be persisted to disk on at least one node
    "masterEject": 0
  },
  "nodes": [
    "192.168.1.100",
    "192.168.1.101",
    "192.168.1.102"
  ]
}

This user_profiles bucket uses type: "couchbase". Data written here goes to RAM, is replicated to other nodes (if configured), and is eventually persisted to disk by the Couchstore engine. The durability settings ensure that writes are acknowledged only after they’ve met certain persistence and replication criteria. This makes it slower for writes than an Ephemeral bucket, but much more resilient and durable.

The mental model is that Ephemeral buckets are pure in-memory caches with Couchbase’s indexing and query capabilities. They are designed for volatile data where speed is paramount and data loss on restart is acceptable. Couchstore buckets are your traditional NoSQL datastores, balancing performance with durability and availability.

The most surprising thing most people don’t realize is that Ephemeral buckets can still leverage Couchbase’s indexing features. You can create Global Secondary Indexes (GSIs) on Ephemeral buckets just like you can on Couchstore buckets. This means you can get the blazing-fast performance of an in-memory store and the powerful ad-hoc querying capabilities of Couchbase, all without the disk I/O overhead of traditional Couchstore persistence. You’re essentially using Couchbase as an advanced, queryable in-memory data grid.

The next step is understanding how to leverage N1QL for querying these different bucket types efficiently.

Want structured learning?

Take the full Couchbase course →