Entity database
First Claim
1. A method comprising:
- receiving, from a client, a request to subscribe to a query on a database storing a plurality of records, wherein each record has a plurality of data fields;
storing a client ID, the query, and a corresponding unique query ID as a new record in a query data structure storing a plurality of query records;
storing in a new record of a query index data structure the query ID and a second data field defining a location within a multidimensional space, wherein the query index data structure is indexed based on the second data field, wherein the second data field is related to one of the plurality of data fields, and wherein the query index data structure maps each query to a region of the multidimensional space;
establishing a persistent connection with the client; and
until the persistent connection is terminated;
determining, responsive to any update to one or more records, and based on the query index data structure, one or more queries of interest whose corresponding region of the multidimensional space encompasses at least one updated record; and
when the one or more queries of interest comprises the query, sending information to the client about each updated record satisfying the query.
1 Assignment
0 Petitions
Accused Products
Abstract
Database schemas, systems, and methods are described herein which enhance database operations when responding to streaming (subscribed) queries regarding records stored in the database. A database schema may include a data table storing a plurality of records each having a plurality of data fields. The schema may also include a query table, and a query index table or tree, or other data structure. The data table stores the current state of each record as defined by its associated data fields. The query table stores all queries mapped to the one or more clients that have subscribed to each query. The query index table, tree, or other data structure indexes the subscribed queries based on a data field common to or associated with the indexed queries. Subsequently, when records and data fields are updated (mutated) in the database, the query index data structure can be used to quickly assess which subscribed clients need to be sent updates with mutated data, so that only the clients who have subscribed to receive updates based on a particular data field do so and the cost of identifying those clients is greatly reduced.
24 Citations
15 Claims
-
1. A method comprising:
-
receiving, from a client, a request to subscribe to a query on a database storing a plurality of records, wherein each record has a plurality of data fields; storing a client ID, the query, and a corresponding unique query ID as a new record in a query data structure storing a plurality of query records; storing in a new record of a query index data structure the query ID and a second data field defining a location within a multidimensional space, wherein the query index data structure is indexed based on the second data field, wherein the second data field is related to one of the plurality of data fields, and wherein the query index data structure maps each query to a region of the multidimensional space; establishing a persistent connection with the client; and until the persistent connection is terminated; determining, responsive to any update to one or more records, and based on the query index data structure, one or more queries of interest whose corresponding region of the multidimensional space encompasses at least one updated record; and when the one or more queries of interest comprises the query, sending information to the client about each updated record satisfying the query. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. One or more non-transitory computer readable storage media comprising computer readable instructions that, when executed, cause a device to perform:
-
receiving, from a client, a request to subscribe to a query on a database storing a plurality of records, wherein each record has a plurality of data fields; storing a client ID, the query, and a corresponding unique query ID as a record in a query data structure; storing in a new record of a query index data structure the query ID and a second data field defining a location within a multidimensional space, wherein the query index data structure is indexed based on the second data field, wherein the second data field is related to one of the plurality of data fields, and wherein the query index data structure maps each query to a region of the multidimensional space; establishing a persistent connection with the client; and until the persistent connection is terminated; determining, responsive to any update to one or more records of the plurality of records in the database, and based on the query index data structure, one or more queries of interest whose corresponding region of the multidimensional space encompasses at least one updated record; and when the one or more queries of interest comprises the query, sending information to the client about each updated record satisfying the query. - View Dependent Claims (8, 9, 10, 11, 12, 13, 14)
-
-
15. A method comprising:
-
receiving, from a client, a request to subscribe to a query on a database storing a plurality of records, wherein each record represents an entity being simulated in a multidimensional spatial environment, and wherein each data field of a plurality of data fields within each record represents a different component of that entity, and wherein the plurality of data fields comprises a first data field storing a geographic location of the entity within the multidimensional spatial environment; storing a client ID, the query, and a corresponding unique query ID in a record of a query data structure; storing the query ID and a second data field in a record of a query index data structure indexed based on the second data field, wherein the second data field, for each query ID, defines an associated spatial region of interest within the multidimensional spatial environment; establishing a persistent connection with the client; and until the persistent connection is terminated; determining, responsive to an update to one or more records of the plurality of records in the database, a list of one or more queries for which the update is within the associated region of interest; determining one or more clients subscribed to each query in the list of one or more queries; and sending, to each subscribed client, updated records within the associated region of interest for each query to which the client is subscribed.
-
Specification