🔍 Elasticsearch
Beginner
How does an Elasticsearch index compare to a database?
Answer
In Elasticsearch, an index is the top-level data container analogous to a database in a relational system. It holds a collection of documents that share a similar structure. Before Elasticsearch 7.x, an index could contain multiple "types" (similar to tables), but types were removed in 7.x — each index now maps to a single logical document type. Unlike a relational database, an Elasticsearch index is schema-optional: you can store documents without defining a schema first, though defining an explicit mapping gives you fine-grained control over field types and indexing behavior.