1 of 14

Composable UI

powered by immutable database

(What would happen if REST were immutable?)

Dustin Getz

May 28 2016

2 of 14

“REST does a bad job of efficiently expressing relational data.… I mean REST has its place. For example, it has very predictable performance and well-known cache characteristics. The problem is when you want to fetch data in repeated rounds, or when you want to fetch data that isn't expressed well as a hierarchy (think a graph with cycles -- not uncommon). That's where it breaks down. I think you can get pretty far with batched REST, but I'd like to see some way to query graphs in an easier way.”

(Pete Hunt - April 2014 while working at Facebook)

3 of 14

4 of 14

Surf it on your phone: http://seattle.hypercrud.com/api

5 of 14

6 of 14

Problem Statement

  • large surface area of async
  • large surface area of performance critical code
  • large surface area of failure

Which means…

  • app code complected with I/O
  • poor composition
  • hard to test

If only we could always read from cache!

7 of 14

8 of 14

Datoms, entities, components

[{:id 100 :name "Dustin" :country 101}

{:id 102 :name "Karl" :country 101}

{:id 101 :label "USA"}]

[[100 :name "Dustin"]

[100 :country 101]

[101 :label "USA"]

[102 :name "Karl"]

[102 :country 101]]

[{:id 100

:name "Dustin"

:country {:id 101

:label "USA"}}

{:id 102

:name "Karl"

:country {:id 101

:label "USA"}}]

9 of 14

“git clone to the browser”

  • Large surface area of async
  • Large surface area of performance critical code
  • Large surface area of failure

Which means…

  • app code complected with I/O
  • poor composition

10 of 14

Performance and security

The Web After Tomorrow

Nikita Prokopov

11 of 14

12 of 14

HATEOAS

13 of 14

Recursive graph traversal

http://seattle.hypercrud.com/browser/ (Surf to a community)

[{:id 100

:name "Dustin"

:country {:id 101

:label "USA"}}

{:id 102

:name "Karl"

:country {:id 101

:label "USA"}}]

14 of 14

Conclusion

  • Large surface area of async
  • Large surface area of performance critical code
  • Large surface area of failure
  • app code complected with I/O
  • poor composition
  • ui is an expression
  • failure of hypermedia as a foundation for applications is fixed
  • batteries included, amazing tooling, surfing
  • holy grail?

We are: Dustin Getz, Karl Hardenstine; https://github.com/hypercrud