Hi All, We are building a service which will allow users to buy/sell/rent houses.
We are hoping to use couchbase for our cache layer ; we also plan to use Postgres as our permanent datastore. Our use case
All the house post on our site will having following attributes
- rent/buy/sell
- apartment/house/villa
- city
- locality
- posted by broker/nobroker
- 1BHK / 2 BHK/ 3BHK …etc ( number of Bedroom, Hall and Kitchen )
- price range
- area
Our users certainly needs to select city and rent/buy/sell flag but after that they can choose any other parameters as filters.
Based on this understanding we decided to do the following
Create following doctype - Housing--<RENT/BUY/SELL>OUT
and then create views on other attributes such as locality.
But this means if a user select multiple attributes as filters then either we need to use multiple views to serve the query which may be slow or need to go to our backend database Postgres.
Our questions are
-
What is the best way to think about views and create the same? In the above situation what views should we create?
-
Are there obvious downside of using multiple views to serve a query? Is there
any guidelines in terms of what type of complex query can be served from couchbase i.e. for example queries using only 2 views? -
Can we use N1QL queries on top of output of views to server the query? Will it better then serving data using properly indexed tables on Postgres?
Thanks in advance for your help.