I've been doing some research on Nosql (RavenDB in particular) and I'm still unsure of the best way to approach the following:
I have two simple objects, 'user' and 'events'. A user can enter many events and an event can be entered by many users - a standard many to many relationship. I'm trying to get out of the relational database mindset!
Here are the queries/actions that I'd like to run against the database:
- Get me all the events that a user has not entered
- Get me all the events that a user has entered
- Update all the events (properties like remaining spaces) very frequently (data polled from various external data sources).
- Removing events when they've expired
So from what I've read, I have several options:
- Create a new object, that links user and events. For example, a "booking" object, that stores the userId, eventId.
This seems the most logical to me, but it feels rather 'relational database' approach?
- Denormalise the events data within the user object, so there is a list of eventIds on the user.
Seems sensible, but wouldn't this make querying from both directions difficult?
- Don't use RavenDB for this, instead use a relational database.
Many thanks,
Dan C