In a typical scenario, you load data into the store, which maintains a single representation of every unique record coming from your storage layer. The data store offers an API for read, update, and delete operations, which are executed in your storage layer by an adapter, with the results finally synced back to the store. This is your Data or Model layer.

The Model layer is typically where your business logic resides–where you manipulate your data. There are many variations on this pattern, and JSData can work with your preferences.

JSData also runs in NodeJS, where adapters for MongoDB, Redis, RethinkDB, MySql/Postgres/SQLite, etc. are available.

JSData presents a uniform API for executing your typical CRUD operations against any storage layer for which an adapter is available. You can easily combine adapters for more complicated data management.

Model your data

You start modeling your data by registering Resources with the store:

A JSData Resource defines metadata that the store uses to interact with data of that type. The Resource object returned by DS#defineResource(options) exposes an API for working directly with data of that Resource.

With a few lines of code, we can already do all kinds of things with data of type User.

Create a user in Firebase

Update the user

Destroy the user

The tip of the iceberg

I hardly had to write an code, and I already have a fully functional CRUD API on top of Firebase! I can easily add more resources, setup relations between them, and even add another adapter for a more complex application.

You know when you show a treat to a starving (but obedient) puppy, and the puppy just starts drooling all over the floor? That puppy is you right now.