Joins in Flatland



Joins in Flatland

0 0


joinsflatland


On Github vharitonsky / joinsflatland

Joins in Flatland

Do you use it?

Sharded, document oriented architecture means

NO JOINS

NOT TRUE

Parent-Child relationship

Introduced before 0.9

Not very famous/popular/obvious

Why?

Normalization of course!

Before

21 mln documents

53 Gb approx.

After

21 mln documents

6.6 Gb approx.

A WIN!

HOW?

"mappings":{
        "company": {
            "dynamic": false,
            "properties": {

            }
        },
        "product": {
            "_all": {
                "enabled": false
            },
            "_parent": {
                "type": "company"
            }
        }
}

Blessings

Normalization

Constraints

Structured approach

DRAWBACKS 1

Create mappings at once

Same shard

Speed?

DRAWBACKS 2

Queries

Grandparent-parent-child-grandchild

Joins in Flatland