An apparatus for storing and replaying past states of one or more virtual containers being managed by an enterprise software communications platform that enables a plurality of users within each virtual container to communicate with each other via voice, video and text as well as to share and track metrics, dashboards and project tasks, said apparatus comprising:
- an application server to execute the enterprise software communications platform that enables a plurality of users within each virtual container to communicate with each other via voice, video and text as well as to share and track metrics, dashboards and project tasks;
- said application server to couple to one or more clients;
- said application server exposed to a network and to listen for new connections from new clients;
- an event storage database to store:
- i) a plurality of user commands, each of which captures one user action and data associated with the one user action;
- and ii) a plurality of change sets, each of which includes a result of processing the one user action in a format that can be stored without processing any further logic or needed access to a specific version of application logic that handled the one user action at a point in time the one user action occurred;
- a temporal database server to couple to the event storage database and to store an in-memory representation of a current state of each of the one or more virtual containers and a plurality of past states of each of the one or more virtual containers and each change set of the plurality of change sets to transition from each past state of the plurality of past states to a next state in time of the plurality of past states up through the current state;
- said application server further comprising for each client of the one or more clients:
- a) a client agent to communicate with said each client, to maintain a list of one or more open realities, and to accept one or more incoming command requests, one or more subscription requests and one or more replay control requests;
- b) a subscription bundle to process the one or more subscription requests by:
- i) storing metadata about each of the one or more subscription requests;
- ii) sending a query to the temporal database server containing a criteria from each of the one or more subscription requests, which returns zero or more records;
- iii) filtering out any returned zero or more records that said each client has already received;
- and
- iv) sending any remaining records as a change set of add changes to the client agent for delivery to said each client in a state message, and storing metadata that the subscription bundle has done so;
- said subscription bundle to process one or more change sets from the temporal database server either from newly-generated from commands, or from streaming back changes in a replay, by:
- i) breaking each of the one or more change sets into one or more individual changes, including an add operation, an update operation and a remove operation;
- ii) for each individual change, detecting whether said each individual change is relevant to any active subscriptions;
- iii) in some cases, substituting the add operation or the remove operation in place of the update operation;
- and
- iv) sending the one more individual changes to the client agent for delivery to said each client in a state message and storing metadata that the subscription bundle has done so;
- c) a reality state to:
- (i) process one or more subscription requests;
- (ii) apply permissions and security logic before handing off the one or more subscription requests to the subscription bundle;
- (iii) accept one or more change sets from the subscription bundle;
- and (iv) apply permissions and security logic before returning the one or more change sets to the client agent to send in a message to said each client, wherein the reality state may be either a live reality state representing a current state of one of the one or more virtual containers, or a replay reality state representing a state of one of the one or more virtual containers at a past time, and in the case of a replay reality state, the replay reality state extends the one or more subscription requests with a current time of a replay state before passing the one or more subscription requests to the subscription bundle;
- and
- d) a command handler to couple to the event storage database, to process incoming commands and translates the commands into one or more change sets, and to send the one or more change sets to the event storage database for storage therein, which in turn sends the change sets to the temporal database server;
- a non-transitory computer readable media having stored thereon instructions for a processor to execute a client application to provide a user interface for at least one client of the one or more clients to interact with the application server, said client application including:
- a) a user interface component to declare a list of queries representing data dependencies of the user interface on data managed by the application server;
- b) a query engine to capture data requirements of the user interface component and to update the user interface component as data changes that affects the user interface component, said query engine to declare one or more subscriptions in response to user interface changes depending on data needed to render the user interface component being displayed on a screen, wherein said one or more subscriptions cause the application server to automatically send updates to the client application when new data matching any of the one or more subscriptions becomes available or when data is changed or removed which matches any of the one or more subscriptions;
- c) a reality state to maintain an in-memory representation of a temporal state of the user interface based on one or more state messages sent to the client from the application server, wherein each of said one or more state messages includes a reality identifier, a list of changes including operation type, record identifier and data related to an operation and each of said one or more state messages are sent in response to one of the one or more subscriptions;
- and
- d) a server agent to communicate with the application server, wherein each reality state communicates with the application server via the server agent, and wherein for every subscription executed, the reality state sends a single subscription message to the application server, receives zero or more state messages in response to the single subscription message, receives a single result message from the server, and receives one or more sporadic additional state messages as further updates to data related to the subscription occur;
- wherein said application server supports multiple temporal contexts to enable different user interface components of the one or more clients to display different states of the one or more virtual containers at different historical times;
- and
- wherein one or more control signals from the one or more client applications, along with all data requirements, are synchronized to the application server, which then controls streaming of data to said one or more clients.