How Lights Online increased CVR |READ NOW
Behind the Scenes of Real-Time Interactive Recommendations
Siddharth Dalal
November 22, 2021

Below, you'll see a video of our interactive product recommender for Shopify product pages (click here to try it for yourself):

Initially, our recommendations are loaded based on a single product and our proprietary Skafos Weighted Similarity™ model. However, things don’t end there. When you interact — either upvote (click ‘More Like This’) or downvote (click ‘Not My Style’), we now have both your initial product and your interaction. The next product or products that load, load based on a combination of all your actions together.

And as you click around you can see we load recommendations in milliseconds. Our interaction time for a medium-sized store (~10,000 products) is under 300ms. The first timestamp is when we sent the interaction details to our backend. The second one is when we got a response back.

Performance with 10,000+ products

Even for a large store with over 35,000 products, our response time is under a second (669ms for this example):

Performance with 35,000+ products

Most of the time, our results load fast enough that we have to show loading animations because product image loads are slow.

To make this happen, we have made several architectural choices. The first simple choice is that we use WebSockets instead of HTTP requests. The bigger piece is our microservices architecture. Our backend is made up of over 40 microservices. Here’s a redacted version showing the complexity of our secret sauce:

Skafos microservices architecture

Each box represents a microservice. Each one is small, fast, and built to scale. The services in the top half of the diagram are dedicated to providing search. We store product data in Redis and our models in memory to make searches lightning fast. For the microservice that is responsible for the search results and data, we stand up a unique instance for every customer. This isolates the data, reduces the search space, and provides results much faster.

This is how we can take your interactions, run multiple models, add weight to the results, and send a response almost instantly back to power our interactive recommendations.

We won’t stop here. We are constantly improving the performance of our products and our microservices architecture makes it convenient to keep up with the pace of our innovation as we can continuously and rapidly update small bits of the infrastructure. Collectively these small improvements contribute to significant overall improvement.

Photo by fabio on Unsplash