Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Launching into Orbit.js

Launching into Orbit.js

Avatar for Sibiu Web Meetup

Sibiu Web Meetup

November 23, 2019
Tweet

More Decks by Sibiu Web Meetup

Other Decks in Programming

Transcript

  1. venus ABOUT ORBIT.JS • Overcharged ORM • Framework for interacting

    with and synchronizing various data sources • Offline/online transitions
  2. earth INSPIRATION • “Ember in Orbit - Building apps for

    Outer Space Connectivity” • Miguel Camba @cibernox • Ember{{fest}} 2019 • https://youtu.be/ b7-VegI-WX8
  3. mars ORBIT.JS PHILOSOPHY • Everything is interchangeable • Incremental complexity

    • Easy wiring • Glue APIs and strategies together with minimal friction
  4. io (jupiter) GOALS • Optimistic/pessimistic strategies • Plug n’ play

    • Client-first • Branching/merging • Change tracking => undo/redo support
  5. europa (jupiter) CONSTRAINTS • Disparate data sources • Compatible interfaces

    • Normalized data • Notifications and change tracking
  6. mimas (saturn) RECORD • Data in normalized form • Has

    an id • Has a type • It can include other attributes or relationships
  7. 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
  8. 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
  9. 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
  10. rhea (saturn) QUERY • An expression to retrieve specific data

    • Same meaning as in traditional database systems • Query builder
  11. 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
  12. hyperion (saturn) COORDINATOR • Higher order component • The Coordinator

    dictates strategies • Handles wiring between a set of sources • Declarative
  13. ariel (uranus) MEMORY • @orbit/memory • Tab-specific • Lives in

    memory allocated for the JS process • Immutable data structures • Cheap forking/merging
  14. 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
  15. umbriel (uranus) INDEXEDDB • @orbit/indexeddb • Client-side database • Provides

    a persistent, domain-specific structured storage solution • Especially useful for PWAs, if available
  16. 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
  17. 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)