In an app, I'll be storing information about events
, specifically,
session_id
url
time
type
data:
foo: bar
bar: foo
The data will basically be a hashmap (need to support arbitrary types / names of variables)
And I need to be able to perform a query like,
select events of type pageview
in which a user (known by session_id)
visited url "some url",
then visited a page "page 2 url" (again taken from another event of type pageview),
and had data.foo = bar in step 1, and data.foo = foo in step 2.
and like,
select median of visit duration of all unique sessions,
where visit duration is (last visit time - first visit time) <= 6 hours
Q: I would have to use a schemaless database, as storing each data element in a different record would require potentially dozens of joins, right?
Q: What database would you use for this?