Hello,
I am relatively new to couchbase and trying it out for my next project.
Just wanted some suggestions around modeling my particular usecase of storing flight information:
-
first design
{
src:
_id:
dest:
date:
itineraries: [
{
flightNo:
timeofdeparture:
layoverTime:
…
price:
},
…similar itineraries(in several hundreds)
]
} -
second design -essentially unwinding the itineraries
{ src: _id: dest: date: flightNo: timeofdeparture: layoverTime: **price:** }
…similar itineraries(in several hundreds)
UseCases:
- Price will be getting updated quite frequently(roughly every couple of minutes) and new documents will keep getting inserted, so i expect it to be write intensive
- selecting itineraries based on their attributes(like price, timeOfDeparture, totalLayover time) ignoring any other parameters(like destination etc, i.e. i want to run queries just against all stored itineraries )
The problem I see is the second one i would need a lot more space for metadata(keys). Does anyone has any suggestions around which would serve my usecases better?