I need to design the feature like in encommerce(consider hotel booking site) we can enter the keyword/partial-keyword and need to return the relevant results. For Example :- If site admin or hotel owner needs to add the below hotel details in system , It will be added in cache also(basically it will be write through cache).

Hotel-Name City Rating Rate($)

New River NewYork 4 Star 500

My question is how to design the below points in the system

  1. Do I need to store the Hotel data in cache as key value pair may be using Redis or Memcache ? What will be the key and value ?
  2. If I store it as key value pair, how will I serach using partial keyword(like entering river newyork instead of new river newyork) which can be combination of partial hotel name and city?
  3. What can be possible sharded key to distribute the data in cache ?

Consider this system as scalable as Goibibo or Expedia.


Seems like you want to have a search engine. Have you already considered using elasticsearch, instead of implementing such a complex piece of software by yourself?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.