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
- 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 ?
- If I store it as key value pair, how will I serach using partial keyword(like entering
river newyorkinstead of
new river newyork) which can be combination of partial hotel name and city?
- What can be possible sharded key to distribute the data in cache ?
Consider this system as scalable as