Core concepts¶
ObjectsGrid is a backend you use through APIs. Your app stores standardized objects, and ObjectsGrid keeps them, secures them, makes them searchable and tells you when they change. These are the concepts every request involves.
Organization Account: your tenant¶
An Organization Account is your space on ObjectsGrid. Everything you create belongs to it: objects, accounts, your access policy, your webhook configuration. Organization Accounts are isolated from each other. Its id looks like org-123-4567.
Most teams use one Organization Account per environment, for example one to test with and one for production.
Regions and access points¶
You choose where your data lives when you register: the EU or the US. This is your Organization Account's access point. Every request names it in a header, and is served and stored in that region:
Within its region, each access point runs in two cloud regions, so your app stays online when one of them fails.
Objects¶
ObjectsGrid stores objects of standard types, modeled on Schema.org: Product, Offer, Order, Inventory, Organization, Place and more. For data no standard type covers there are GenericObjects, and Enums for your value lists.
Every stored object has:
- an
id, assigned by ObjectsGrid, tags, the attributes your access policy decides on,- read-only
meta: its version, type, and who created and last changed it, and when.
Objects link to each other with References: a product's brand is {"at_id": "https://apis.objectsgrid.com/brands/<id>", "id": "<id>", "at_type": "Brand"}. In GraphQL one query reads an object and the objects it points to. Read The data model for the details.
Two APIs, one set of objects¶
- The GraphQL API is the preferred way to work with business objects: one endpoint,
https://apis.objectsgrid.com/graphql, where each request asks for exactly the fields it needs. - The REST APIs give each object type its own resource, such as
https://apis.objectsgrid.com/products, with search, batch create and conditional writes. Accounts, policies and access logs are managed through REST only.
Both APIs work on the same stored objects: a product created with GraphQL can be read with REST, and the other way round.
flowchart LR
app["Your app"] -->|GraphQL| gql["GraphQL API<br/>/graphql"]
app -->|REST| rest["REST APIs<br/>/products, /offers, ..."]
admin["Your administrators<br/>and servers"] -->|REST| rest
gql --> rest
rest --> store[("Your objects<br/>in your region")]
Accounts: who calls¶
Every request is made by an account of your Organization Account:
| Account | Who uses it | How it signs in |
|---|---|---|
| User Account | People using your app | With an ID token from Google, exchanged for an access token |
Service Account, type secret |
Your servers, scripts and scheduled jobs | With its id and secret |
Service Account, type public |
Anonymous visitors of your app | With its id only |
A User Account is created automatically the first time a person signs in.
Access tokens¶
Accounts sign in at the OAuth 2.0 token endpoints and get an access token, which they send with every request:
Access tokens last one hour. User Accounts also get a refresh token to get new access tokens without signing in again. See Authentication.
Access control: your ABAC policy¶
What an account may do is decided by your Organization Account's ABAC policy: rules written in Rego that compare the tags of the account with the tags of the objects. For example: members of the marketing department may update brands tagged department: marketing. Policies can also hide individual fields from some readers.
Administrators are not subject to the policy. The person who registered the Organization Account is its first administrator. See Access control.
Events and webhooks¶
Every change to an object produces an event, such as ProductCreated or OrderPatched. Configure a webhook to have ObjectsGrid deliver the events you choose to your HTTPS endpoint, signed so you can check they come from ObjectsGrid.
Audit and usage¶
- Every request is recorded as an AccessLogEntry: who called, what, when, and what was allowed or denied.
- Every response carries a correlation id to quote when something goes wrong; see Errors and troubleshooting.
- Your Organization Account has a monthly spending cap that you set; see Usage and limits.