elasticsearch and soanosqlroadshow.com/dl/nosql-munich-2013/... · why soa? velocity developer...

36
ElasticSearch and SOA Peter Bourgon

Upload: others

Post on 13-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

ElasticSearch and SOAPeter Bourgon

Page 2: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

Evolution of searchCurrent architectureA bit about SOA

Page 3: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

EVOLUTIONOF SEARCH

Page 4: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK
Page 5: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK
Page 6: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK
Page 7: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK
Page 8: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

KATAMARI DAMACY, NAMCO

Page 9: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

:(

✘ Solr✘ Batch replication✘ Very slow reindexing✘ Technical debt in app

Page 10: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

DO WANT.

✔ Velocity✔ Reliability✔ Maintainability

Page 11: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

HOW TO DO?

ElasticSearchGreenfield developmentParallel dark launchMigrate traffic slowlyScale out

Page 12: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

WHY ELASTICSEARCH

✔ Good API✔ Clear path for growth✔ Batteries included✔ Works like you expect it to

Page 13: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

OUR ELASTICSEARCH

External versioning No dynamic mappingMultiple indices (‘live’ alias)Custom scoring moduleIndex: 2N shards, 1 replicaCluster per datacenter

Page 14: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

IMPORTANT SETTINGS

discovery:zen:

minimum_master_nodes: (N/2)+1

Page 15: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

IMPORTANT SETTINGS

cluster:routing:

allocation:node_concurrent_recoveries: 1

Page 16: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

IMPORTANT SETTINGS

bootstrap:mlockall: true

-Xmx = -Xms = (memory/2)

Page 17: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

IMPORTANT LESSON

One cluster = single point of failure

Page 18: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

OUR SEARCH COMPONENTS

Page 19: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

DISCORANK

Page 20: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

PageRank

Page 21: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

DiscoRank

Page 22: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

DISCORANK STRATEGY

Calculations done offlineSerialize to compact arrayLoad in ES custom scorer Recalculate/reload every N

Page 23: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

INDEXING

Single-purpose applicationStateless and idempotentFull catalog ~= 1 hourBuild, iterate, iterate, iterate

Page 24: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

SEARCHING

Single-purpose applicationStateless and idempotentSC/ES DSL translationOpen-source ES library

Page 25: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

SUGGESTING

Single-purpose application“Stateless” and idempotentPrefix trie in memoryLucene Finite State Transducer

Page 26: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

SERVICEORIENTEDARCHITECTURE

Page 27: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

SOA AT SOUNDCLOUD

Bazooka platformAPI as firewall12 Factor applications

Page 28: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

12 FACTOR APPS

Single codebase (repository)Config stored in environmentBacking services as resourcesStatelessHorizontal scaling with processes

Page 29: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

WHY SOA?

VelocityDeveloper happinessDistributed systems are complex

Page 30: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

SOA infrastructureElasticSearch core

Page 31: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

QUICK STATS

Page 32: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

1.5h

24h

TIME TO REINDEX

Page 33: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

3s

900s

TIME TO VISIBILITY

Page 34: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

OTHER STATS

Cleared (big!) feature backlog > 2x traffic since project start> 3x corpusFlat response curve

Page 35: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

WIN

ElasticSearch works as expectedSOA = force multiplier

Page 36: ElasticSearch and SOAnosqlroadshow.com/dl/NoSQL-Munich-2013/... · WHY SOA? Velocity Developer happiness Distributed systems are complex. SOA infrastructure ElasticSearch core. QUICK

Thanks!Questions?

Peter Bourgonpeter.bourgon.org@peterbourgon