Supporting 3.6 million queries on 460 million documents daily
LiveChat provides an online chat solution as an alternative to phone and email. More than 6,000 customers from around the world use LiveChat daily to communicate with their customers. They range from small one-person businesses to large international organizations, such as LG, Air Asia, Samsung, Adobe, KIA and the US Department of State.
"Our clients use the search functionality on a daily basis when using LiveChat," explains Marcin Dojwa, Server Developer for LiveChat. "They browse through hundreds of chats and archives to find specific conversations."
LiveChat customers conduct 3.6 million queries and 220 million "get" operations per day on 460 million documents. LiveChat keeps these documents updated with 70 million indexing operations every day.
"We used MySQL prior to using Elasticsearch," Dojwa outlines. "Since we want to provide a painless experience for our users, we wanted a search engine that would facilitate that. MySQL was too slow for our needs – querying, updating and indexing."
Searching chat archives and generating statistics was very slow on LiveChat, prior to Elasticsearch, because the system was querying data using many additional filters.
LiveChat's previous indexing solution failed because there were more documents to be indexed than the database could index during the working hours of their clients. This caused the database queues to grow and indexing all the documents could take several hours, in turn causing failures in external services that required the data immediately, such as creating Helpdesk tickets based on chat archives.
"Apart from the speed, the scalability was also difficult with MySQL," Dojwa adds. "To provide the highest quality of service possible, we needed a reliable solution for all our search-related needs."
Delivering instant access to data statistics and chat archives
LiveChat implemented Elasticsearch to collect statistics and maintain archives for all the company's clients. LiveChat leverages the many convenient features of Elasticsearch: Full text search allows users to search through chat archives; faceting makes it possible to pull various statistics for LiveChat clients; and aliases facilitate quick data access. In addition, Elasticsearch is used to store and receive data from the servers. Currently, LiveChat employs Elasticsearch as its sole data store.
"We use aliases for each client and route them to a single shard," Dojwa says. "This allows for very fast data queries."
When searching for a specific conversation or a statistic it is important for LiveChat to present the search results immediately. If a search takes more than a couple seconds, and the LiveChat customer has to do several searches every hour, the wait time really starts to add up.
"We strive to deliver the best possible service for our clients," Dojwa says. "Only with Elasticsearch are we able to provide fast enough access to data statistics. The query results are now produced instantly, which makes the whole search function much more fluid and responsive. The ability to provide almost instantaneous access to chat archives is a great contributor to our client's positive user experience."
The LiveChat platform uses Elasticsearch to store and pull data. In addition, LiveChat uses Elasticsearch to view the conversation tied to a particular set of data. With Elasticsearch, when a LiveChat user searches for a particular chat, all the related data is also made available instantly.
"We've noted a considerable decrease in the time it takes to pull a statistic or a chat, even when more complex filter options come into play," Dojwa adds. "Thanks to Elasticsearch, we managed to reduce that time from an average of 2 seconds to 100 milliseconds."
Indexing operations have also accelerated with Elasticsearch, making data updates available immediately. Now each of the documents is updated in LiveChat on an average of 20 to 30 times every 20 to 60 seconds.
Reliability for today and scalability for tomorrow
Elasticsearch's stability, reliability and customer service are an important advantage to LiveChat and its customers. "Our clients need access to the data at all times, so it is important to keep our availability at 100%," Dojwa explains. "If our service were to be dropped, we would loose chat history, statistics and everything else our clients need to work with in LiveChat. We are pleased with the reliability of Elasticsearch."
Scalability is also an important benefit of Elasticsearch as LiveChat's data continues to grow. LiveChat keeps all the archives and all the incidents they have ever had, which means their data set keeps getting larger.
"Scalability is not a problem with Elasticsearch, but it was with MySQL," Dojwa adds. "We had to monitor when to put another MySQL server and start indexing the data on it. We do not have that problem with Elasticsearch because we can quickly, easily and economically add another node whenever we need it."
"We are satisfied with the quality and speed of customer service," continues Dojwa. "If we have any questions, we can get answers quickly and move forward with our development."
More about LiveChat