Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
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.

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.

The shortcut

Read any path from left to right and zoom in one level per segment: cluster (the address) → index → document ID.

Zooming in on https://es.bookshop.dev:9200/books/_doc/4Step 1 of 3
  1. The address

    https://es.bookshop.dev:9200 reaches some node, and through it the whole cluster.

Drills

Answer fast — trust the rule.

quick drill

What is a node?

quick drill

In GET /books/_doc/7, which part is the document ID?

quick drill

The books index and the customers index each contain a document with ID 1. What happens?

quick drill

Which is the closest SQL cousin of an Elasticsearch document?

Remember

  • A cluster runs nodes; nodes hold indices; indices hold documents; each document has an ID.
  • Read a path left to right: address → index → ID.
  • IDs are unique within an index, and there are no joins between indices.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainMap the five nouns

Using the request PUT /books/_doc/9 sent to https://es.bookshop.dev:9200, explain where the cluster, a node, the index, the document and the ID each appear, and give one way an index differs from a SQL table.