The topic of this presentation is how to use ElasticSearch (ES) in order to speedup otherwise slow MySQL analytic queries. For this, we will look at an actual business case for a ride-sharing application, with the actual trip data stored in MySQL.
First, we will examine the ES requirements and explain how to import this data in ES and sync both databases.
Some specifics of ElasticSearch will be discussed, notably the Query DSL as well as the differences with MySQL and how to convert SQL queries to the ElasticSearch DSL.
Then, we will show how to design analytic queries in ES using aggregation and geolocalization, giving some real world examples (e.g. average earning per driver with pickups in the brooklyn area) and performance comparisons with the equivalent queries in MySQL.
Finally, we will discuss how to scale this implementation and make it highly available using ES clustering and sharding features.
Guillaume is an independant consultant and software developer. Previously he led the Remote DBA team at MariaDB and provided consulting services to various startups. His favorite topics are MySQL, Nginx, Golang, Elasticsearch, MongoDB among others.