Mechanisms for handling schema changes

A schema management layer in database systems allows clients to update schemas without downtime, addressing the lack of strongly typed support in key-value databases and ensuring consistent data formatting during upgrades.

JP2024540597AActive Publication Date: 2024-10-31SALESFORCE INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024529884
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-12-01
Filing Date
2022-11-08
Publication Date
2024-10-31
Estimated Expiration
2042-11-08

AI Technical Summary

Technical Problem

Database systems, particularly key-value databases, lack support for strongly typed schemas, leading to inconsistent data formatting that can cause applications to malfunction, and existing solutions require clients to manage schema updates without downtime, imposing a significant burden.

Method used

Implementing a schema management layer that enables clients to update schemas without stopping database services by using a database node to manage schema changes, ensuring data conforms to the new schema through in-memory caching and version tracking, allowing continuous access to records during upgrades.

Benefits of technology

Enables clients to update database schemas without performance degradation, ensuring data consistency and allowing applications to continue operating smoothly during schema changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024540597000001_ABST
    Figure 2024540597000001_ABST
Patent Text Reader

Abstract

Techniques related to database schema are disclosed. A computer system may receive a metadata document describing an updated schema for a database storing a plurality of records. The computer system may instantiate a set of processes to execute an upgrade routine to upgrade some of the plurality of records to conform to the updated schema. While the set of processes are upgrading the records, the computer system may receive a request to perform an operation on one of the plurality of records. The computer system may detect that the record corresponds to a schema version earlier than the updated schema version of the metadata document and may upgrade the record to conform to the updated schema. After upgrading the record, the computer system may perform the requested operation on the record.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates generally to database systems, and more specifically to various mechanisms for allowing changes to metadata documents without disrupting the database service. [Background technology]

[0002] Businesses routinely implement database management systems (or simply "database systems") that enable users to store collections of information in an organized manner that can be efficiently accessed and manipulated. In some cases, database systems implement key-value databases that store information as a collection of key-value pairs, where the key serves as a unique identifier to access its associated value. In operation, a database system receives requests from users, via applications, or from other systems, such as another database system, to perform transactions on the information stored in its key-value database. Thus, the database system reads information from and / or writes information back to the database using keys specified in those requests. [Brief description of the drawings]

[0003] [Figure 1] FIG. 1 is a block diagram illustrating example elements of a system having a database store and database nodes in accordance with some embodiments. [Diagram 2] A block diagram illustrating example elements of a metadata document that describes a set of database entities, according to some embodiments. [Figure 3A] FIG. 1 is a block diagram illustrating example elements of a database application that processes transactions that include writing records, according to some embodiments. [Figure 3B]FIG. 1 is a block diagram illustrating example elements of a database application that processes transactions that include returning records, according to some embodiments. [Figure 4] FIG. 2 is a block diagram illustrating example elements of a database node capable of refreshing its cache to store updated metadata documents, according to some embodiments. [Diagram 5] FIG. 2 is a flow diagram illustrating an example method for upgrading records as part of processing a transaction, according to some embodiments. [Figure 6] FIG. 2 is a flow diagram illustrating an example method for upgrading records as part of processing a transaction, according to some embodiments. [Figure 7] FIG. 1 is a block diagram illustrating elements of a multi-tenant system, according to some embodiments. [Figure 8] FIG. 1 is a block diagram illustrating elements of a computer system for implementing various systems described in this disclosure, according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0004] A database system may implement a key-value database that stores data as a collection of key-value pairs. The key-value database typically provides little or no support for checking or enforcing rules regarding what data can be written to the database. For example, a database may not support a "strongly typed" schema that defines the type and structure of data that is permitted to be written to the database. As a result, without the enforcement of a strongly typed schema, an application may write data to the database and then another application may access that data expecting it to contain certain values ​​or be formatted in a certain way, which may not be the case. Thus, the other application may not be able to operate correctly on the data. Because the database does not provide that support, the responsibility for ensuring that the data is stored and structured correctly before being later retrieved rests with the client / user of the database, not the provider. This makes it easier for database system providers to adopt key-value databases, but places an additional burden on the client to ensure that the data is written according to the schema. To alleviate this burden on the client, it would be desirable to implement a schema management layer that sits on top of the key-value database and provides support for strongly typed schemas. It would also be desirable to allow clients to update their schema without experiencing undue performance degradation. This disclosure addresses, among other things, the problem of how to implement a schema management layer such that clients / tenants can update their schema without taking down parts of the database to implement the updates.

[0005] In various embodiments described below, a computer system includes a database store and a database node that executes processes to service transaction requests from clients of the computer system. The database node may ensure that data is manipulated (e.g., accessed, stored, etc.) according to a schema described in a metadata document. During operation, the database node may receive a schema update request that specifies a metadata document that describes an updated schema. In response to the request, in various embodiments, the database node instantiates a set of upgrade processes that execute upgrade routines to upgrade the data in the database store to conform to the schema. As an example, the updated schema may add a new field to a users table. The upgrade process may upgrade records in that users table such that they include a value for the new field. However, while those upgrade processes are upgrading the records, the database node may receive a request to execute a transaction that includes a record of the database entity being upgraded. Before performing the requested operation on the record, in various embodiments, since the record may not yet have been reached by the upgrade process, the database node determines whether the version of the record matches the version of the updated schema. If there is a mismatch between the versions, the database node executes a set of steps to upgrade the record to conform to the updated schema. Once the record is upgraded, the database node may perform the requested action on the record.

[0006] The metadata document, in various embodiments, identifies the status of one or more of the database entities described by the schema. While a database entity is being created or upgraded, its status may be set to reflect these processes, and when the creation / upgrade is complete, the status may be updated to indicate that the database entity is ready. In various embodiments, the status described in the metadata document may be queried by a client to determine whether a particular database entity (e.g., an index) is available for use. Once a client determines that a database entity is ready, it may begin issuing transaction requests that utilize that database entity. The transaction request, in some embodiments, may specify a minimum schema version to be used to process the request. Thus, when processing a request, a database node may determine whether the version of the schema cached in the database node's memory meets the minimum schema version. If the minimum schema version is not met, in various embodiments, the database node replaces the cached schema with the schema described in the latest metadata document. Thus, a client may cause a database node to refresh its cache using the minimum schema version (if it has not already done so).

[0007] These techniques can be advantageous because they allow a "schema management layer" to be implemented that provides strong typing over a schema that can be updated without unduly impacting clients while records are upgraded to conform to that schema. Consider an example where a client updates its schema to add a new field to a table. Because the schema management layer can upgrade records at the time they are requested or manipulated by the client, the client can continue to access the records of the table while the table is being upgraded. Thus, the client would not need to wait for updates to propagate through the table before interacting with the table. Furthermore, by tracking the status of different database entities described in the schema, the client can determine whether a particular entity, such as a new index, is available for use. Furthermore, by using a minimum schema version in transaction requests, the client can force database nodes to refresh their caches and utilize the latest version when appropriate, thus ensuring causal consistency. An exemplary application of the present technique will now be described, first with reference to FIG. 1.

[0008] Referring now to FIG. 1, a block diagram of a system 100 is shown. The system 100 includes a set of components that may be implemented via hardware or a combination of hardware and software routines. In the illustrated embodiment, the system 100 includes a database store 110 and a database node 120 that interacts with the database store 110 and clients 121. As further shown, the database store 110 includes records 112 and metadata documents 114, and the database node 120 includes a database application 130 and an in-memory cache 140 that is used to cache the metadata documents 114. Also shown, the database application 130 includes a schema engine 135 that can spawn one or more upgrade processes 137. In some embodiments, the system 100 is implemented differently than shown. For example, the system 100 may include multiple database nodes 120 that collectively implement a database service, the database store 110 may store multiple metadata documents 114, and / or multiple clients 121 may interact with the database node 120. As another example, the metadata documents 114 may be stored in a metadata store separate from the database store 110 .

[0009] System 100, in various embodiments, implements a platform service (e.g., a customer relationship management (CRM) platform service) that enables users of that service to develop, execute, and manage applications. System 100 may be a multi-tenant system that provides various functions to users / tenants hosted by the multi-tenant system. Thus, system 100 may execute software routines from various different users (e.g., the provider and tenants of system 100) and provide code, web pages, and other data to users, databases (e.g., database store 110), and entities associated with system 100 (e.g., third-party systems). In various embodiments, system 100 is implemented using a cloud infrastructure provided by a cloud provider. Thus, database store 110 and database nodes 120 may run on and utilize available cloud resources (e.g., computing resources, storage resources, network resources, etc.) of that cloud infrastructure to facilitate their operation. For example, database nodes 120 may run within a virtual environment hosted on server-based hardware contained in the cloud provider's data center. However, in some embodiments, the system 100 is implemented utilizing a local or private infrastructure, as opposed to a public cloud.

[0010] Database store 110, in various embodiments, includes a collection of information organized to allow access, storage, and manipulation of the information. Database store 110 may include support software (e.g., storage nodes) that enable database nodes 120 to perform these operations (e.g., access, store, etc.) on the information stored in database store 110. In various embodiments, database store 110 is implemented using a single or multiple storage devices connected to each other over a network (e.g., a storage attached network (SAN)) and configured to store information redundantly to prevent data loss. The storage devices may store data persistently, and thus database store 110 may function as persistent storage for system 100. In various embodiments, data written to database store 110 by database node 120 is accessible to other database nodes 120 in the multi-node configuration.

[0011] In various embodiments, data is stored in the database store 110 in records 112 structured according to one or more schemas described in a metadata document 114. In some cases, the system 100 may implement a relational database, and thus the metadata document 114 may describe tables, views, indexes, relations, triggers, etc. Thus, the records 112 may correspond to rows in a database table and specify values ​​for one or more fields of that table. One or more of the fields may be used to define a key for accessing that record from the database store 110. In various cases, the system 100 may implement a non-relational database, such as a key-value store, a wide-column store, a document store, etc., and thus the metadata document 114 may describe properties and / or constraints of items / records 112 stored in the database store 110. For example, a record 112 may be a key-value pair that includes data and a corresponding key that can be used to look up that record 112. Thus, the metadata document 114 may describe a set of fields in which the record 112 is expected to store values. Thus, in various embodiments, the metadata document 114 is a monolithic document that describes the organization of the data as a blueprint for how the database store 110 should be structured. An exemplary metadata document 114 is described in more detail with respect to FIG.

[0012] Database node 120, in various embodiments, provides various database services such as data storage, data retrieval, and data manipulation. Database node 120 may be a combination of hardware and software (e.g., database application 130) executing on the hardware. In various embodiments, database application 130 is executable to provide the database services of database node 120 to components within system 100 and / or external to system 100. For example, as shown, database node 120 may receive a transaction request 122 (e.g., via an API such as Java Database Connectivity) from a client 121 (e.g., an application server, a user device, another database node, etc.) to perform a transaction. A database transaction, in various embodiments, is a logical unit of work (e.g., a specified set of database operations) to be performed in connection with database store 110. For example, processing a database transaction may include executing a SELECT command to select a set of rows from a set of tables. The contents of the rows may be specified in records 112, and thus database node 120 may return records 112 corresponding to those rows. As another example, processing a database transaction may include writing a set of documents, in the form of records 112, to a collection stored in database store 110. In some embodiments, database node 120 first writes records 112 to an in-memory cache 140 and then flushes them to database store 110 after they are committed. As used herein, the phrase "committing a transaction" is used according to its well-understood meaning to refer to the process of causing changes made during a transaction to be saved and visible outside the entity that performed the transaction.

[0013] As part of processing database transactions, in various embodiments, database node 120 ensures that data is managed according to a set of schemas described in metadata document 114. In particular, database store 110 may be a key-value store that does not provide support for strong typing, although strong typing may still be desired by client 121. Thus, database node 120, in various embodiments, allows client 121 to define a framework for structuring and accessing data, and then database node 120 implements that framework, resulting in strong typing. Thus, in various embodiments, database node 120 implements the aforementioned schema management layer. To potentially process transactions more efficiently, database node 120 may cache metadata document 114 in its in-memory cache 140, as shown.

[0014] In-memory cache 140, in various embodiments, is a buffer that stores data in memory (e.g., random access memory) of database node 120. In-memory cache 140 may be located in a shared memory area designated by an operating system running on database node 120 and may be accessible to a database process (e.g., upgrade process 137) of database node 120. Thus, when processing a transaction request 122, database application 130 may access metadata document 114 from in-memory cache 140 and then consider metadata document 114 to process the requested transaction. As described in more detail with respect to FIG. 4, metadata document 114 cached in in-memory cache 140 may be a different version than that stored in database store 110. Thus, in various embodiments, database node 120 refreshes in-memory cache 140 to cache the latest metadata document 114 after a refresh period or in response to a transaction request 122.

[0015] To create or update the schema(s) described in the metadata document 114, the client 121 may send a schema request 126 to the database node 120, as shown. The schema request 126 may include a new metadata document 114 used to replace the metadata document stored in the database store 110. The new metadata document 114 may define new database entities (e.g., indexes) and / or update existing database entities described in the previous metadata document 114 (e.g., add a field to a table). In various embodiments, the database node 120 supplements the metadata documents 114 with status information that identifies the status of the database entities described in those metadata documents 114. Thus, in some cases, the client 121 may issue a schema request 126 to determine the status of a particular database entity. The database node 120 may send a schema response 128 to its client 121 that includes an indication of the status of the metadata document 114 or those database entities. The database node 120 may also provide a schema response 128 that identifies the version of the most recent metadata document 114 to enable the client 121 to issue a transaction request 122 that utilizes that metadata document 114 (e.g., by specifying a minimum version). After receiving the new metadata document 114, the database node 120 may execute a schema engine 135 to upgrade the system 100 to comply with the new metadata document 114.

[0016] The schema engine 135, in various embodiments, facilitates the upgrade / migration of a set of records 112 to conform to the metadata document 114. As shown, the schema engine 135 can instantiate a set of upgrade processes 137, which, in various embodiments, walk through and upgrade the records 112 associated with database entities updated or created in a particular metadata document 114. For example, the metadata document 114 may describe a new index on a table, and thus the upgrade process 137 may walk through and process the records 112 of that table to create the new index. As part of processing the records 112, the upgrade process 137 may update the version of that record 112 to match the version of the particular metadata document 114. While the upgrade process 137 is processing the records 112, the database node 120 may continue to service transaction requests 122.

[0017] In various cases, while the upgrade process 137 is processing the records 112, the database node 120 may receive a transaction request 122 to perform an operation on a particular set of records 112. The database node 120 may access those records 112 and determine that one or more of them have not yet been upgraded by the upgrade process 137. In response, the database node 120 may first upgrade the records 112 based on its cached metadata document 114 and then perform the requested operation on those records 112. An example of upgrading the records 112 as part of a read / access request is described with respect to FIG. 3A, and an example of upgrading the records 112 as part of an update / write request is described with respect to FIG. 3B.

[0018] 2, a block diagram of a metadata document 114 is shown. In the illustrated embodiment, metadata document 114 describes database entities 200A-C, a status 205, and a version 210. As shown, database entities 200A-C each include a respective status 205. In some embodiments, metadata document 114 is implemented differently than is shown. For example, database entity 200 may specify version 210.

[0019] A database entity 200, in various embodiments, is a database construct or structure that facilitates the implementation of a database. For example, a database entity 200 may be a table, an index, a package, a procedure, a function, a trigger, a view, a sequence, or a link. A database entity 200 is formally defined in a metadata document 114 and is created and managed based on that formal definition. Thus, in various embodiments, to create or update a database entity 200, the new / updated database entity 200 is described in a metadata document 114 that is submitted to a database node 120 via a schema request 126. The submitted metadata document 114 may replace an existing metadata document 114 in the database store 110. The database node 120 may then perform the update / creation of the appropriate database entity 200. To track the current state of the database entity 200, the database entity 200 may be associated with a status 205, as shown.

[0020] The status 205, in various embodiments, indicates the current state of the entity. Example states may include "creating," "updating," and "ready." The status 205 may be used by the client 121 to determine whether the database entity 200 can be used to process a transaction request 122 from the client 121. For example, the client 121 may submit a metadata document 114 that describes a new view database entity 200 based on a set of tables. While the view database entity 200 is being created, its status 205 may be set to "creating" by the database node 120. Thus, when the client 121 polls the database node 120 (e.g., via a schema request 126) for the status 205, the client 121 may determine that the view database entity 200 is not ready and therefore may not submit a transaction request 122 that utilizes the view database entity 200. Once the client 121 observes that the status 205 is set to “ready,” the client 121 may begin submitting transaction requests 122 that utilize the view database entity 200 .

[0021] In various cases, a database entity 200 may depend on another database entity 200. For example, database entity 200A may correspond to a database table and database entity 200B may correspond to an index built based on that table. Thus, in some embodiments, the status 205 of a database entity 200 may be set in response to a change made to another database entity 200. For example, database entity 200C may correspond to a new index based on database entity 200A's table. While that index is being built, the status 205 of database entity 200A may be set to "pending" to indicate that database entity 200A is in use. This may prevent database entity 200A from being deleted or its structure from being changed. Once its index is ready, the status 205 of database entities 200A and 200C may be set to "ready."

[0022] As shown, the metadata document 114 includes a status 205. This status 205 may indicate whether all database entities 200 are ready or that at least one database entity 200 is still being created or updated. In various embodiments, the database entities 200 are created or updated by the system 100 at least partially in parallel. However, in some embodiments, the database entities 200 are created or updated serially. For example, the metadata document 114 may describe new fields of database entity 200B and new database entity 200C. The database node 120 may update the record 112 of database entity 200B before creating the physical database entity 200C. As a result, some database entities 200 may be ready for use before others, and the status 205 of the metadata document 114 may be used to indicate when all database entities will be ready.

[0023] As further illustrated, the metadata document 114 includes a version 210. The version 210, in various embodiments, identifies a value that indicates the progression of the metadata document 114. Thus, the version 210 of a given metadata document 114 may be used to determine whether the metadata document 114 is an earlier or later version of another metadata document 114. The version 210 may further enable the client 121 to ensure that a particular database entity 200 is available for processing the transaction request 122. For example, the client 121 may specify a minimum schema version in the transaction request 122, and the database node 120 may compare the minimum version to the version 210 of the metadata document 114 cached in the in-memory cache 140.

[0024] 3A, a block diagram is shown in which a database application 130 processes a transaction including a write of a record 112. In the illustrated embodiment, there is a database store 110, a database application 130, and an in-memory cache 140. As shown, the database store 110 includes a record 112A having a version 210A "1.2" and records 112B-D having versions 210B-D "1.1". As further shown, the database application 130 includes a transaction process 320 and a schema engine 135 that implements an upgrade process 137. Also as shown, the in-memory cache 140 includes a metadata document 114. The illustrated embodiment may be implemented differently than illustrated. As an example, there may be a metadata store that also stores the metadata document 114.

[0025] As described, a database node 120 may receive a schema request 126 that specifies a new metadata document 114. In response to receiving that request, in various embodiments, a schema engine 135 instantiates a set of upgrade processes 137 to perform a migration scan 305 on the records 112 that correspond to the changes described in the new metadata document 114. In some cases, all records 112 stored in the database store 110 are scanned as part of the migration scan 305. In some embodiments, the schema engine 135 may wait a period of time before initiating the migration scan 305 so that the in-memory cache 140 can be cleared. The scanned records 112 may be migrated to conform to the schema(s) described in the new metadata document 114.

[0026] As part of the migration scan 305, in some embodiments, the upgrade process 137 performs an "on-disk" migration that accesses the record 112 (of the database entity 200 being upgraded) using metadata corresponding to the version 210 of that record, upgrades the record 112 based on the metadata in the new metadata document 114, and then writes the record 112 back to the database store 110. The read-write round trip may not be atomic, since after the record is read, another concurrent write may occur before the record is written. Thus, in various embodiments, the writeback of the record is conditional on the record not being modified since it was accessed by the upgrade process 137. This condition may relate to attributes not present in the original record.

[0027] In some cases, the set of upgrade processes 137 may miss records 112 that should be upgraded, for example, records 112 may be missed if the database node 120 crashes. To ensure that all relevant records 112 have been upgraded, in some embodiments, the database node 120 creates a set of probing processes that traverse the records 112 and move any records 112 that were not upgraded by the upgrade processes 137 but should have been upgraded. The probing processes may be created periodically or after a migration point is reached (e.g., after completion of a migration scan 305).

[0028] Transaction process 320, in various embodiments, is a computer process executable to provide various database services of database node 120. Transaction process 320 may be instantiated to process transaction requests 122 passed by client 121 through an established database connection. As part of processing a transaction request, transaction process 320 may execute a set of database statements specified in the request. To execute those database statements, in various embodiments, transaction process 320 executes a query execution plan that defines the sequence of steps to be executed to satisfy the database statements. Thus, transaction process 320 may access a definition of the query execution plan (e.g., in database 110), compile it into a form that transaction process 320 can execute, and then execute the compiled form.

[0029] In various cases, while the set of upgrade processes 137 is running the migration scan 305, the database application 130 may receive a transaction request 122 to perform a transaction that includes writing a record 112 to the database entity 200 being created or updated. As a result, in various embodiments, the database application 130 ensures that the record 112 (which may be a new record or an update) conforms to the metadata document 114 in its in-memory cache 140. As described in more detail with respect to FIG. 4, the database node 120 may periodically refresh its in-memory cache 140 to store the latest metadata document 114. If the record 112 being written is a new record, the database node 120 may write the record 112 to the database store 110 according to the cached metadata document 114.

[0030] If the record 112 being written is an update, the transaction process 320 may access the existing record 112. For example, the transaction request 122 may provide an update to record 112C, and thus the transaction process 320 may access record 112C as shown. If the version 210 of the accessed record 112 matches the version of the metadata document 114 cached in the in-memory cache 140, the transaction process 320 writes the updated record 112 to the database store 110. If there is a mismatch between the versions, the transaction process 320 may perform a set of steps to upgrade the existing record 112 to the version of the metadata document 114. For example, if the metadata document 114 adds a field to the database table that contains the accessed record 112, the transaction process 320 may upgrade the record 112 to include a value for that field. In some embodiments, the transaction process 320 writes the upgraded record 112 back to the database store 110 and then retries the request. In other embodiments, transaction process 320 writes the requested updates to the upgraded record 112 and writes the record 112 to database store 110. In various embodiments, transaction process 320 further updates the version of record 112. For example, when record 112C is first accessed, its version 210C may be “1.1” (as it may not yet have been upgraded by the set of upgrade processes 137), but the version of the cached metadata document 114 may be “1.2.” Thus, transaction process 320 may upgrade record 112C to version “1.2” and then perform the requested operation on the upgraded record 112C.

[0031] Other database operations that are conditional (e.g., delete record 112 if its property "foo" value is equal to "blah") may include upgrading record 112 before performing the database operation. As an example, metadata document 114 may add a field "foo" to a database table, and database application 130 may receive a request to delete any record 112 in that database table where the value of "foo" is "blah". If the record 112 has not been upgraded to have a value for that field, in various embodiments, database application 130 upgrades record 112 to have a value for that field so that the delete operation can be performed. A replace operation that replaces a particular record 112 with another record 112 is another example of a database operation that may be conditional and therefore may include upgrading record 112. In some embodiments, if the requested operation is not conditional, database application 130 may perform the requested operation without upgrading the associated record 112. Instead, a set of upgrade processes 137 may upgrade record 112 as it arrives at it during migration scan 305.

[0032] 3B, a block diagram is shown of a database application 130 processing a transaction including returning record 112. In the illustrated embodiment, there is a database store 110, a database application 130, and an in-memory cache 140. As shown, the database store 110 includes record 112A having version 210A “1.2” and records 112B-D having versions 210B-D “1.1”. As further shown, the database application 130 includes a transaction process 320 and a schema engine 135 implementing an upgrade process 137. Also as shown, the in-memory cache 140 includes metadata document 114. The illustrated embodiment may be implemented differently than illustrated. As an example, there may be a metadata store that also stores metadata document 114.

[0033] In some cases, the database application 130 receives a transaction request 122 that returns one or more records 112 stored in the database store 110. Similar to writing the record 112, the transaction process 320 may access the record 112, determine whether its version 210 is the same as the version of the cached metadata document 114, and then upgrade the record 112 (if applicable) before returning the record 112 to the requestor. Instead of performing an "on-disk" migration, in various embodiments, the transaction process 320 performs an "in-memory" migration in which the record 112 is upgraded but is not written back to the database store 110. For example, the record 112C may be accessed and upgraded in the database application 130 to conform to the cached metadata document 114, but may not be written to the database store 110; rather, a set of upgrade processes 137 may perform an on-disk migration in which the record 112C is upgraded and written to the database store 110. However, in some embodiments, the transaction process 320 may upgrade the record 112 , return it to the requestor (eg, via the transaction response 124 ), and then write it to the database store 110 .

[0034] 4, a block diagram of a database node 120 refreshing its in-memory cache 140 to store an updated metadata document 114 is shown. In the illustrated embodiment, there are two database nodes 120A-B and a database store 110. As shown, both database nodes 120A-B initially cache a metadata document 114A having a version 210A "1.1", and the database store 110 stores a metadata document 114B having a version 210B "1.2". As further shown, the database store 110 stores a record 112 having a version 210 "1.1". The illustrated embodiment may be implemented differently than that shown. For example, there may not be two database nodes 120A-B.

[0035] As described, in some embodiments, the database node 120 may receive a schema request 126 that includes an updated metadata document 114. However, in various embodiments, a metadata endpoint is provided to which the updated metadata document 114 may be submitted and stored by a metadata server (not shown). As a result, the metadata document 114 cached in the database node 120 may temporarily be an older version than the metadata document 114 stored in the database store 110. As described above, the database node 120 may process the transaction request 122 according to the metadata document 114 in its in-memory cache 140. As a result, the transaction request 122 may be processed according to the metadata document 114 associated with the older version.

[0036] In various embodiments, to ensure that database node 120 uses at least a particular version, clients 121 can specify a minimum schema version in their transaction requests 122. As shown, for example, transaction request 122A specifies a minimum schema version of "1.1." Because metadata document 114A has version 210A "1.1," database node 120A may process transaction request 122A using metadata document 114A instead of refreshing its in-memory cache 140. Thus, if transaction request 122A attempts to access record 112 as shown, database node 120A may access record 112, determine that its version 210 matches the version of metadata document 114A, and return record 112 without upgrading record 112. In contrast to transaction request 122A, transaction request 122B specifies a minimum version of "1.2." Because the metadata document 114A stored in database node 120B is smaller than the minimum version, database node 120B accesses metadata document 114B and replaces metadata document 114A with metadata document 114B in its in-memory cache 140.

[0037] Database node 120B may then process transaction request 122B. If transaction request 122B attempts to access record 112, database node 120B may access record 112, determine that its version 210 differs from the version of metadata document 114B, and upgrade record 112 to version "1.2". Database node 120B may then return upgraded record 112 to the requester and / or write the record 112 back to database store 110. Thus, client 121 may force database node 120 to use at least the minimum metadata document version. To determine the latest metadata document version, in various embodiments, client 121 issues a schema request 126 to database node 120 or a metadata server to access the latest metadata document 114. The metadata document 114 may be returned to the client 121, which may extract a version 210 of the metadata document 114 and then include that version 210 in a subsequent transaction request 122 to the database node 120.

[0038] 5, a flow diagram of a method 500 is shown. Method 500 is one embodiment of a method performed by a computer system (e.g., system 100) in which a set of records (e.g., records 112) are upgraded as part of processing a transaction. Method 500 may be performed by executing a set of program instructions stored on a non-transitory computer-readable medium. In some embodiments, method 500 includes more or fewer steps than are illustrated. For example, method 500 may include a step in which the computer system writes the upgraded records to a database (e.g., database store 110).

[0039] Method 500 begins at step 510 with a computer system receiving (e.g., from a client 121) a metadata document (e.g., metadata document 114) that describes an updated schema for a database that stores a plurality of records. The updated schema may describe a set of database entities (e.g., database entities 200) and a corresponding set of statuses (e.g., statuses 205). A status of the set of statuses, in various embodiments, indicates whether the corresponding entity is available to process a request (e.g., transaction request 122). In response to receiving a status request (e.g., schema request 126) from a client (e.g., client 121) for a status of a particular one of the set of database entities, the computer system may return a response (e.g., schema response 128) that indicates the status of the particular database entity. In various embodiments, the client is operable to use the response to determine whether the particular database entity is available to process a request from the client.

[0040] In step 520, the computer system instantiates a set of processes (e.g., upgrade process 137) to execute an upgrade routine to upgrade a plurality of records to conform to the updated schema. The updated schema may describe a set of updates to a set of database entities, and a first database entity in the set of database entities may be migrated before a second database entity in the set of database entities such that the first database entity is available to process requests before the second database entity is available.

[0041] At step 530, while the set of processes is upgrading the multiple records, the computer system receives a request to perform an operation on one of the multiple records (e.g., transaction request 122). The request may specify multiple operations and / or multiple records. In some embodiments, the request specifies a minimum schema version to be used in processing the received request. The computer system may detect that a schema stored in the computer system's memory (e.g., in-memory cache 140) does not meet the minimum schema version. As such, the computer system may replace the stored schema in memory with the updated schema.

[0042] In step 540, the computer system detects that the record corresponds to a schema version earlier than the updated schema version of the metadata document. In step 550, the computer system upgrades the record to conform to the updated schema. In some cases, one of the set of database entities may be an index, and the computer system may update, in the metadata document, the status of the table on which the index is based. The updated status of the table may prevent the table from being deleted while the index is being created. In some cases, the updated schema may describe an index that was not described in the previous schema version. Thus, upgrading the record to conform to the updated schema may include populating the index with an entry for the record, and updating the version of the record (e.g., version 210) to match the updated schema version after populating the index with the entry.

[0043] In step 560, after upgrading the record, the computer system performs the requested operation on the record. In some cases, the record may be returned to the issuer of the request without being upgraded and stored in the database. As such, the record may then be upgraded by one of a set of processes and stored in the database. After the set of processes completes the upgrade routine, in some embodiments, the computer system may instantiate a set of review processes to determine whether all of the multiple records have been upgraded to comply with the updated schema.

[0044] 6, a flow diagram of a method 600 is shown. Method 600 is one embodiment of a method performed by a computer system (e.g., system 100) in which a set of records (e.g., records 112) are upgraded as part of processing a transaction. Method 600 may be performed by executing a set of program instructions stored on a non-transitory computer-readable medium. In some embodiments, method 600 includes more or fewer steps than are illustrated. For example, method 600 may include a step in which the computer system writes the upgraded records to a database (e.g., database store 110).

[0045] Method 600 begins at step 610 with a computer system receiving a metadata document (e.g., metadata document 114) that describes an updated schema for a database that stores a plurality of records. In various embodiments, the computer system instantiates a set of processes (e.g., upgrade process 137) to execute an upgrade routine to upgrade the plurality of records to conform to the updated schema. The updated schema may describe a set of database entities (e.g., database entity 200) and a corresponding set of statuses (e.g., status 205). For one of the set of database entities, the computer system may set the database entity status to indicate that the database entity is being upgraded. In some embodiments, the status is observable by a client operable to issue database requests to the system.

[0046] In step 620, the computer system receives a request to perform an operation on one of a plurality of records (e.g., transaction request 122). The request may specify a minimum schema version, and the computer system may determine that the version of the schema cached in the system's cache (e.g., in-memory 140) is less than the minimum schema version, and may then replace the cached schema with the updated schema in the cache.

[0047] In step 630, the computer system detects that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document. In step 640, the computer system upgrades the record to conform to the updated schema. In some cases, the updated schema adds additional fields to a database table in the database. The record may correspond to a table, and thus updating the record may include modifying the record to include values ​​for the additional fields and updating the version of the record (e.g., version 210) to match the updated schema version.

[0048] In step 650, after upgrading the record, the computer system performs the requested operation on the record. In some cases, performing the requested operation includes deleting the upgraded record from the database. The computer system may receive another request to perform an operation on a different record of the plurality of records. The other request may not specify a minimum schema version. Before refreshing its cache with the updated schema, the computer system may perform the other requested operation on the different record without upgrading the different record, which may correspond to a schema version earlier than the updated schema version.

[0049] Exemplary Multitenant Database System Referring now to FIG. 7, an exemplary multi-tenant database system (MTS) 700 is shown in which various techniques of the present disclosure can be implemented; for example, the system 100 can be the MTS 700. In FIG. 7, the MTS 700 includes a database platform 710, an application platform 720, and a network interface 730 connected to a network 740. Also shown, the database platform 710 includes a data storage 712 and a set of database servers 714A-N that interact with the data storage 712, and the application platform 720 includes a set of application servers 722A-N with respective environments 724. In the illustrated embodiment, the MTS 700 is connected to various user systems 750A-N via the network 740. The disclosed multi-tenant system is included for illustrative purposes and is not intended to limit the scope of the present disclosure. In other embodiments, the techniques of the present disclosure are implemented in a non-multi-tenant environment, such as a client / server environment, a cloud computing environment, a clustered computer, or the like.

[0050] The MTS 700, in various embodiments, is a set of computer systems that together provide various services to users (alternatively referred to as "tenants") that interact with the MTS 700. In some embodiments, the MTS 700 implements a customer relationship management (CRM) system that provides a mechanism for tenants (e.g., businesses, government agencies, etc.) to manage relationships and interactions with customers and potential customers. For example, the MTS 700 may enable tenants to store customer contact information (e.g., customer websites, email addresses, phone numbers, and social media data), identify sales opportunities, record service issues, and manage marketing campaigns. Additionally, the MTS 700 may enable these tenants to identify how they communicated with customers, what customers purchased, when they last purchased an item, and how much they paid. To provide the services of the CRM system and / or other services, as shown, the MTS 700 includes a database platform 710 and an application platform 720.

[0051] The database platform 710, in various embodiments, is a combination of software routines and hardware elements that implement database services for storing and managing data of the MTS 700, including tenant data. As shown, the database platform 710 includes a data storage 712, which in various embodiments includes a set of storage devices (e.g., solid state drives, hard disk drives, etc.) connected to each other over a network (e.g., a storage attached network (SAN)) and configured to store data redundantly to prevent data loss. In various embodiments, the data storage 712 is used to implement a database (e.g., database store 110) that includes a collection of information organized in a manner that allows the information to be accessed, stored, and manipulated. The data storage 712 may implement a single database, a distributed database, a collection of distributed databases, a database with redundant online or offline backups or other redundancies, etc. As part of implementing a database, the data storage 712 may store files that include one or more database records with their respective data payloads (e.g., values ​​of fields of a database table) and metadata (e.g., key values, timestamps, table identifiers for tables associated with the records, tenant identifiers for tenants associated with the records, etc.).

[0052] In various embodiments, a database record may correspond to a row in a table. A table typically includes one or more data categories logically arranged as columns or fields in a viewable schema. Thus, each record in a table may include an instance of data in each category defined by a field. For example, a database may include a table that describes customers with fields of basic contact information such as name, address, phone number, fax number, etc. Thus, a record in that table may include a value for each of the fields in the table (e.g., name for a name field). Another table may describe a purchase order that includes fields of information such as customer, product, sale price, date, etc. In various embodiments, standard entity tables such as tables for account, contact, lead, and opportunity data are provided for use by all tenants, each including predefined fields. The MTS 700 may store database records for one or more tenants in the same table. That is, tenants may share tables. Thus, in various embodiments, a database record includes a tenant identifier that indicates the owner of the database record. As a result, one tenant's data is kept secure and isolated from other tenants' data, so that one tenant cannot access another tenant's data unless the data is explicitly shared.

[0053] In some embodiments, data stored in data storage 712 is organized as part of a log-structured merge tree (LSM tree). An LSM tree typically includes two high-level components: an in-memory buffer and persistent storage. During operation, database server 714 may first write database records to a local in-memory buffer and then flush these records to persistent storage (e.g., data storage 712). As part of flushing the database records, database server 714 may write the database records to a new file contained in the "top" level of the LSM tree. Over time, the database records may be rewritten by database server 714 to new files contained in lower levels as the database records move down the levels of the LSM tree. In various implementations, as database records age and are moved down the LSM tree, they are moved to slower and slower storage devices in data storage 712 (e.g., from solid-state drives to hard disk drives).

[0054] When the database server 714 wants to access a database record for a particular key, the database server 714 may traverse different levels of the LSM tree for files that potentially contain database records for that particular key. Once the database server 714 determines that a file may contain related database records, the database server 714 may fetch the file from the data storage 712 into the memory of the database server 714. The database server 714 may then check the fetched file for database records with the particular key. In various embodiments, database records are immutable once written to the data storage 712. Thus, if the database server 714 wants to modify a value in a row of a table (which may be identified from an accessed database record), the database server 714 writes out a new database record to the top level of the LSM tree. Over time, the database records are merged down the levels of the LSM tree. Thus, the LSM tree may store various database records for a database key, with older database records for that key located at lower levels of the LSM tree than newer database records.

[0055] The database server 714, in various embodiments, is a hardware element, software routine, or combination thereof capable of providing database services such as data storage, data retrieval, and / or data manipulation. The database server 714 may correspond to a database node 120. Such database services may be provided by the database server 714 to components within the MTS 700 (e.g., application server 722) and components external to the MTS 700. As an example, the database server 714 may receive a database transaction request from the application server 722 requesting to write or read data to the data storage 712. The database transaction request may specify an SQL SELECT command to select one or more rows from one or more database tables. The contents of the row may be defined in a database record, and thus the database server 714 may locate and return one or more database records corresponding to the selected table row or rows. In various cases, the database transaction request may instruct the database server 714 to write one or more database records for an LSM tree, which the database server 714 maintains implemented on the database platform 710. In some embodiments, the database servers 714 implement a relational database management system (RDMS) or an object-oriented database management system (OODBMS) that facilitates the storage and retrieval of information from the data storage 712. In various cases, the database servers 714 may communicate with each other to facilitate the processing of transactions. For example, database server 714A communicates with database server 714N to determine whether database server 714N has written a database record for a particular key to its in-memory buffer.

[0056] The application platform 720, in various embodiments, is a combination of software routines and hardware elements that implements and executes the CRM software application, as well as providing associated data, code, forms, web pages, and other information to and from the user systems 750, and storing associated data, objects, web page content, and other tenant information via the database platform 710. To facilitate these services, in various embodiments, the application platform 720 communicates with the database platform 710 to store, access, and manipulate data. In some instances, the application platform 720 may communicate with the database platform 710 via different network connections. For example, one application server 722 may be coupled via a local area network and another application server 722 may be coupled via a direct network link. TCP / IP (Transfer Control Protocol and Internet Protocol) is an exemplary protocol for communicating between the application platform 720 and the database platform 710, although it will be apparent to one skilled in the art that other transport protocols may be used depending on the network interconnect used.

[0057] The application server 722 is a hardware element, software routine, or combination thereof capable of providing the services of the application platform 720, including, in various embodiments, processing requests received from tenants of the MTS 700. The application server 722 may, in various embodiments, generate environments 724 that can be used for various purposes, such as providing functionality for developers to develop, execute, and manage applications (e.g., business logic). Data may be transferred to an environment 724 from another environment 724 and / or the database platform 710. In some cases, an environment 724 cannot access such data from other environments 724 unless such data is explicitly shared. In some embodiments, multiple environments 724 may be associated with a single tenant.

[0058] The application platform 720 may provide access to a number of different hosted (standard and / or custom) applications to the user systems 750, including a CRM application and / or applications developed by tenants. In various embodiments, the application platform 720 may manage the creation of applications, the testing of applications, the storage of applications in database objects in the data storage 712, the execution of applications in the environment 724 (e.g., virtual machines in the process space), or any combination thereof. In some embodiments, the application platform 720 may add and remove application servers 722 from the server pool at any time for any reason, and there may be no server affinity of a user and / or organization to a particular application server 722. In some embodiments, an interface system (not shown) that implements load balancing functionality (e.g., an F5 Big-IP load balancer) sits between the application servers 722 and the user systems 750 and is configured to allocate requests to the application servers 722. In some embodiments, the load balancer routes user requests to the application servers 722 using a least connection algorithm. Other examples of load balancing algorithms such as round robin and observed response time may also be used. For example, in certain embodiments, three consecutive requests from the same user may hit three different servers 722 and three requests from different users may hit the same server 722.

[0059] In some embodiments, MTS 700 provides security mechanisms, such as encryption, to keep each tenant's data separate unless the data is shared. When more than one server 714 or 722 is used, they may be located in close proximity to one another (e.g., in a server farm located in a single building or campus) or distributed at distances from one another (e.g., one or more servers 714 located in city A and one or more servers 722 located in city B). Thus, MTS 700 may include one or more logically and / or physically connected servers, either locally or distributed across one or more geographic locations.

[0060] One or more users (e.g., via user systems 750) may interact with the MTS 700 over the network 740. The user systems 750 may correspond to, for example, a tenant of the MTS 700, a provider of the MTS 700 (e.g., an administrator), or a third party. Each user system 750 may be a desktop personal computer, a workstation, a laptop, a PDA, a mobile phone, or any wireless access protocol (WAP)-enabled device, or any other computing device capable of interfacing directly or indirectly to the Internet or other network connection. The user systems 750 may include dedicated hardware configured to interface with the MTS 700 over the network 740. The user systems 750 may execute a graphical user interface (GUI) corresponding to the MTS 700, an HTTP client (e.g., a browsing program such as Microsoft's Internet Explorer browser, Netscape's Navigator browser, Opera browser, or a WAP-enabled browser in the case of a mobile phone, PDA, or other wireless device), or both, to enable users of the user systems 750 (e.g., subscribers to the CRM system) to access, process, and view information and pages available from the MTS 700 over the network 740. Each user system 750 may include one or more user interface devices, such as a keyboard, mouse, touch screen, pen, etc., for interacting with a graphical user interface (GUI) provided by a browser on a display monitor screen, LCD display, etc., along with pages, forms, and other information provided by the MTS 700 or other systems or servers. As discussed above, the disclosed embodiments are suitable for use with the Internet, which refers to a particular global internetwork of networks.However, it should be understood that other networks may be used in place of the Internet, such as an intranet, an extranet, a virtual private network (VPN), a non-TCP / IP based network, any LAN or WAN, etc.

[0061] Because users of user systems 750 may be users of different capabilities, the capabilities of a particular user system 750 may be determined by one or more permission levels associated with the current user. For example, if a salesperson is using a particular user system 750 to interact with the MTS 700, the user system 750 may have the capabilities (e.g., user privileges) assigned to the salesperson. However, if an administrator is using the same user system 750 to interact with the MTS 700, the user system 750 may have the capabilities (e.g., administrative privileges) assigned to the administrator. In a system with a hierarchical role model, a user with a certain permission level may access applications, data, and database information accessible to users with lower permission levels, but may not access certain applications, database information, and data accessible to users with higher permission levels. Thus, different users may have different capabilities with respect to accessing and modifying application and database information depending on the user's security or permission level. Some data structures managed by the MTS 700 are allocated at the tenant level, while others are managed at the user level.

[0062] In some embodiments, the user system 750 and its components are configurable using an application, such as a browser, that includes computer code executable on one or more processing elements. Similarly, in some embodiments, the MTS 700 (and additional instances of the MTS, if there is more than one) and their components are operator configurable using application(s) that include computer code executable on the processing elements. Thus, various operations described herein may be implemented by executing program instructions that are stored on a non-transitory computer-readable medium and executed by the processing elements. The program instructions may be stored on a non-volatile medium, such as a hard disk, or other volatile or non-volatile memory medium or device, such as a ROM or RAM, as is well known, or may be provided on any medium capable of initiating program code, such as a compact disc (CD) medium, a digital versatile disc (DVD) medium, a floppy disk, or the like. Additionally, the entire program code or portions thereof may be transmitted and downloaded from a software source, for example, via the Internet or from another server, as is well known, or may be transmitted over any other conventional network connection, as is well known, (e.g., extranet, VPN, LAN, etc.), using any communication medium and protocol, as is well known, (e.g., TCP / IP, HTTP, HTTPS, Ethernet, etc.) as is well known. It will also be understood that computer code for implementing aspects of the disclosed embodiments may be implemented in any programming language that can be executed on a server or server system, for example, C, C++, HTML, Java, JavaScript, or any other scripting language, such as VBScript.

[0063] Network 740 may be a local area network (LAN), a wide area network (WAN), a wireless network, a point-to-point network, a star network, a token ring network, a hubbed network, or any other suitable configuration. The global internetwork of networks is often referred to as the "Internet" with a capital "I" and is an example of a Transfer Control Protocol and Internet Protocol (TCP / IP) network. However, it should be understood that the disclosed embodiments may utilize any of a variety of other types of networks.

[0064] The user system 750 may communicate with the MTS 700 using TCP / IP, and at higher network levels, using other common Internet protocols such as HTTP, FTP, AFS, WAP, etc. For example, if HTTP is used, the user system 750 may include an HTTP client, commonly referred to as a "browser," for sending and receiving HTTP messages from an HTTP server in the MTS 700. Such a server may be implemented as the only network interface between the MTS 700 and the network 740, although other techniques may be used as well or instead. In some implementations, the interface between the MTS 700 and the network 740 includes a load-sharing function, such as a round-robin HTTP request distributor, to balance the load and distribute incoming HTTP requests evenly across multiple servers.

[0065] In various embodiments, the user system 750 communicates with the application server 722 to request and update system-level and tenant-level data from the MTS 700, which may require one or more queries to the data storage 712. In some embodiments, the MTS 700 automatically generates one or more SQL statements (SQL queries) designed to access the desired information. In some cases, the user system 750 may generate a request having a specific format that corresponds to at least a portion of the MTS 700. As an example, the user system 750 may request that a data object be moved to a particular environment 724 using an object notation that describes the object-relational mapping (e.g., JavaScript object notation mapping) of a number of specified objects.

[0066] Exemplary Computer System 8, there is shown a block diagram of an exemplary computer system 800 upon which system 100, database 110, database node 120, MTS 700, and / or user system 750 may be implemented. Computer system 800 includes a processor subsystem 880 coupled to system memory 820 and I / O interface(s) 840 via an interconnect 860 (e.g., a system bus). I / O interface(s) 840 are coupled to one or more I / O devices 850. For convenience, while a single computer system 800 is shown in FIG. 8, system 800 may be implemented as two or more computer systems operating together.

[0067] Processor subsystem 880 may include one or more processors or processing units. In various embodiments of computer system 800, multiple instances of processor subsystem 880 may be coupled to interconnect 860. In various embodiments, processor subsystem 880 (or each processor unit within 880) may include a cache or other form of on-board memory.

[0068] The system memory 820 can be used to store program instructions executable by the processor subsystem 880 to cause the system 800 to perform various operations described herein. The system memory 820 can be implemented using different physical memory media, such as hard disk storage, floppy disk storage, removable disk storage, flash memory, random access memory (RAM-SRAM, EDO RAM, SDRAM, DDR SDRAM, RAMBUS RAM, etc.), read-only memory (PROM, EEPROM, etc.). The memory in the computer system 800 is not limited to primary storage, such as the memory 820. Rather, the computer system 800 can also include other forms of storage, such as cache memory in the processor subsystem 880 and secondary storage on the I / O devices 850 (e.g., hard drives, storage arrays, etc.). In some embodiments, these other forms of storage can also store program instructions executable by the processor subsystem 880. In some embodiments, the program instructions that, when executed, implement the database application 130 can be included / stored in the system memory 820.

[0069] I / O interface 840 may be any of a variety of types of interfaces configured to couple to and communicate with other devices, according to various embodiments. In one embodiment, I / O interface 840 is a bridge chip (e.g., a southbridge) from a frontside to one or more backside buses. I / O interface 840 may be coupled to one or more I / O devices 850 via one or more corresponding buses or other interfaces. Examples of I / O devices 850 include storage devices (hard drives, optical drives, removable flash drives, storage arrays, SANs, or their associated controllers), network interface devices (e.g., to a local or wide area network), or other devices (e.g., graphics, user interface devices, etc.). In one embodiment, computer system 800 is coupled to a network via network interface device 850 (e.g., configured to communicate via WiFi, Bluetooth, Ethernet, etc.).

[0070] Implementations of the subject matter of this application include, but are not limited to, Examples 1-20 below. <1> 1. A method comprising: receiving, by a computer system, a metadata document describing an updated schema of a database storing a plurality of records; instantiating, by the computer system, a set of processes for executing an upgrade routine for upgrading a plurality of records to conform to the updated schema; While a set of processes is upgrading multiple records, the computer system: receiving a request to perform an operation on one of a plurality of records; detecting that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document; upgrading the records to conform to the updated schema; Steps to perform the required action on the record after upgrading it; The method includes: <2> The method of example 1, wherein the updated schema describes a set of database entities and a corresponding set of states, where a status of the set of states indicates whether a corresponding entity is available to process a request. <3> In response to receiving a status request from a client for a status of a particular database entity of the set of database entities, the computer system returns a response indicating the status of the particular database entity, the client being operable to use the response to determine whether the particular database entity is available to process requests from the client. The method of Example 2, further comprising: <4> One of the set of database entities is an index, and the method comprises: updating, by the computer system, in the metadata document, a status of the table on which the index is based, the updated status of the table preventing the table from being deleted while the index is being created; The method of Example 2, further comprising: <5> The updated schema describes indexes that were not described in the previous schema version, and the step of upgrading records to conform to the updated schema is populating an index with entries for the record; After populating the index with entries, update the record version to match the updated schema version. The method of example 1, <6> The request specifies a minimum schema version that should be used in processing the received request, and the method comprises: detecting, by the computer system, that a schema stored in a memory of the computer system does not meet a minimum schema version; replacing in memory the stored schema with the updated schema; The method of example 1, further comprising: <7> The method of Example 1, wherein the updated schema describes a set of updates to the set of database entities, and a first database entity in the set of database entities is migrated before a second database entity in the set of database entities such that the first database entity is available before the second database entity. <8> The method of Example 1, wherein the record is returned to the issuer of the request without being upgraded and stored in a database, and the record is subsequently upgraded by one of a set of processes and stored in a database. <9> After the set of processes executes the upgrade routine, the computer system instantiates a set of review processes to determine whether all of the plurality of records have been upgraded to conform to the updated schema. The method of example 1, further comprising: <10> A non-transitory computer readable medium having stored thereon program instructions executable by a computer system to cause the computer system to perform operations, the operations comprising: receiving a metadata document describing an updated schema of a database storing a plurality of records; instantiating a set of processes for executing an upgrade routine to upgrade the plurality of records to conform to the updated schema; Receiving a request to perform an operation on one of a plurality of records; Detecting that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document; Upgrading the records to conform to the updated schema; and After upgrading the record, perform the requested action on the record. Including, media. <11> The request specifies the minimum schema version that should be used when processing the received request, and the action is Detecting that a cached schema in an in-memory cache of a computer system does not meet a minimum schema version; Replacing the cached schema with an updated schema in the in-memory cache The medium of Example 10, further comprising: <12> The operation is receiving another request to perform an operation on a different record of the plurality of records, where the other request does not specify a minimum schema version; performing operations of the different requests on the different records without upgrading the different records, the different records corresponding to a schema version earlier than the updated schema version; The medium of Example 10, further comprising: <13> The medium of example 10, wherein performing the requested action includes deleting the upgraded record from the database. <14> The operation is maintaining status information identifying a status of the database entities described in the updated schema; In response to upgrading the record associated with the database entity, updating a status to indicate that the database entity is available to process requests. The medium of Example 10, further comprising: <15> The operation is instantiating a set of review processes to determine whether any of the plurality of records have been upgraded to conform to the updated schema after the set of processes has performed the upgrade routine. The medium of Example 10, further comprising: <16> 1. A system comprising: At least one processor; a memory storing program instructions executable by at least one process to cause the system to perform an operation; The operation includes: receiving a metadata document describing an updated schema for a database storing a plurality of records; Receiving a request to perform an operation on one of a plurality of records; Detecting that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document; Upgrading the records to conform to the updated schema; and After upgrading the record, perform the requested action on the record. Including, the system. <17> The request specifies a minimum schema version and the behavior is determining that a version of a schema of a database cached in a system cache is less than a minimum schema version; In the cache, replacing the cached schema with the updated schema The system of Example 16, further comprising: <18> The updated schema adds additional fields to the database tables, records correspond to the tables, and updating the records is Modifying the record to include values ​​for the additional fields; and Update the record version to match the updated schema version The system of Example 16, <19> The updated schema describes a set of database entities and a corresponding set of states and behaviors: For one of a set of database entities, setting a status of the database entity to indicate that the database entity has been upgraded, the status being observable by a client operable to issue database requests to the system. The system of Example 16, further comprising: <20> The operation is instantiating a set of processes to execute an upgrade routine to upgrade the plurality of records to conform to the updated schema. The system of Example 16, further comprising:

[0071] The present disclosure includes references to "embodiments" that are non-limiting implementations of the disclosed concepts. References to "embodiments," "one embodiment," "particular embodiments," "some embodiments," "various embodiments," etc. do not necessarily refer to the same embodiment. Numerous possible embodiments are contemplated, including the specific embodiments described in detail, as well as modifications or alternatives that fall within the spirit or scope of the present disclosure. Not all embodiments necessarily exhibit any or all of the potential advantages described herein.

[0072] This disclosure may describe potential advantages that may result from the disclosed embodiments. All implementations of these embodiments do not necessarily manifest any or all of the potential advantages. Whether advantages are realized for a particular implementation depends on many factors, some of which are outside the scope of this disclosure. Indeed, there are several reasons why an implementation within the scope of the claims may not exhibit some or all of the disclosed advantages. For example, a particular implementation may include other circuitry outside the scope of this disclosure that nullifies or reduces one or more of the disclosed advantages along with one of the disclosed embodiments. Furthermore, suboptimal design execution of a particular implementation (e.g., implementation technique or tool) may also nullify or reduce the disclosed advantages. Even assuming skilled implementation, realization of advantages may still depend on other factors, such as the environmental conditions in which the implementation is deployed. For example, inputs provided to a particular implementation may prevent one or more problems addressed in this disclosure from occurring in a particular case, such that the benefits of the solution may not be realized. Given the existence of possible factors external to this disclosure, it is expressly intended that any potential advantages described herein should not be construed as limitations on the scope of the claims that must be met in order to demonstrate infringement. Rather, the identification of such potential advantages is intended to illustrate the type(s) of improvement available to a designer having the benefit of this disclosure. The permissive description of such advantages (e.g., stating that a particular advantage "may result") is not intended to convey doubt as to whether such advantages may actually be realized, but rather to acknowledge the technological reality that realization of such advantages often depends on additional factors.

[0073] Unless otherwise stated, the embodiments are non-limiting. That is, the disclosed embodiments are not intended to limit the scope of the claims that are drafted based on this disclosure, even if only a single example is described for a particular feature. The disclosed embodiments are intended to be illustrative rather than restrictive, and there is no statement to the contrary in this disclosure. Thus, the application is intended to enable claims that cover the disclosed embodiments, as well as such alternatives, modifications, and equivalents that would be apparent to one skilled in the art having the benefit of this disclosure.

[0074] For example, features in the present application may be combined in any suitable manner. Accordingly, during prosecution of this application (or an application claiming priority thereto), new claims may be formulated for any such combination of features. In particular, with reference to the appended claims, features from a dependent claim may be combined, as appropriate, with features of other dependent claims, including claims that are dependent on other independent claims. Similarly, features from each independent claim may be combined, as appropriate, with features of other dependent claims.

[0075] Thus, the accompanying dependent claims may be drafted so that each is dependent on a single other claim, although additional dependencies are also contemplated. Any combination of features in the dependent claims consistent with this disclosure is contemplated and may be claimed in this or another application. In short, combinations are not limited to those specifically recited in the accompanying claims.

[0076] Where appropriate, it is also contemplated that a claim drafted in one form or statutory type (e.g., apparatus) is intended to support a corresponding claim in another form or statutory type (e.g., method).

[0077] Because this disclosure is a legal document, various terms and expressions may be subject to administrative and judicial interpretation. Notice is hereby given that the definitions provided in the following paragraphs and throughout this disclosure should be used in determining how to interpret the claims drafted based on this disclosure.

[0078] Reference to the singular form of an item (i.e., a noun or noun phrase preceded by "a," "an," or "the") is intended to mean "one or more" unless the context clearly dictates otherwise. Thus, a reference to "an item" in a claim does not exclude additional instances of that item absent attendant context. A "plurality" of an item refers to a set of two or more items.

[0079] The words "may" are used herein in a permissive sense (i.e., having the possibility, being able to) rather than a mandatory sense (i.e., must).

[0080] The terms "comprising" and "including" and their forms are open ended and mean "including, but not limited to."

[0081] When the term "or" is used in this disclosure in reference to a list of alternatives, it will generally be understood to be used in an inclusive sense unless the context dictates otherwise. Thus, the statement "x or y" is equivalent to "x or y, or both," and thus covers 1) x but not y, 2) y but not x, and 3) both x and y. On the other hand, a phrase such as "either x or y, but not both" makes it clear that "or" is used in an exclusive sense.

[0082] The phrases "w, x, y, or z, or any combination thereof" or "at least one of ... w, x, y, and z" are intended to cover all possibilities, including a single element, up to the total number of elements in the set. For example, given the set [w,x,y,z], these phrases cover any single element of the set (e.g., w but not x, y, or z), any two elements (e.g., w and x but not y or z), any three elements (e.g., w, x, and y but not z), and all four elements. Thus, the phrase "at least one of ... w, x, y, and z" refers to at least one element of the set [w,x,y,z], thereby covering all possible combinations in this list of elements. This phrase should not be construed as requiring that there be at least one instance of w, at least one instance of x, at least one instance of y, and at least one instance of z.

[0083] In this disclosure, various "labels" may precede nouns or noun phrases. Unless the context dictates otherwise, different labels used for a feature (e.g., "first circuit," "second circuit," "particular circuit," "given circuit," etc.) refer to different instances of the feature. Additionally, the labels "first," "second," and "third," when applied to features, do not imply any type of ordering (e.g., spatial, temporal, logical, etc.) unless otherwise stated.

[0084] The phrase "based on" is used to describe one or more factors that influence the decision. This term does not exclude the possibility that additional factors may influence the decision. That is, the decision may be based only on the specified factors, or it may be based on the specified factors as well as other unspecified factors. Consider the phrase "determining A based on B." This phrase specifies that B is a factor that is used to determine A or that influences the decision of A. This phrase does not exclude that the decision of A may be based on some other factor, such as C. This phrase is also intended to cover embodiments in which A is determined solely based on B. As used herein, the phrase "based on" is synonymous with the phrase "based at least in part on."

[0085] The phrases "in response to" and "responsive to" describe one or more factors that cause an effect. The phrases do not exclude the possibility that additional factors may affect or otherwise induce the effect, either in conjunction with or independently of the specified factors. That is, the effect may be in response to these factors alone, or to the specified factors and other unspecified factors. Consider the phrase "performing A in response to B." The phrase specifies that B is the factor that triggers the execution of A or triggers a particular outcome of A. The phrase does not exclude that performing A may be in response to some other factor, such as C. The phrase also does not exclude that performing A may be in response to B and C jointly. The phrase is also intended to cover embodiments in which A is performed in response to B alone. As used herein, the phrase "in response to" is synonymous with the phrase "at least partially in response to." Similarly, the phrase "in response to" is synonymous with the phrase "at least partially in response to."

[0086] Within this disclosure, different entities (which may be variously referred to as "units," "circuits," other components, etc.) may be described or claimed as being "configured" to perform one or more tasks or operations. This formulation - an "entity" configured to perform one or more tasks - is used herein to refer to a structure (i.e., something physical). More specifically, this formulation is used to indicate that this structure is configured to perform one or more tasks during operation. A structure may be said to be "configured" to perform some task even if the structure is not currently operating. Thus, an entity described or listed as being "configured" to perform some task refers to something physical, such as a device, a circuit, a system having a memory and a processor unit that stores program instructions executable to perform the task. This expression is not used herein to refer to something intangible.

[0087] In some cases, various units / circuits / components may be described herein as performing a set of tasks or operations, and it will be understood that those entities are "configured to" perform those tasks / operations, even if not specifically mentioned.

[0088] The term "configured to" does not mean "configurable to." For example, an unprogrammed FPGA is not considered to be "configured to" perform a particular function. However, this unprogrammed FPGA may be "configurable" to perform that function. After appropriate programming, the FPGA can be said to be "configured" to perform a particular function.

[0089] For purposes of U.S. patent applications based on this disclosure, a statement in a claim that a structure is "configured to" perform one or more tasks is expressly intended not to invoke 35 U.S.C. 112(f) as to that claim element. If an applicant wishes to invoke 35 U.S.C. 112(f) during prosecution of a U.S. patent application based on this disclosure, they will recite the claim elements using a "means for [performing a function]" structure.

Claims

1. 1. A method comprising: receiving, by a computer system, a metadata document describing an updated schema of a database storing a plurality of records; instantiating, by the computer system, a set of processes for executing an upgrade routine for upgrading the plurality of records to conform to the updated schema; While the set of processes is upgrading the plurality of records, the computer system: receiving a request to perform an action on one of the plurality of records; detecting that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document; upgrading the record to conform to the updated schema; performing the requested action on the record after upgrading the record; The method includes:

2. 2. The method of claim 1, wherein the updated schema describes a set of database entities and a corresponding set of statuses, a status of the set of statuses indicating whether a corresponding entity is available to process a request.

3. in response to receiving a status request from a client for a status of a particular database entity of the set of database entities, the computer system returning a response indicating the status of the particular database entity, the client being operable to use the response to determine whether the particular database entity is available to process requests from the client; The method of claim 2 , further comprising:

4. one of the set of database entities is an index, the method comprising: updating, by the computer system, in the metadata document, a status of a table on which the index is based, the updated status of the table preventing the table from being deleted while the index is being created. The method of claim 2 , further comprising:

5. the updated schema describes an index not described in the previous schema version, and upgrading the records to conform to the updated schema includes: populating the index with an entry for said record; after populating the index with the entries, updating a version of the record to match the version of the updated schema; The method of claim 1 , comprising:

6. The request specifies a minimum schema version to be used in processing the received request, and the method further comprises: detecting, by the computer system, that a schema stored in a memory of the computer system does not meet the minimum schema version; replacing the stored schema with the updated schema in the memory; The method of claim 1 further comprising:

7. 2. The method of claim 1 , wherein the updated schema describes a set of updates to a set of database entities, and a first database entity in the set of database entities is migrated before a second database entity in the set of database entities such that the first database entity is available before the second database entity.

8. 2. The method of claim 1, wherein the record is returned to the issuer of the request without being upgraded and stored in the database, and the record is subsequently upgraded by one of the set of processes and stored in the database.

9. after the set of processes executes the upgrade routine, the computer system instantiating a set of review processes to determine whether all of the plurality of records have been upgraded to comply with the updated schema. The method of claim 1 further comprising:

10. 1. A computer system comprising: At least one processor; A memory having stored therein program instructions executable by said at least one processor to carry out the method of any one of claims 1 to 9; A computer system comprising:

11. A computer readable medium having stored thereon program instructions executable by a computer system to cause the computer system to perform operations, the operations comprising: receiving a metadata document describing an updated schema of a database storing a plurality of records; instantiating a set of processes to execute an upgrade routine to upgrade the plurality of records to conform to the updated schema; While the set of processes is upgrading the plurality of records, receiving a request to perform an operation on one of the plurality of records; Detecting that the record corresponds to a schema version that is earlier than the updated schema version of the metadata document; upgrading the record to conform to the updated schema; performing the requested action on the record after upgrading the record; and Media containing.

12. The request specifies a minimum schema version to be used in processing the received request, and the action comprises: Detecting that a cached schema in an in-memory cache of the computer system does not meet the minimum schema version; replacing the cached schema with the updated schema in the in-memory cache; The medium of claim 11 further comprising:

13. The operation includes: receiving another request to perform an operation on a different record of the plurality of records, the other request not specifying a minimum schema version; performing the operation of the other request on the different record without upgrading the different record, the different record corresponding to a schema version earlier than the version of the updated schema; The medium according to claim 11 or 12, further comprising:

14. 12. The medium of claim 11, wherein performing the requested action includes deleting the upgraded record from the database.

15. The operation includes: maintaining status information identifying a status of database entities described in the updated schema; updating the status to indicate that the database entity is available to process requests in response to upgrading a record associated with the database entity; The medium of claim 11 further comprising:

Citation Information

Patent Citations

  • Remote data base access system

    JP1992098334A

  • On-demand data schema modifications

    US10909091B1

  • Online Schema and Data Transformations

    US20160117375A1