Slide 1

Slide 1 text

LAUNCHING INTO ORBIT.JS

Slide 2

Slide 2 text

mercury ABOUT ME Stamate Cosmin @monovertex

Slide 3

Slide 3 text

venus ABOUT ORBIT.JS ● Overcharged ORM ● Framework for interacting with and synchronizing various data sources ● Offline/online transitions

Slide 4

Slide 4 text

earth INSPIRATION ● “Ember in Orbit - Building apps for Outer Space Connectivity” ● Miguel Camba @cibernox ● Ember{{fest}} 2019 ● https://youtu.be/ b7-VegI-WX8

Slide 5

Slide 5 text

mars ORBIT.JS PHILOSOPHY ● Everything is interchangeable ● Incremental complexity ● Easy wiring ● Glue APIs and strategies together with minimal friction

Slide 6

Slide 6 text

jupiter MAIN DIRECTIVES

Slide 7

Slide 7 text

io (jupiter) GOALS ● Optimistic/pessimistic strategies ● Plug n’ play ● Client-first ● Branching/merging ● Change tracking => undo/redo support

Slide 8

Slide 8 text

europa (jupiter) CONSTRAINTS ● Disparate data sources ● Compatible interfaces ● Normalized data ● Notifications and change tracking

Slide 9

Slide 9 text

saturn PRIMITIVES

Slide 10

Slide 10 text

mimas (saturn) RECORD ● Data in normalized form ● Has an id ● Has a type ● It can include other attributes or relationships

Slide 11

Slide 11 text

enceladus (saturn) SCHEMA ● The entirety of Models ● Models describe a record type ● Think of Models as classes, records as instances and of schema as domain/project

Slide 12

Slide 12 text

dione (saturn) SOURCE ● Sources are providers and managers of data ● Each source understands how data of any given schema should be stored in their corresponding backend

Slide 13

Slide 13 text

tethys (saturn) TRANSFORM ● A set of Operations ● Operations describe a mutation on a record ● Transforms are atomic ● E.g. a new record, an attribute update, a relationship deletion

Slide 14

Slide 14 text

rhea (saturn) QUERY ● An expression to retrieve specific data ● Same meaning as in traditional database systems ● Query builder

Slide 15

Slide 15 text

iapetus (saturn) LOG TASK BUCKET ● Log: history of transforms ● Task: handle actions in async or synchronous manners ● Bucket: a database backup for database state; holds transient information

Slide 16

Slide 16 text

hyperion (saturn) COORDINATOR ● Higher order component ● The Coordinator dictates strategies ● Handles wiring between a set of sources ● Declarative

Slide 17

Slide 17 text

uranus DATA SOURCES

Slide 18

Slide 18 text

ariel (uranus) MEMORY ● @orbit/memory ● Tab-specific ● Lives in memory allocated for the JS process ● Immutable data structures ● Cheap forking/merging

Slide 19

Slide 19 text

miranda (uranus) JSONAPI ● @orbit/jsonapi ● JSON:API is a set of conventions for building APIs with data formatted as JSON objects ● Modern standard that allows for better integration

Slide 20

Slide 20 text

umbriel (uranus) INDEXEDDB ● @orbit/indexeddb ● Client-side database ● Provides a persistent, domain-specific structured storage solution ● Especially useful for PWAs, if available

Slide 21

Slide 21 text

titania (uranus) LOCAL STORAGE ● @orbit/local-storage ● Synchronous storage ● Designed for smaller amounts of data ● Can be a fallback from indexeddb, but performance can be impacted

Slide 22

Slide 22 text

oberon (uranus) OTHER SOURCES ● Adapters for other sources can be easily implemented ● Custom REST APIs ● orbitdb/orbit-db - peer-to-peer database ● Google Drive - a spreadsheet or a JSON file ● Local file system (nodejs/native apps)

Slide 23

Slide 23 text

neptune Q&A

Slide 24

Slide 24 text

pluto THANK YOU!