ElasticSearch

ElasticSearch

Use cases

Offload read requests (not requiring realtime) from MySQL

  • Why?

    *

  • Approach: Option 1 vs Option 2 below

    • Option 2 is adopted because Option 1 needs to introduce additional components and does not improve much on latency

┌───────────────┐                                                                  ┌──────────────┐
│               │         Option1: ES monitor MySQL's binlog and put binlog        │              │
│               │                          data inside ES                          │              │
│     MySQL     ├─────────────────────────────────────────────────────────────────▶│ElasticSearch │
│               │              Option2: Write data to ES using ES APIs             │              │
│               │                                                                  │              │
└───────────────┘                                                                  └──────────────┘

Resiliency

  • What if there is an error using Option 2: Add another task inside SQL server. There will be a worker task regularly scanning through these tasks. Use this type of compensation mechanism to make ES and MySQL data eventual consistent.

Latency

  • There will be a delay when data comes into ES's index buffer but not into file system cache. So for requests requiring real time data, better rely on MySQL.

Comparison - Lucene vs Solr vs ElasticSearch

Last updated