Backends connect Dataset and Documents to data from a specific ‘Backend’ data
source. They provide methods for loading and saving Datasets and individuals
Documents as well as for bulk loading via a query API and doing bulk transforms
on the backend.
Looking for quickstart tutorial rather than reference documentation? See the Backends Tutorial.
Backends come in 2 flavours:
Loader backends - only implement fetch method. The data is then cached in a
Memory.Store on the Dataset and interacted with there. This is best for
sources which just allow you to load data or where you want to load the data
once and work with it locally.
Store backends - these support fetch, query and, if write-enabled, save.
These are suitable where the backend contains a lot of data (infeasible to
load locally - for examples a million rows) or where the backend has
capabilities you want to take advantage of.
Examples of the 2 types of backends are provided by the Google docs backend (a
“Loader” backend) and the ElasticSearch backend (a Store backend).
You can find a list of the available Backends along with examples of how to use
them in the Backends Tutorial.
Note that it’s easy to write your own backend - you just need to implement the
Recline Backend API described below.
Backend modules must implement the following API:
Details of each function below. Note that:
Each backend function takes a dataset object. This is not a Dataset object
but is simple JS object representation resulting from calling
It is required because the Dataset attributes contain details of specific
backend (e.g. url for ElasticSearch etc).
Each function returns a promise API object - that is something conforming to
the jquery promise API and, in particular, having a done and fail function.
On success, promise callback must return an object with the following structure: