Skip to content

BreezeData management for JavaScript clients

Query, cache, track changes and save entity graphs — against any service that speaks HTTP and JSON.

How the client and server talk ​

How a Breeze client talks to a Breeze .NET server Three exchanges over HTTP and JSON. Metadata: the client gets the model, which the server reads from its mapping; breeze-gen-entities also turns it into TypeScript classes, which give the app typed entities and typed queries. Query: the client sends a query, the server runs it on IQueryable as SQL, and the entities come back into the client's cache. Save: the client sends its tracked changes as one change-set, the server saves them in one transaction and returns the saved entities and their real keys. BrowserYour appAngular · React · Vue · …Typed entities & queriesTypeScript classes for your modelbreeze-client · EntityManagerbreeze-gen-entitiesMetadata storetypes, keys, relationshipsEntity cachemerges what comes backChange trackingadded, modified, deletedASP.NET Core serverYour controllerone per data serviceBreeze .NET serverMetadata()read from your mapping[BreezeQueryFilter]runs it on IQueryableSaveChanges()one transactionEF Core orNHibernateDatabaseSQLSQL1 · MetadataGET …/Metadatathe model, as JSON2 · QueryGET …/Customers?{ query }entities, as JSON3 · SavePOST …/SaveChangessaved entities + real keysHow a Breeze client talks to a Breeze .NET server Three exchanges over HTTP and JSON: metadata, query and save. Each request goes from the browser to the server, and its response comes back. BrowserServer1 · MetadataMetadata storeMetadata()GET …/Metadatathe modeland, via breeze-gen-entities, typed entities & queries2 · QueryEntity cacheQuery filterGET …/Customers?{…}entities3 · SaveChange trackingSaveChanges()POST …/SaveChangesentities + keys
All three are plain HTTP and JSON, and the server keeps nothing between them: the cache and the pending changes live in the client.
  1. Metadata. The client asks once for the model: entity types, keys, relationships and validation. A Breeze .NET server reads it from your Entity Framework Core or NHibernate mapping, so you never describe the model twice. See Metadata. The same metadata is what breeze-gen-entities turns into a TypeScript class per entity type, which is what gives you typed entities and typed queries — see Generating entity classes.
  2. Query. The client composes a query — filter, sort, page, expand — and sends it in the URL. The server applies it to the IQueryable your action returns, so it runs in the database as SQL. The entities that come back are merged into the cache. See Querying.
  3. Save. The client sends every pending change in one request. The server saves them in one transaction, and sends back the saved entities with the real keys in place of the temporary ones. See Saving changes.

The server side is covered in Using a Breeze .NET server. Breeze can also talk to other back ends — see Talking to the server.

Not using .NET?

Nothing in these three exchanges is specific to .NET: they are plain HTTP and JSON, so a server written for any platform can answer them. Today the .NET server is the only one in production. If you need a Breeze server for another platform — Node, Java, Python or anything else — contact IdeaBlade about having one written.

Breeze 3 ​

Version 3 is a rewrite of the 2.x codebase with the same public API. What changed:

  • ESM only, one package, one npm tag. No CommonJS build, no UMD bundle, no mjs/cjs dist-tags to choose between.
  • No runtime dependencies.
  • No adapter setup — Breeze uses its standard adapters unless you register others. When you do, configureBreeze replaces the stringly-typed adapter registration.
  • Knockout, jQuery, AngularJS and OData support removed. See Migrating from 2.x for what to do if you use them.
  • Built under strictNullChecks and noImplicitAny.

If you are coming from 2.x, start with Migrating from 2.x — most applications need only a handful of changes, and they are listed there.

Looking for 2.x?

The breeze-client 2.x documentation is still at breeze.github.io/doc-js.

Released under the MIT License.