Skip to content

Latest commit

 

History

History
217 lines (141 loc) · 3.4 KB

presentation.md

File metadata and controls

217 lines (141 loc) · 3.4 KB

jrGQL

sli.do for questions #jrgql

Most starred and relevant question gets a gift


Data

At first there were only the 3rd normal form

Users                             Relations
/----+-------+----------------\   /----+--------+------\
| id | Name  | Email          |   | id | person | boss |
+----+-------+----------------+   +----+--------+------+
| 1  | James | [email protected] |   | 1  | 1      | 2    |
| 2  | Wife  | [email protected]  |   | 2  | 2      | 3    |
| 3  | Cat   | [email protected]   |   \----+--------+------/
\----+-------+----------------/

???

In the last milennia HW was more expensive than Dev.

Strongly centralized languages, few big solutions existed.


New wave

Then denormalization exploded the DCs

James' relations            Wife's relations            Cat's relations
/-------+----------------\  /-------+----------------\  /-------+----------------\
| Name  | Email          |  | Name  | Email          |  | Name  | Email          |
+-------+----------------+  +-------+----------------+  +-------+----------------+
| Wife  | [email protected]  |  | James | [email protected] |  | James | [email protected] |
| Cat   | [email protected]   |  | Cat   | [email protected]   |  | Wife  | [email protected]  |
\-------+----------------/  \-------+----------------/  \-------+----------------/

???

~10 years ago map-reduce and nosql exploded the industry, new players emerged, changed the mindset.


Back to the basics

Natural presentations for the win

{ name: James, email: [email protected] } -- boss --\
                                                 |
                                                 V
                                            { name: Wife, email: [email protected] }
                                                 |
{ name: Cat, email: [email protected] } <----- boss --/

???

There is no spoon, everything is a graph.


Graph DBs

  • Neo4j

  • ArangoDb

  • Any Engine can hold a graph

???

MongoDb driver


Graph representation

G = (V, E)

  • Node collection(s)

  • Edge collection(s)

    • Edge list

    • Adjacency matrix

    • Adjacency lists

???

Ad. list is used in examples.


Query languages

Gremlin

g.V.has('name','hercules').out('father').out('father').name

Cypher

MATCH (node1:Label1)-->(node2:Label2)
WHERE node1.propertyA = {value}
RETURN node2.propertyA, node2.propertyB

GraphQL

GetAllTheThingsQuery { people(name: "GQL", search: "Smith", first: 5) { name } }

???

Gremlin is the oldest.

Cypher is the native lanugage of the biggest player.

GraphQL got many hype and is fancy because of FB authority.


jrGQL

Back to the basics again.

{
  "name": "James",
  "?boss": {
    "?name": "",
    "?boss": {
      "?name": ""
    }
  }
}
[
  {
    "name": "James",
    "boss": {
      "name": "Wife",
      "boss": {
        "name": "Cat"
      }
    }
  }
]

???

WYRIWYG


Status

Learned

  • regexps
  • d3js
  • codemirror
  • JS gems
  • remarkjs

Reference implementation

  • 260 lines
  • existing language
  • WYRIWYG
  • still a document store
  • MongoDB driver

???

JS regexp object is stateful.

d3js is not exactly jQuery.

JS gem: ASI


Examples

https://jrgql.github.io/


Conclusion

  • regexp should be opt-in

  • typelessness is value

  • missing features: ordering, !count, etc...


Q&A

Github issues