With Space Cloud, you can subscribe to realtime changes in your database.
The clients can subscribe to realtime changes in database by specifying a where clause. It’s similar to a regular query. However, it’s live, i.e. the client gets updated on any changes in the result set.
Space Cloud sends the initial result set on subscription request. After that, it only sends the changes and not the entire result set for efficient bandwidth utilization. The client SDKs maintain the complete result for you based on the initial set and changes received after that. However, if you are only interested in the changes and not the entire result set, you can customize this behaviour.
Note: The feature of maintaining the entire result set is only available in client SDKs. In GraphQL, you can write a stateful link if you wish to maintain the entire result set.
To offload the database, Space Cloud does not rely on any CDC (Change Data Capture) mechanism. Space Cloud uses its in-built eventing system to guarantee that all changes irrespective of any network failures propagates to the clients over a bi-directional link in an orderly fashion.
Isolating the database querying and the realtime module helps it scale the realtime piece independent of database. However, this poses some limitations which are acceptable for most applications.
_id
in case of MongoDB and id
for MySQL and Postgres and of type ID._id
or id
field in the where clause.liveQuery
.Note: These limitations are only applicable if you intend to use the realtime functionality.