Scaling Elasticsearch

Elasticsearch is a NoSQL search and analytics engine that is easy to get started using for log analytics, text search, real-time analytics and more. That said, under the hood Elasticsearch is a complex, distributed system with many levers to pull to achieve optimal performance.

In this blog, we walk through solutions to common Elasticsearch performance challenges at scale including slow indexing, search speed, shard and index sizing, and multi-tenancy. Many solutions originate from interviews and discussions with engineering leaders and architects who have hands-on experience operating the system at scale.

How can I improve indexing performance in Elasticsearch?

When dealing with workloads that have a high write throughput, you may need to tune Elasticsearch to increase the indexing performance. We provide several best practices for having adequate resources on-hand for indexing so that the operation does not impact search performance in your application:

What should I do to increase my search speed in Elasticsearch?

When your queries are taking too long to execute it may mean but you need to simplify your data model or remove query complexity. Here are a few areas to consider:

How should I size Elasticsearch shards and indexes for scale?

Many scaling challenges with Elasticsearch boil down to the sharding and indexing strategy. There’s no one size fits all strategy on how many shards you should have or how large your shards should be. The best way to determine the strategy is to run tests and benchmarks on uniform, production workloads. Here’s some additional advice to consider:

How should I design for multi-tenancy?

The most common strategies for multi-tenancy are to have one index per customer or tenant or to use custom routing. Here's how you can weigh the strategies for your workload:

To scale or not to scale Elasticsearch!

Elasticsearch is designed for log analytics and text search use cases. Many organizations that use Elasticsearch for real-time analytics at scale will have to make tradeoffs to maintain performance or cost efficiency, including limiting query complexity and the data ingest latency. When you start to limit usage patterns, your refresh interval exceeds your SLA or you add more datasets that need to be joined together, it may make sense to look for alternatives to Elasticsearch.

Rockset is one of the alternatives and is purpose-built for real-time streaming data ingestion and low latency queries at scale. Learn how to migrate off Elasticsearch and explore the architectural differences between the two systems.