Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
    
How much will those types be arbitrary? Is there a fixed set? (If I understand you correctly, this can be solved in a relational DB as well, possibly involving something like EAV.) –  dezso Nov 4 '12 at 19:08
    
No, it's not fixed. I'd want it to store numbers, strings, and ideally, arrays and hashmaps too. –  user1527166 Nov 4 '12 at 19:14
    
I'm not sure I'm fully understanding this but I'm not sure why you couldn't store this information in a relational database or even a star schema sort of set up. –  Zane Nov 7 '12 at 16:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.