Porting a relational structure to Elasticsearch - Nested or Parent/Child

That's a good decision flow :stuck_out_tongue:
Do you have ram limits?
parent/child joins are held in memory so you have to calculate or estimate the amount of relationships.

Nested documents are a bit of a pain, you'd have to make some groovy scripts to update or do application side updates to the entire document.
Also considering the amount of events you have, there is a max of 2B documents a shard can hold ( including nested).

How about flattening it this way:
Age, Gender, Wave, Time, EVENT1, EVENT2 etc.. dynamically added to the type.
ie:
{ age: 49,
gender: M,
wave: 0,
timestamp: 4/20/2095,
event1: V39
}
each event will be created this way.
If you don't have storage limits this could be easy to manage.
Also elastic search has some pretty nice compression for repeating values..

1 Like