Skip to the workspace
Pebellslearn by building
Cluster Anatomy and Mappings  ›  Lesson

Cluster, Node, Index, Document, ID

Index (Database) 10 minA cluster runs nodes, nodes hold indices, indices hold JSON documents, and each document has an ID unique within its index.

elasticsearch / Cluster, Node, Index, Document, ID

Explore each scene at your own pace.

01 · The rule

The rule

Cluster, Node, Index, Document, ID

Before mappings make sense you need the five nouns every Elasticsearch error message uses. If you know SQL, each one has a rough cousin there — rough, because the analogy breaks in a few useful places.

The rule

A cluster runs nodes; nodes hold indices; indices hold documents; each document has an ID.

Elasticsearch Rough SQL cousin In our bookshop
Cluster The whole database system bookshop-prod, the full deployment
Node One database server es01, one running Elasticsearch process
Index A database or table books
Document A row One book, as JSON
ID Primary key "1" for The Quiet Garden
  • A cluster is one or more nodes that share a name and work together. You send a request to any node and the cluster answers as one.
  • A node is a single running instance of Elasticsearch, usually one per machine or container.
  • An index is a named collection of documents that share a structure. Names are lower-case: books, not Books.
  • A document is one JSON object — the unit you store, fetch and search.
  • The ID (_id) identifies a document inside its index. You can pick it, or let Elasticsearch generate a random one.
PUT /books/_doc/1
{ "title": "The Quiet Garden", "author": "Mira Das", "price": 12.5 }

This one request touches all five nouns: it reaches some node, which acts for the whole cluster; it names the index books; _doc says "a document goes here"; 1 is the ID; and the JSON body is the document itself.

Where the analogy breaks: an index is looser than a table (documents may add new fields), there are no joins between indices, and an ID only has to be unique within one index. Book 1 and customer 1 can happily coexist in different indices.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.