Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ElasticSearch at Recurly

Recurly
November 07, 2013

ElasticSearch at Recurly

- Our use case for Elasticsearch
- First integration: lessons learned
- Rebuilding an Elasticsearch integration

Recurly

November 07, 2013
Tweet

Other Decks in Technology

Transcript

  1. Elasticsearch at Recurly | AGENDA • Our use case for

    Elasticsearch" • First integration: lessons learned" • Rebuilding an Elasticsearch integration 3
  2. Elasticsearch at Recurly | SEARCH UI V1 - 2009-10 •

    Our use case for Elasticsearch" • First integration: lessons learned" • Rebuilding an Elasticsearch integration 4
  3. Elasticsearch at Recurly | SEARCH UI V2.5 - 2012 •

    SQL based Facets" • couldn’t query + facet/filter" • poor performance (30+ sec) 5 Search Facets
  4. Elasticsearch at Recurly | WHAT WE HAD BEFORE (OPS) •

    Single Elasticsearch server" • version 0.19.1 (released March 2012)" • Index grew to over 40 GB 7
  5. Elasticsearch at Recurly | PROBLEMS • Single Point of Failure

    (SPOF)" – Callbacks index new data synchronously" • No ability to perform Elasticsearch maintenance" • Slow SQL facets" • Indexes tightly coupled to the model" • ES data accumulated lots of deleted records" • Index jobs from Resque created CPU load 9
  6. Elasticsearch at Recurly | GOALS • Faster search" • Decouple

    indexing from ActiveRecord" • Support Elasticsearch maintenance" • Keep the index up to date 11
  7. Elasticsearch at Recurly | WHAT WE HAVE NOW (OPS) •Cluster

    of 3 ES instances" •version 0.90.2" •10 GB index (compressed!) 14
  8. Elasticsearch at Recurly | WHAT WE HAVE NOW (CODE) •

    Stretcher gem (https://github.com/PoseBiz/stretcher)" • Query builder — supports advanced queries & facets" • Less model coupling" • Asynchronously indexing records" • Bulk indexer jobs to reindex the world" • Sidekiq 15
  9. Elasticsearch at Recurly | RESULTS • High Availability, no more

    SPOF" • improved search performance" –upwards of 20 secs —> 150ms" • no more SQL facets 17
  10. Elasticsearch at Recurly | LESSONS LEARNED • Disable auto-creation of

    new indexes" • Flatten documents and denormalize" • Pay attention to analyzer type" • Use bulk API 20
  11. Elasticsearch at Recurly | ROADMAP • Move indexing to own

    service" • More advanced filters in UI" • Expanded reporting capabilities 22
  12. Elasticsearch at Recurly | QUESTIONS / RESOURCES • https://github.com/karmi/retire" •

    https://github.com/PoseBiz/stretcher" • http://www.elasticsearch.org" • https://www.recurly.com" • https://twitter.com/recurly" • We’re Hiring! - [email protected] 24