Breeze JS has an EntityManager that queries entities from the server, keeps them in cache, keeps track of the state of each entity, and saves the changes to the server when requested.
Breeze Sequelize (breeze-sequelize) is a server-side library that works with Sequelize to manage persistence for Breeze client applications. It turns Breeze queries into Sequelize queries, and saves changes to the database using Sequelize.
The Breeze server is designed to be stateless. No long-running transactions, detached objects, or persistent connections are required. Entity state is kept on the client, not the server.
Breeze clients do not require a Breeze server; for example, BreezeJS will also work with existing RESTful APIs. The full power of Breeze comes with supporting the three types of client-server communication.
Breeze client applications make three basic kinds of AJAX calls:
The breeze-sequelize npm package provides a server side framework for translating the results of the breeze query and save HTTP calls into operations against any backend database supported by the node ‘Sequelize’ library.
The node ‘Sequelize’ library is described on github as follows
Note that In order to use the ‘breeze-sequelize’ library, you do NOT need to interact directly with ‘Sequelize’, so knowledge of how to query or save with ‘Sequelize’ is not actually necessary, but might be helpful.
var breezeSequelize = require("breeze-sequelize");
Additional libraries ( not actually required but useful for certain operations)
var Sequelize = require('sequelize'); // The actual 'sequelize' library used by 'breeze-sequelize' var Promise = require('bluebird'); // The Promise implementation used by 'breeze-sequelize'
The Breeze Sequelize server only understands the JSON format, so you’ll need to configure the client: