ROS - use the history

ros

#1

To keep track of changes and sync, realm platform stores the whole transaction history on the server, is that correct? I am wondering if this is somehow exposed to the API and could be used for a Undo/Redo history or snapshot feature rather than implementing this separately in the database by double-tracking the projects history.


#2

any ideas on this ? Or examples how to simply implement snapshots/history maybe?


#3

@chuck We do not expose the operation log to higher level APIs but we do have an Adapter API that would allow you to capture all of the changes and then push them into a queue like Kafka where you could later play it back

https://docs.realm.io/platform/using-synced-realms/server-side-usage/data-integration


#4

We are also investigating, how to use the internal Realm history to display user data changes in a similar way how git displays a log for a file.

For instance, let assume the following model schema:

var ObjectSchema = {
    name: "Object",
    primaryKey: "guid",
    properties: {
        guid: "string",
        text: "string",
    }
};

We would like to get the latest text value of any Object instance in the database (by guid) as well as the history of Object changes. By history I mean the previous text value, author, date of the change and some unique hash value.

Is this information available in the Realm object database stored at the client? If yes, can this information be provided to the client application by an API (preferably JS)?

If this information is not available at the client, does the following workaround make sense?

The workaround is based on modelling version trees using ObjectVersion data type:

var ObjectSchema = {
    name: "Object",
    primaryKey: "guid",
    properties: {
        guid: "string",
        lastVersion: "ObjectVersion"
    }
};

var ObjectVersionSchema = {
    name: "ObjectVersion",
    properties: {
        hash: "string",
        text: "string",
        lastChangedBy: "User",
        lastChangedOn: "date",
        prevVersion: "ObjectVersion"
    }
};

What would be overhead of data stored in ObjectVersion instances considering the Realm internal versioning data stored on the server?