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

Launching into Orbit.js

Launching into Orbit.js

98ede30a4a96e7c5547dc964b391e2ed?s=128

Sibiu Web Meetup

November 23, 2019
Tweet

More Decks by Sibiu Web Meetup

Other Decks in Programming

Transcript

  1. LAUNCHING INTO ORBIT.JS

  2. mercury ABOUT ME Stamate Cosmin @monovertex

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

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

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

    • Easy wiring • Glue APIs and strategies together with minimal friction
  6. jupiter MAIN DIRECTIVES

  7. io (jupiter) GOALS • Optimistic/pessimistic strategies • Plug n’ play

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

    • Normalized data • Notifications and change tracking
  9. saturn PRIMITIVES

  10. mimas (saturn) RECORD • Data in normalized form • Has

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

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

    dictates strategies • Handles wiring between a set of sources • Declarative
  17. uranus DATA SOURCES

  18. ariel (uranus) MEMORY • @orbit/memory • Tab-specific • Lives in

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

    a persistent, domain-specific structured storage solution • Especially useful for PWAs, if available
  21. 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
  22. 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)
  23. neptune Q&A

  24. pluto THANK YOU!