Company
Date Published
Author
-
Word count
993
Language
-
Hacker News points
None

Summary

The text discusses the considerations and challenges involved in deciding whether to store new data in a new type within an existing index or in a new index altogether in Elasticsearch. It highlights the inefficiencies of overusing types, drawing a comparison with relational databases which previously led to misunderstandings. An index in Elasticsearch is stored in shards, and managing a large number of small indices can be inefficient due to the fixed overhead associated with Lucene indices. Types help reduce the number of indices by allowing different data types to be stored within the same index, but they come with limitations such as the need for consistent field configurations across types and issues with sparsity in Lucene indices. The decision to use indices or types depends on factors like data mapping similarity, document volume, and hardware capabilities, with a recommendation to limit shard numbers for optimal resource management. The article notes that there are fewer use cases for multiple types within the same index than might be expected and advises careful consideration of index and shard configuration to maintain efficiency.