Skip to the content.

1. What is Elasticsearch?

πŸ‘‰ Think of it as a super-fast search engine you can use in your apps (like Google Search, but for your own data).


2. Why do we use Elasticsearch?

πŸ‘‰ Use cases: E-commerce product search, log analytics, monitoring (ELK stack), recommendation systems.


3. How is data pushed into Elasticsearch?

There are 2 main ways:

  1. From Backend (API β†’ ES directly):

    • Your application can write data directly into Elasticsearch using its REST APIs.
    • Example: When a new product is added in your e-commerce app β†’ backend pushes product data into ES.
  2. From Database (via ETL or sync tools):

    • Data is stored in a relational/NoSQL DB β†’ then synced into ES for fast searching.
    • Tools used:

      • Logstash (part of ELK stack).
      • Beats (lightweight shippers).
      • Kafka connectors (real-time pipelines).
      • Custom batch jobs (cron jobs to push data).

πŸ‘‰ Typically: DB = source of truth, Elasticsearch = for search/querying.


4. How is Elasticsearch so fast?

Key reasons:

πŸ‘‰ That’s why queries return in milliseconds, even with millions of records.


5. How does Elasticsearch stay updated with latest data?

πŸ‘‰ Elasticsearch is not always the β€œsystem of record” β†’ DB is the source of truth, ES is optimized for search.


6. What happens if Elasticsearch is down?

πŸ‘‰ Downtime impact = search features fail (e.g., product search, logs, analytics dashboards stop working).


7. How to handle Elasticsearch downtime (precautions)?

πŸ‘‰ In production: Always deploy Elasticsearch as a cluster with replicas, never as a single node.


βœ… Summary