Cache updates via a distributed message queue

A distributed messaging queue system with local in-memory caches and AMQP ensures efficient cache invalidation and synchronization in multi-partitioned databases, addressing outdated cache issues and enhancing system performance and scalability.

JP7768972B2Active Publication Date: 2025-11-12HITACHI VANTARA LLC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2023507346
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-08-03
Publication Date
2025-11-12
Estimated Expiration
2040-08-03

AI Technical Summary

Technical Problem

In multi-partitioned databases, dynamic database routing and events can cause clients to have outdated information in their local caches, leading to uneven timing issues and slow system response times.

Method used

A distributed messaging queue system is used to aggregate and deliver cache invalidation messages to associated targets, employing local in-memory caches on client nodes and message broker queues like AMQP to periodically invalidate and synchronize local caches, allowing clients to maintain current routing information even in heterogeneous environments.

Benefits of technology

This approach reduces database load for read-intensive and write-intensive workloads by enabling efficient cache updates and synchronization across distributed caches, improving system performance and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007768972000001
    Figure 0007768972000001
  • Figure 0007768972000002
    Figure 0007768972000002
  • Figure 0007768972000003
    Figure 0007768972000003
Patent Text Reader

Abstract

In some examples, a first computing device may receive a first request from a second computing device. For example, the first computing device may be in communication with multiple database nodes, each maintaining a portion of a database distributed across the multiple database nodes. The first computing device may further maintain a local cache of a subset of the information maintained in the database. The first computing device may send a second request to the first database node based on the first request to cause the first database node to change data in the database. Additionally, the first computing device may receive a cache update message based on the change to the data in the database from a message queue of the multiple distributed message queues. The first computing device may update its local cache based on the cache update message.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to the field of data storage. [Background technology]

[0002] A multi-partitioned database may provide horizontal scalability by dividing data services among multiple computing devices, also called "nodes." For example, high availability and fault tolerance of data in a database may be enabled by replicating the database across multiple nodes and increasing the number of nodes as needed to handle increased data volumes and / or workloads. Client services may access database nodes to read and write data corresponding to the database. In some cases, client nodes may maintain local caches that are subsets of data from the database to enable clients to route read and write requests to the correct database node. However, database routing may change dynamically or other events may occur that can cause clients to have outdated information in their local caches, which may lead to uneven timing issues among system resources, slow system response times, etc. Summary of the Invention [Means for solving the problem]

[0003] Some implementations include a first computing device that may receive a first request from a second computing device. Further, the first computing device may be capable of communicating with multiple database nodes, each database node maintaining a portion of a database distributed across the multiple database nodes. In addition, the first computing device may maintain a local cache of a subset of the information maintained in the database. The first computing device may send a second request to the first database node based on the first request to cause the first database node to modify data in the database. In addition, the first computing device may receive a cache update message based on the modification of data in the database from a message queue of the multiple distributed message queues. The first computing device may update its local cache based on the cache update message. [Brief explanation of the drawings]

[0004] The detailed description is provided with reference to the accompanying drawings, in which the leftmost digit(s) of a reference number identifies the drawing in which the reference number first appears. Use of the same reference number in different drawings indicates similar or identical items or features.

[0005] [Figure 1] FIG. 1 illustrates an example architecture for a system employing messaging for updating local caches according to some implementations.

[0006] [Figure 2] FIG. 2 is a block diagram illustrating an example logical configuration of a system according to some implementations.

[0007] [Figure 3] FIG. 3 is a block diagram illustrating an example of creating a new bucket according to some implementations.

[0008] [Figure 4] FIG. 4 is a block diagram illustrating an example of local cache invalidation using distributed messaging queues according to some implementations.

[0009] [Figure 5] FIG. 5 is a block diagram illustrating an example of updating a local cache according to some implementations.

[0010] [Figure 6] FIG. 6 is a flow diagram illustrating an example of a process for updating a local cache using a distributed messaging queue according to some implementations.

[0011] [Figure 7] FIG. 7 illustrates selected example components of a service computing device that may be used to implement at least some of the functionality of the systems described herein. DETAILED DESCRIPTION OF THE INVENTION

[0012] Some implementations herein are directed to techniques and arrangements for a distributed computing system in which a distributed messaging queue system is used to aggregate and deliver cache invalidation messages to associated targets. For example, the system may include a distributed database that may allow client services to use slightly stale data for some operations, which is advantageous for increasing performance and improving scaling characteristics. This allows the system to significantly reduce database load for read-intensive workloads as well as write-intensive workloads, especially when one or more additional optimizations are included, as discussed further below.

[0013] Some examples include innovative distributed caches capable of operating within heterogeneous cloud (and / or multi-cloud) environments. For example, in heterogeneous cloud environments, a wide variety of distributed nodes with different resource characteristics, such as compute, memory, and network, may work together. However, standard synchronization techniques, such as chatty publisher / subscriber protocols, for synchronizing caches may not work well in such environments. Therefore, some implementations herein employ multiple local in-memory caches on individual client nodes that implement client services for the system. For example, local caches may mirror values ​​from a particular database used by the client services. Additionally, the systems herein may employ message broker queues, such as by using the Advanced Message Queuing Protocol (AMQP), to periodically invalidate and / or synchronize local caches.

[0014] In some cases, each cached data element may be configured to expire after a configurable time so that the data element does not become too stale. When a new value is written to the database, each client may be notified by an invalidation message that the corresponding data item is being invalidated. For further optimization, the invalidation message may include information about the new data value. Thus, in some cases herein, a database read is performed by a client node only if the client's local cache does not have a record of the specified data item, or if the data item has been invalidated without any updated value.

[0015] Some examples herein use message broker protocols to invalidate local caches and achieve local cache synchronization across a distributed set of local caches. Additionally, some implementations employ delayed publication of messages to improve performance and scalability within message broker queue-based distributed systems. For example, message queues are inherently less lossy than some other technologies due to their ability to persist messages for longer periods before delivering them.

[0016] In some examples herein, client nodes route their individual read and write requests to a respective subset of database nodes appropriate for each request. Furthermore, database routing may change dynamically, such that client devices may maintain current routing information based on implementations described herein even though the computational, network, and storage resources on the database nodes and / or client nodes may differ, which may cause, for example, uneven timing issues among participating entities in the system. Thus, some examples herein connect multiple heterogeneous systems, which may include public cloud storage devices connected to local or proprietary systems.

[0017] Implementations herein address the caching issues faced by scalable cloud storage configurations having multiple distributed database nodes that store and serve information, along with multiple client nodes that locally store subsets of the information stored in the database for efficient access. Additionally, some examples herein may include a distributed system consisting of a set of database nodes (metadata gateway devices, in some examples) and a set of client services executed by the client nodes that are clients of the distributed database provided by the database nodes. For example, the database nodes may store and serve information, and the client nodes may access or mirror information in the database.

[0018] For illustrative purposes, some example implementations are described in the context of one or more service computing devices in communication with a cloud storage system for managing storage and access to data using a distributed metadata database, although, as will be apparent to one of ordinary skill in the art in light of the disclosure herein, implementations herein are not limited to the particular examples provided and may be extended to other types of computing system architectures, other types of databases, other types of storage environments, other types of client configurations, other types of data, etc.

[0019] 1 illustrates an example architecture for a system 100 employing messaging for local cache updates according to some implementations. The system 100 includes multiple service computing devices 102 that are in communication with or connected to at least one networked storage system 104, such as via one or more networks 106. The service computing devices 102 can further communicate over the network 106 with one or more user devices 108 and one or more administrator devices 110, which may be any of a variety of types of computing devices, as discussed further below.

[0020] In some examples, service computing device 102 may include one or more servers, which may be embodied in any number of ways. For example, at least a portion of the programs, other functional components, and data storage of service computing device 102 may be implemented on at least one server in a cluster of servers, a server farm, a data center, a cloud-hosted computing service, etc., although other computer architectures may additionally or alternatively be used. Further details of service computing device 102 are discussed below with respect to FIG. 7.

[0021] Service computing device 102 may be configured to provide storage and data management services to users 112. As some non-limiting examples, users 112 may include users who perform functions for companies, businesses, organizations, government entities, academic entities, etc., and which, in some instances, may include storing very large amounts of data. Nevertheless, implementations herein are not limited to any particular use or application for system 100 and other systems and configurations described herein.

[0022] The networked storage system 104 may, in some examples, be referred to as "cloud storage" or "cloud-based storage" and may, in some cases, enable a cheaper per megabyte / gigabyte storage solution than local storage that may be available at the service computing device 102. Furthermore, in some examples, the networked storage system 104 may include commercially available cloud storage known in the art, while in other examples, the networked storage system 104 may include a private or enterprise storage system, or a combination thereof, accessible only by entities associated with the service computing device 102.

[0023] The one or more networks 106 may include any suitable network, including a wide area network such as the Internet, a local area network (LAN) such as an intranet, a wireless network such as a cellular network, a local wireless network such as Wi-Fi, and / or a wired network including short-range wireless communications such as BLUETOOTH®, Fibre Channel, optical fibre, Ethernet, or any other such network, a direct wired connection, or any combination thereof. Thus, the one or more networks 106 may include both wired and / or wireless communications technologies. The components used for such communications may depend, at least in part, on the type of network, the selected environment, or both. Protocols for communicating over such networks are well known and will not be discussed in detail herein. Thus, the service computing device 102, the network storage system 104, the user devices 108, and the management device 110 may communicate over the one or more networks 106 using wired or wireless connections and combinations thereof.

[0024] Additionally, service computing devices 102 may be able to communicate with each other over one or more networks 107. In some cases, one or more networks 107 may be a LAN, a private network, etc., while in other cases, one or more networks 107 may include any of the networks 106 discussed above.

[0025] Each user device 108 may be any suitable type of computing device, such as a desktop, laptop, tablet computing device, mobile device, smartphone, wearable device, terminal, and / or any other type of computing device capable of transmitting data over a network. Users 112 may be associated with user devices 108 by individual user accounts, user login credentials, etc. Further, user devices 108 may be able to communicate with service computing device 102 by one or more networks 106, by a separate network, or by any other suitable type of communications connection. Numerous other variations will be apparent to those skilled in the art having the benefit of this disclosure.

[0026] Additionally, each user device 108 may include a respective instance of a user application 114 that may execute on the user device 108, such as to communicate with a user web application 116 that may execute as a service on one or more service computing devices 102, such as to transmit user data for storage on the networked storage system 104 and / or to receive stored data from the networked storage system 104 via a data request 118. In some cases, the application 114 may include or operate via a browser, while in other cases the application 114 may include any other type of application having communication capabilities that enable communication with the user web application 116 over one or more networks 106.

[0027] Within the system 100, users 112 may store data on and receive data from service computing devices 102 with which they communicate via their respective user devices 108. Thus, the service computing devices 102 may provide storage services to the users 112 and the respective user devices 108. During steady-state operation, some users 108 may communicate with the service computing devices 102 periodically, such as to read and write data.

[0028] Additionally, administrator device 110 may be any suitable type of computing device, such as a desktop, laptop, tablet computing device, mobile device, smartphone, wearable device, terminal, and / or any other type of computing device capable of transmitting data over a network. Administrator 120 may be associated with administrator device 110 by an individual administrator account, administrator login credentials, etc. Furthermore, administrator device 110 may be capable of communicating with service computing device 102 over one or more networks 106, 107, over a separate network, or through any other suitable type of communications connection.

[0029] Additionally, each administrator device 110 may include a respective instance of an administrator application 122 that may execute on the administrator device 110, such as to communicate with an administration web application 124 that may execute as a service on one or more service computing devices 102. For example, the administrator 120 may use the administrator application to send management commands for managing the system 100, as well as to send and / or retrieve stored administration data from the networked storage system 104, such as via administration requests 126. In some cases, the administrator application 122 may include or operate via a browser, while in other cases the administrator application 122 may include any other type of application having communications capabilities that enable communication with the administration web application 124 over one or more networks 106.

[0030] The service computing device 102 may execute a storage program 130 that may provide a gateway to the networked storage system 104, such as to transmit data stored in the networked storage system 104 and to retrieve requested data from the networked storage system 104. Additionally, the storage program 130 may manage the data stored by the system 100, such as to manage data retention periods, data protection levels, data replication, etc.

[0031] The service computing device 102 may further include a metadata database (DB) 132, which may be divided into multiple metadata database (DB) partitions 134(1)-134(N) and distributed across multiple service computing devices 102. For example, the metadata DB 132 may be used to manage object data 136 stored in the network storage system 104. The metadata DB 132 may store or include a number of pieces of metadata about the object data 136, such as information about individual objects, how to access individual objects, storage protection levels for objects, storage retention periods, object owner information, object size, object type, etc. Furthermore, a DB management program 138 may manage and maintain the metadata DB 132, such as to update the metadata DB 132 when new objects are stored, old objects are deleted, objects are migrated, etc. The service computing device 102 including the database partitions 134 may be referred to as database nodes 140, which may each maintain a portion of the database 132 corresponding to one or more of the partitions 134.

[0032] Additionally, service computing devices 102 on which services (examples of services shown in FIG. 1 include user web application 116 and administrative web application 124) execute may be referred to as client nodes 142. Each client node 142 may maintain an individual local cache 146 (also referred to in some cases as a “near cache” or “local view”), such as first local cache 146(1) and second local cache 146(2) in the illustrated example. Client nodes 142 may act as clients to metadata database 132. In some cases, client node 142 may update local cache 146, which may be maintained on client node 142. For example, local cache 146 may be updated periodically based on updates to database 132 and / or by other techniques discussed further below. Thus, as an example, when user web application 116 receives data request 118 from user device 108, user web application 116 may access local cache 146(1) to determine which database node 140 to communicate with to fulfill data request 118. By using the local cache 146(1), the user web application 116 can reduce the number of queries to obtain the desired information from the metadata DB 132 to fulfill the data request 118.

[0033] Additionally, some or all of the service computing devices 102 may include individual instances of a node management program 148 executed by the individual service computing devices 102 to manage the individual service computing devices 102 as part of the system 100 and to perform other functions by the service computing devices 102 herein. If the service computing device 102 is a database node 140, the node management program may further manage the configuration of the database node 140 to perform actions such as configuring the database node 140 into partition groups and controlling the operation of the partition groups.

[0034] As one non-limiting example, database nodes 140 may be organized into Raft groups that follow the Raft consensus algorithm to ensure data redundancy and consistency for database partitions 134 of a distributed metadata database. According to the Raft algorithm, one database node 140 in each partition group may be elected as the leader and may be responsible for servicing all read and write operations for that database partition 134. Thus, the leader node may function as a metadata gateway for client nodes 142. Other database nodes 140 are follower nodes that receive copies of all transactions to enable them to update their own metadata database information. If the leader node fails or times out, one of the follower nodes may be elected as the leader and take over processing of read and write transactions. Client nodes in the metadata system herein can discover which database node 140 is the leader for each partition 134 (e.g., by accessing their respective local caches 146 or by sending queries) and direct requests to that database node 140.

[0035] Thus, examples herein include a system capable of routing requests for a scalable, highly available distributed metadata database 132. The metadata database 132 herein may provide high availability by maintaining strong, consistent copies of the metadata on separate metadata nodes 140. Additionally, the distributed metadata database 132 provides scalability by partitioning the metadata and distributing the metadata across different metadata nodes 140. Additionally, the solutions herein optimize the ability of client applications to find the partition leader for a given request.

[0036] To enable updating of the local cache in an efficient manner, at least a portion of the service computing device 102 may execute a messaging program 150. For example, the messaging program 150 may enable creation of cache update messages 152 for updating the local queue 146 after changes to database data, database configuration, etc. In some examples, the messaging program employed herein may include a message broker program implementing one or more of the Advanced Message Queuing Protocol (AMQP), Streaming Text-Oriented Messaging Protocol (STOMP), Message Queuing Telemetry Transport (MQTT), and / or other suitable messaging protocols. Some non-limiting examples of software that may be used in some implementations include APACHE QPID, JORAM, APACHE ACTIVEMQ, and RABBITMQ. For example, AMQP is a standard protocol capable of connecting applications on different platforms.

[0037] In some circumstances, an item in the local cache 146 may become invalid due to expiration due to a timeout or upon receipt of a message indicating that the value has been updated. Invalid items may be effectively removed from the local cache 146 by the client node 142, for example, by individual services running on individual client nodes 142. For example, each service running on a client node may maintain its own local cache 146 that may be used by the individual service and updated by the service based on received cache update messages 152.

[0038] In some examples, when the value of an item of data changes in database 132, a cache invalidation message 152 may be issued immediately, providing notification of the change using the AMQP messaging protocol, such as upon instruction from a metadata node 140 that has information about the change. The update of database 132 and the generation of cache update message 152 may be performed inline, e.g., cache update message 152 may be generated immediately after the update is made to the database, or the update of the database and the generation of cache update message 152 may occur asynchronously with respect to each other.

[0039] Client nodes 142 may be configured to listen for cache update messages 152 indicating data change events relevant to the cache type of their respective local caches 146. There may be different types of local caches 146 for different data types, for example, for different types of services performed by client nodes 142. Cache update messages 152 may be routed separately for different cache types, so that client nodes 142 with cache types different from the cache type to which a particular cache update message 152 pertains do not have to process data that they do not use. Additionally, all local cache instances (of the appropriate type) receive cache update messages 152 for that data type indicating that the data item is invalid.

[0040] In some examples, a node, such as database node 140, client node 142, or other computing node herein, may be a single physical or virtual machine that may maintain one or more of the programs, services, or data described herein. For example, all of the logical components of the metadata gateway and client service may execute on any physical computing device 102 in system 100. The distributed metadata database 132 may use dynamic partitioning, in which data stored by individual metadata nodes 140 may be partitioned into a set of manageable chunks (partitions 134) to distribute the database 132 data across multiple metadata nodes 140. As a partition 134 grows, the system may dynamically split the partition 134 to form two or more new partitions and migrate the new partition to a metadata node 140 with sufficient storage capacity to receive the new partition and / or to newly added metadata nodes 140.

[0041] When new metadata nodes 140 are added to the system 100, such as to accommodate data growth, communication within the system 100 may slow down. For example, at least some of the information contained in the local cache 146 may become invalid. Similarly, a client service node may scale to match the incoming workload by adding new client nodes 142. As mentioned above, the client nodes 142 may each maintain one or more local caches 146, which are in-memory caches that mirror a subset of the information stored in the metadata database node. The local caches 146 may increase system efficiency by significantly reducing the need for and frequency of database queries. For example, in a highly distributed system, constant access from client nodes that directly result in database queries (e.g., when the requested data is stored in persistent media such as a hard disk) may be expensive and increase system latency.

[0042] In some cases, data in distributed database 132 may be updated upon user request, and the update may occur only on a particular database node 140. As a result, if a mirror of the updated data exists in the local cache 146 of one or more client nodes 142, the data may become stale or invalid. Therefore, some examples herein may use a distributed invalidation scheme to continually asynchronously refresh data in local cache 146. As an example, a service may periodically mark data in local cache 146 as invalid. When a new request for that data arrives, the service may update local cache 146 by querying database 132 for the most recent value in database 132.

[0043] An example algorithm for invalidating and updating local caches 146 includes the following: (1) Each client node 142 maintains a local cache 146 of data that the client node 142 has previously retrieved as needed from database 132. (2) A client node 142 may have multiple local caches 146, each holding different types of data and configured with different optimized parameters, such as for use by one or more services running on the client node 142. (3) Each item of data in local cache 146 may expire after a configurable time. For example, the expiration time may be chosen to minimize database access while still preventing the data in local cache 146 from becoming too stale. (4) When the value of an item of data changes in database 132, a cache update message 152 advertising the change may be immediately generated and published using a messaging protocol such as AMQP. The updates in database 132 and the generation of the message may be performed inline. (5) Each service listens for cache update messages 152 indicating data change events for the respective type of cache used by the service. In some examples, cache update messages 152 may be routed separately for each type of cache, so that client nodes 142 and services managing local caches do not need to process data that they will never use. (6) All local cache instances (of a specified type) receive a cache update message 152 for that data type indicating that the data item is invalid. (7) An item may become invalid by at least one of the expiration of a timeout or upon receipt of a cache update message 152 indicating that the item's value has been updated. An invalid item is effectively removed from the local cache, such as by marking the item as deleted or by allowing the item's storage location to be overwritten over time. (8) When a client needs to access a data item, the cache immediately returns any value it has stored.If there is no stored value or the value has been invalidated, the program managing the local cache 146 may request the current value from the database 132. (9) A cache update message 152 may be configured with a "time to live" value so that it does not persist beyond its useful lifespan. For example, an item in the local cache 146 may automatically expire after a certain period of time. (10) As a further optimization, in some instances, a cache update message 152 may include a partial or complete value for the updated value. This increases the likelihood that multiple client nodes may update the value simultaneously. In that case, a distributed tick counter may be used by the programs managing the individual local caches 146 to identify which value is the most recent. This optimization can further reduce the database load for write-heavy workloads.

[0044] With the architecture and algorithms discussed above, the amount of access to database 132 by client nodes 142 may be significantly reduced for read-intensive workloads. Additionally, system 100 may be configured with expiration thresholds that prevent local caches 146 from becoming stale beyond a threshold. Separate expiration thresholds may be set for different types of local caches 146 and / or for individual local caches of the same type on different client nodes 142. For example, local caches 146 may be configured to expire least-recently-used data to enforce memory usage limits.

[0045] Furthermore, the local cache 146 may be updated by internal events. For example, the local cache 146 may be configured to store all system metadata except for user object metadata, which can grow to trillions of pieces of metadata. In this case, the system metadata mirrored in the local cache 146 may be user-driven or internal system metadata, such as a metadata partition map. The metadata partition map is a table or other data structure that contains partition identifiers (IDs) and the IDs of the database nodes 140 on which individual partitions reside. All user requests related to object management, such as putObject and getObject requests, may cause a service (e.g., the user web application 116) to search at least four different types of metadata: user information, bucket information, partition information, and object information. Thus, in some cases, all four types of metadata may be refreshed by a single user request. To avoid such situations, some examples herein may employ dynamic metadata partitioning techniques, including dividing all metadata types and tables into partitions 134. The partitions 134 are distributed across the database nodes 140 to provide uniform load management. If a metadata partition is divided into two or more partitions, invalidation of the partition map may occur. Although the partition splitting may not be driven by a user request, the invalidation and further refresh procedures may be similar to refreshes resulting from user actions such as the putObject and getObject requests discussed above.

[0046] Furthermore, to achieve better response times for end users, cache updates herein may occur asynchronously with respect to user write requests. Thus, there may be a small delay before local caches 146 of services distributed throughout the system 100 on client nodes are invalidated or updated. For example, the actual time for invalidating or updating local caches 146 may be variable based on network and system activity. The AMQP messaging protocol that may be used herein is inherently robust because cache update messages 152 can be queued before delivery. Thus, cache update messages 152 may be aggregated across multiple database updates. For example, assuming bucket, user, and partition map updates all occur and are queued simultaneously, only one cache update message 152 may actually be sent to an individual service on a client node 142. Nevertheless, cache update messages 152 via AMQP may still be lost in some circumstances, such as due to a temporary network failure. Therefore, implementations herein may include a mechanism for retrying message delivery up to a certain threshold of attempts.

[0047] Additionally, if delivery of a cache update message 152 from a queue fails, the local cache 146 may perform invalidation or other cache updates based on the expiration of a time threshold. For example, if the previous update for a given cached value exceeds a certain timeout value, the local cache 146 may be configured to automatically invalidate the entry. The timeout threshold employed for invalidation herein may be configured to be adjustable based on system workload dynamics, etc.

[0048] In some cases, service computing devices 102 may be arranged in one or more groups, clusters, systems, etc. at sites 154. In some cases, multiple sites 154 may be geographically dispersed from one another to provide data replication, disaster recovery protection, etc. Additionally, in some cases, service computing devices 102 at multiple different sites 154 may be configured to securely communicate with one another, such as to provide federation of multiple sites 154.

[0049] FIG. 2 is a block diagram illustrating an example logical configuration of a system 200 according to some implementations. In some examples, as would be apparent to one of ordinary skill in the art with the benefit of this disclosure, the system 200 may correspond to the system 100 discussed above or any of a variety of other possible computing system architectures. The system 200 may enable distributed object storage and may include using web applications as front-end services for users and administrators. In some cases, the system 200 may store objects on network storage (not shown in FIG. 2 ) in buckets that may be created by end users 112, 120. The system 200 may enable complex management and storage of data using resources distributed across on-premise and cloud systems. Within the system 200, scalability may be provided by logically partitioning the stored metadata stored in the distributed database 132.

[0050] 2 may include a distributed system of client nodes 142 and database nodes 140 that may allow client nodes 142 to use outdated cache data for some operations, which may improve the system's performance and scalability. This may result in reducing read-intensive database loads, and in some instances, write-intensive database workloads. For example, when a new value is written to the distributed database 132, each client node 142 with its respective local cache 146 may receive a cache update message 152 indicating that the corresponding data item has been invalidated. For further optimization, the cache update message 152 may include information about the new data value. Additionally, a database read may be performed if the local cache 146 does not have a record of the data item or if the data item has become invalid without any updated value.

[0051] In this example, system 200 incorporates messaging queue grid 202 for queuing and routing cache update messages 152 to services executing on client nodes 142. For example, messaging queue grid 202 may be provided by messaging program 150 discussed above with respect to FIG. 1 and may be hosted on one or more messaging nodes 204. Messaging node 204 may correspond to one or more of service computing devices 102 discussed above and may execute messaging program 150. In some cases, messaging program 150 may execute on the same service computing device 102 functioning as database node 140, and / or on a service computing device 102 functioning as client node 142, and / or on another service computing device 102 in system 100 discussed above with respect to FIG. 1. Messaging queue grid 202 may include multiple message queues, such as message queue 208(1), message queue 208(2), and message queue 208(3), each of which may be maintained in a separate virtual container, such as a DOCKER container. In some examples, message queues 208(1)-208(3) may be maintained on separate physical or virtual machines.

[0052] In this example, the distributed database 132 may include multiple metadata gateways 210, which may correspond to database nodes 140. For example, as discussed above, in some examples, each database partition 134 may be maintained by a partition group of two or more database nodes 140. Each partition group may have a leader node that responds to user read and write requests for its individual partition 134. Thus, the partition leader for each partition group may function as the metadata gateway 210 for that partition 134. In this example, four metadata gateways 210(1)-210(4) are shown for illustrative purposes, but in actual implementations, some example systems herein may include a much larger number of metadata gateways 210, depending on the number of database partitions 134.

[0053] Message queue 208 is configured to deliver cache update messages 152 to a service executing on client node 142. In this example, first service program 212 may correspond to user web application 116, discussed above, which may provide data access services to user device 108. For example, first service program 212 may maintain local cache 146(1) containing information that may be used to access metadata gateway 210. For example, first service program 212 may provide client functionality to enable client node 142(1) to interact with metadata gateway 210 to retrieve metadata. In addition, first service program 212 may provide functionality for receiving cache update messages 152 to update associated local cache 146(1). Furthermore, first service program 212 may interact with storage program 130 (not shown in FIG. 2), such as to retrieve object data 136 based on the retrieved metadata and / or metadata maintained in local cache 146(1), as discussed above with respect to FIG. 1. Additionally, the first service program 212 may exchange communications 214 with the user device 108, such as to send or receive user data.

[0054] In this example, second client node 142(2) may also run an instance of first service program 212, maintain a local cache 146(2), and exchange communications 216 with another user device 108. Additionally, in this example, third client node 142(3) runs two services: second service program 218 and third service program 220. For example, second service program 218 may correspond to administration web application 124 discussed above with respect to FIG. 1 , which provides administrative services to an administrator. For example, second service program 218 may include client functionality for interacting with other nodes in system 200, including client node 142, messaging node 204, and / or database node 140. Second service program 218 may exchange communications 222 with administrator device 110 to receive administrative instructions, provide status updates, etc. Second service program 218 may, in some instances, maintain local cache 146(3) that contains one or more data types that are different from the data types maintained in local caches 146(1) and 146(2), or vice versa.

[0055] Additionally, third service program 220 may provide another type of service that is different from the services provided by first service program 212 and second service program 218. As some non-limiting examples, third services may include garbage collection, object data management, etc. Third service program 220 may exchange communications 224 with administrator device 110 to receive management instructions, provide status updates, etc. Third service program 220 may maintain local cache 146(4), which in some instances may contain one or more data types that are different from the data types maintained by local caches 146(1), 146(2), and 146(3), or vice versa.

[0056] When the metadata gateway 210 changes the value of an item of data in the distributed database 132 or makes a change to the database 132, the metadata gateway 210 may send an enqueue command 230, which may include information about the changed value to one of the message queues 208. In some examples, the message queue 208 may be selected randomly, although other selection techniques may alternatively be used.

[0057] Receiving the enqueue command may cause the messaging program 150 on the respective messaging node 204 to generate a cache update message 152 and add the cache update message 152 to a respective message queue 208. For example, the cache update message 152 may be generated, queued, and distributed according to the AMQP messaging protocol. As described above, the cache update message 152 may be communicated or routed to a respective service program 212, 218, 220 executing on the client node 142.

[0058] As one example, cache update messages 152 may be routed differently for different types of local caches 146 depending on the data types contained therein and the data types affected by the update to database 132. For example, if local caches 146(1) and 146(2) contain one or more data types corresponding to the update, but local caches 146(3) and 146(4) do not contain those one or more data types, then cache update messages 152 destined for first service program 112 will not be routed to second service program 218 or third service program 220 based on an identification of the data types affected by the change, which indication may be provided, for example, by metadata gateway 210 that made the change to database 132. Thus, service programs whose caches are not affected by the change to database 132 may not receive or process cache update messages 152 that do not pertain to their respective local caches 146.

[0059] Figures 3-5 illustrate an example of creating a new bucket in database 132, invalidating existing local caches 146 of several services that contain bucket information in their local caches due to database changes, and later updating several local caches to include the updated database information. The example of Figures 3-5 may partially correspond to the example system 200 of Figure 2 discussed above, but with client node 142(2) omitted for clarity of illustration. Other components that are not involved are also omitted.

[0060] FIG. 3 is a block diagram illustrating an example 300 of creating a new bucket according to some implementations. In this example, assume that user 112 of user device 108 sends a write request 302 to cause the creation of a new bucket in networked storage system 104 (not shown in FIG. 3). First service program 212 may receive write request 302 and, in response, may send write request 303 to metadata gateway 210(3), such as based on routing information currently contained in local cache 146(1). In response, metadata gateway 210(3) may update the metadata in database 132, such as by creating a new record 304 for the new bucket. In this example, assume that record 304 includes a name 306 of the bucket (i.e., "Bucket 1") and bucket settings 308, including a 30-day retention period and synchronization settings. The bucket may be created in networked storage system 104 (not shown in FIG. 3). Metadata gateway 210(3) returns a write response 310 to first service program 212. In response, the first service program 212 returns a write response 312 to the user device 108 indicating that the bucket has been created.

[0061] FIG. 4 is a block diagram illustrating an example 400 of local cache invalidation using distributed messaging queues according to some implementations. In this example, in connection with the creation of a new bucket as discussed above with respect to FIG. 3, metadata gateway 210(3) may send an enqueue instruction 402 to one of the message queues, i.e., one of the messaging nodes 204, including message queue 208(2) in this example. As noted above, in some examples, message queue 208(2) and / or messaging node 204 may be randomly selected by metadata gateway 210(3). In other examples, metadata gateway 210(3) may employ any other suitable technique for selecting one of the message queues 208(2) / messaging nodes 204 to receive enqueue instruction 402. While in some examples, metadata gateway 210(3) may include the record 304 created in the database with the enqueue instruction 402, this example assumes that metadata gateway 210(3) simply identifies the data type (i.e., bucket) of the metadata record affected by the change made to the database.

[0062] Based on receiving the enqueue instruction 402, the messaging node 204 may create a cache update message 152 to send to services that maintain local caches with the bucket information. In this example, assume that the first service program 212, the second service program 218, and the third service program 220 all contain bucket information in their local caches 146(1), 146(3), and 146(4), respectively. The messaging node 204 may add the cache update message 152 to message queue 208 and distribute the cache update message 152 to the two services. For example, the messaging node may determine the type of local cache maintained by each of the services in order to properly route the cache update message 152. Thus, the messaging node 204 may use message queue 208-2 to deliver the cache update message 152 to the first service program 212, the second service program 218, and the third service program 220. In response, first service program 212 may invalidate or update the bucket portion of local cache 146(1), second service program 218 may invalidate or update the bucket portion of local cache 146(3), and third service program 220 may invalidate or update the bucket portion of local cache 146(4).

[0063] 5 is a block diagram illustrating an example 500 of updating a local cache according to some implementations. In this example, assume that user 112 uses a user device to submit a get bucket request 502 to first service program 212. In response, first service program 212 determines that the bucket portion of local cache 146 is invalidated and sends a get bucket request 504 for the bucket information. In response, metadata gateway 210(3) may provide a get bucket response 506 that includes a copy of record 304 from database 132, which may be added to local cache 146(1) by first service program 212.

[0064] Similarly, assume that administrator 120 uses administrator device 110 to send get object request 508 to third service program 220. Third service program 220 may send get bucket request 510 to query metadata gateway 210(3) to request information related to the bucket (bucket 1) containing the requested object. In response, metadata gateway 210(3) may send get bucket response 512 to third service program 220, which may include a copy of metadata record 304 that can be added to local cache 146(4) to refresh the bucket portion of local cache 146(4).

[0065] Furthermore, although in this example the service is queried, the requested metadata gateway to obtain updated information for the new bucket from database 132, in other examples, as noted above, record 304 may have been included in a cache update message 152 previously sent to the service to invalidate the associated local cache 146. Thus, in this alternative example, first service 212 and third service 220 do not need to query metadata gateway 210 for bucket record 304, since that information is already contained in their respective local caches 146(1) and 146(4).

[0066] Figure 6 is a flow diagram illustrating an example process for updating a local cache using a distributed messaging queue according to some implementations. This process may be illustrated as a collection of blocks in a logical flow diagram, which represents a series of operations, some or all of which may be implemented by hardware, software, or a combination thereof. In the software context, the blocks may represent computer-executable instructions stored on one or more computer-readable media that, when executed by one or more processors, programs the processors to perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures, etc. that perform particular functions or implement particular data types. The order in which the blocks are described should not be construed as limiting. Any number of the described blocks can be combined in any order and / or in parallel to implement this process or alternative processes, and not all of the blocks must be executed. For illustrative purposes, the process is described with respect to the environments, frameworks, and systems described in the examples herein; however, this process may be implemented in a wide variety of other environments, frameworks, and systems. In FIG. 6, process 600 may be performed at least in part by a client node executing one or more of service programs 212, 218, or 220.

[0067] At 602, the service computing device may partition a database across multiple database nodes to provide multiple partitions distributed across the multiple database nodes.

[0068] At 604, the client node may run a service, which maintains a local cache of a subset of the information maintained in the database.

[0069] At 606, the client node may receive a first request from a user computing device, the first request affecting data in the database. For example, the client node may receive a write request or other request to change data in the database.

[0070] At 608, the client node may send a second request based on the first request to a first database node of the plurality of database nodes, the second request causing the first database node to change data in the database.

[0071] At 610, the client node may receive cache update messages based on changes to data in the database from message queues of the multiple distributed message queues.

[0072] At 612, the client node may determine whether the received cache update message contained updated data. If so, the process proceeds to 614. If not, the process proceeds to 616.

[0073] At 614, the client node may update its local cache to include the updated data contained in the cache update message.

[0074] At 616, the client node may invalidate at least a portion of its local cache in response to the cache update message.

[0075] At 618, the client node may receive a third request from the user computing device to access data corresponding to the data in the database.

[0076] At 620, the client node may send a query to at least one database node of the plurality of database nodes to determine information from the database related to the third request.

[0077] At 622, the client node may update its local cache based at least in part on the response to the query received from the database node.

[0078] The example processes described herein are merely example processes provided for illustrative purposes. Numerous other variations will be apparent to those skilled in the art in light of the disclosure herein. Furthermore, while the disclosure herein describes some example frameworks, architectures, and environments suitable for implementing the processes, implementations herein are not limited to the specific examples shown and described. Furthermore, the disclosure provides various example implementations described and illustrated in the figures. However, the disclosure is not limited to the implementations described and illustrated herein, and may extend to other implementations known or to become known to those skilled in the art.

[0079] 7 illustrates selected example components of a service computing device 102 that may be used to implement at least a portion of the functionality of the system described herein. The service computing device 102 may include one or more servers or other types of computing devices, which may be embodied in any number of ways. For example, in the case of a server, the programs, other functional components, and data may be implemented on a single server, a cluster of servers, a server farm, or a data center, a cloud-hosted computing service, etc., although other computer architectures may additionally or alternatively be used. Multiple service computing devices 102 may be located together or separately and organized, for example, as virtual servers, server banks, and / or server farms. The described functionality may be provided by the servers of a single entity or company, or by the servers and / or services of multiple different entities or companies.

[0080] In the depicted example, service computing device 102 may include or be associated with one or more processors 702, one or more computer-readable media 704, and one or more communication interfaces 706. Each processor 702 may be a single processing unit or several processing units, and may include single or multiple computing units or multiple processing cores. Processor 702 may be implemented as one or more central processing units, microprocessors, microcomputers, microcontrollers, digital signal processors, state machines, logic circuits, and / or any device that manipulates signals based on operational instructions. By way of example, processor 702 may include one or more hardware processors and / or logic circuits of any suitable type specifically programmed or configured to execute the algorithms and processes described herein. Processor 702 may be configured to retrieve and execute computer-readable instructions stored in computer-readable media 704, which may program processor 702 to perform the functions described herein.

[0081] The computer-readable medium 704 may include volatile and nonvolatile memory and / or removable and non-removable media implemented in any type of technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. For example, the computer-readable medium 704 may include, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, optical storage, solid-state storage, magnetic tape, magnetic disk storage, storage arrays, network-attached storage, storage area networks, cloud storage, or any other medium that can be used to store desired information and that is accessible by a computing device. Depending on the configuration of the service computing device 102, the computer-readable medium 704 may also be tangible, non-transitory media, insofar as reference to non-transitory computer-readable media excludes media such as energy, carrier signals, electromagnetic waves, and / or the signals themselves. In some cases, the computer-readable medium 704 may be co-located with the service computing device 102, while in other instances, the computer-readable medium 704 may be partially remote from the service computing device 102. For example, in some cases, the computer-readable medium 704 may comprise a portion of the storage within the networked storage system 104 discussed above with respect to FIG.

[0082] The computer-readable medium 704 may be used to store any number of functional components executable by the processor 702. In many implementations, these functional components include instructions or programs executable by the processor 702 that, when executed, among other things, program the processor 702 to perform operations ascribed herein to the service computing device 102. The functional components stored within the computer-readable medium 704 may include a user web application 116, an administrative web application 124, a storage program 130, a database management program 138, a node management program 148, and a messaging program 150, each of which may include one or more computer programs, applications, executable code, or portions thereof. Furthermore, although these programs are shown together in this example, during use, some or all of these programs may execute on separate service computing devices 102.

[0083] Additionally, the computer-readable medium 704 may store data, data structures, and other information used to perform the functions and services described herein. For example, the computer-readable medium 704 may store the metadata database 132, which includes the database partitions 134. Additionally, the computer-readable medium may store the local cache 146. Further, although these data structures are shown together in this example, during use, some or all of these data structures may be stored on separate service computing devices 102. The service computing device 102 may also include or maintain other functional components and data, including programs, drivers, etc., and data used or generated by the functional components. Furthermore, the service computing device 102 may include many other logical, programmatic, and physical components, of which the above-listed list are merely examples relevant to the discussion herein.

[0084] The one or more communication interfaces 706 may include one or more software and hardware components for enabling communication with various other devices, such as over one or more networks 106. For example, the communication interface 706 may enable communication via one or more of a LAN, the Internet, a cable network, a cellular network, a wireless network (e.g., Wi-Fi) and a wired network (e.g., Fibre Channel, Fiber Optic, Ethernet), a direct connection, and short-range communication such as BLUETOOTH®, as further listed elsewhere herein.

[0085] Various instructions, methods, and techniques described herein may be discussed in the general context of computer-executable instructions, such as computer programs and applications, stored on computer-readable media and executed by processors herein. In general, the terms program and application may be used interchangeably and may include instructions, routines, modules, objects, components, data structures, executable code, etc. for performing particular tasks or implementing particular data types. These programs, applications, etc. may be executed as native code or may be downloaded and executed, such as in a virtual machine or other just-in-time compilation execution environment. Typically, the functionality of the programs and applications may be combined or distributed as desired in various implementations. Implementations of these programs, applications, and techniques may be stored on computer storage media or transmitted over some form of communication medium.

[0086] Although the present subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the present subject matter defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as example forms of implementing the claims.

Claims

1. 1. A system including: a first computing device in communication with a plurality of database nodes and a second computing device; and a plurality of distributed message queues including a plurality of message queues, each database node maintains a portion of the metadata database based on partitioning the metadata database to distribute the metadata database across the plurality of database nodes, the metadata database maintaining metadata about objects stored in a given storage system, and the first computing device maintains a local cache of a subset of the metadata maintained in the metadata database; The first computing device receiving a first request from a second computing device, the first request affecting the metadata in the metadata database; sending a second request based on the first request to a first database node of the plurality of database nodes, the second request causing the first database node to update the metadata in the metadata database; receiving, asynchronously with respect to the sending of the second request, from one of the message queues included in the plurality of distributed message queues, a cache update message indicating the update of the metadata in the metadata database; and updating the local cache based on the cache update message; Perform an operation that includes the message queues of the plurality of distributed message queues are configured to selectively route the cache update messages indicating updates to data types of the metadata in the metadata database to the first computing device that stores the data types affected by the update in its local cache. system.

2. receiving the cache update message includes receiving updated metadata added to the metadata database; updating the local cache based on the cache update message includes updating the local cache to include the updated metadata. The system of claim 1 .

3. The system of claim 1 , wherein updating the local cache based on the cache update message includes invalidating at least a portion of the metadata in the local cache.

4. The system of claim 1 , wherein the operations further comprise receiving the cache update message according to an advanced message queuing protocol.

5. The system of claim 1 , wherein the system includes a plurality of messaging nodes, and the plurality of distributed message queues are respectively provided by the plurality of messaging nodes.

6. 2. The system of claim 1, wherein the first computing device executes a first service on the first computing device, the first computing device maintains the local cache using the first service, and the first service enables a second computing device to access objects stored in the storage system corresponding to the metadata database.

7. The first service is User web applications, or Admin Web Application The system of claim 6, wherein the

8. The system of claim 1 , wherein the first request is a data write request to store an object in the storage system associated with the metadata database.

9. Updating the local cache based on the cache update message includes invalidating at least a portion of the metadata in the local cache, the operation comprising: receiving a third request from the second computing device to retrieve an object from the storage system; determining that at least a portion of the metadata in the local cache is to be invalidated; and sending a query to at least one database node of the plurality of database nodes to determine metadata from the metadata database related to the third request; The system of claim 1 further comprising:

10. 10. The system of claim 9, further comprising, based on receiving the metadata in response from the at least one database node, sending the metadata to another computing device that provides a gateway to the storage system to obtain objects from the storage system over a network.

11. A method executed by a first computing device, comprising: The first computing device receiving a first request from a second computing device, the first computing device being capable of communicating with a plurality of database nodes and a second computing device, each database node maintaining a portion of the metadata database based on partitioning the metadata database to distribute the metadata database across the plurality of database nodes, the metadata database maintaining metadata about objects stored in a given storage system, the first computing device maintaining a local cache of a subset of the metadata maintained in the metadata database; sending a second request based on the first request to a first database node of the plurality of database nodes, the second request causing the first database node to update the metadata in the metadata database; receiving, asynchronously with respect to the sending of the second request, from one of a plurality of distributed message queues, a cache update message indicating the update of the metadata in the metadata database; and updating the local cache based on the cache update message; Run the message queues of the plurality of distributed message queues are configured to selectively route the cache update messages indicating updates to data types of the metadata in the metadata database to the first computing device that maintains in its local cache the data types affected by the update. method.

12. receiving the cache update message includes receiving updated metadata to be added to the metadata database; updating the local cache based on the cache update message includes updating the local cache to include the updated metadata. The method of claim 11.

13. One or more processors included in the first computing device receiving a first request from a second computing device, the first computing device capable of communicating with a plurality of database nodes and a second computing device, each database node maintaining a portion of the metadata database based on partitioning the metadata database to distribute the metadata database across the plurality of database nodes, the metadata database maintaining metadata about objects stored in a given storage system, the first computing device maintaining a local cache of a subset of the metadata maintained in the metadata database; sending a second request based on the first request to a first database node of the plurality of database nodes, the second request causing the first database node to update the metadata in the metadata database; receiving, asynchronously with respect to sending the second request, a cache update message indicating the update of the metadata in the metadata database from one of a plurality of distributed message queues; and updating the local cache based on the cache update message; A program for performing operations including one or more non-transitory computer-readable storage media having a program stored thereon, wherein the message queues of the plurality of distributed message queues are configured to selectively route the cache update messages indicating updates to data types of the metadata in the metadata database to the first computing device that maintains the data types affected by the update in its local cache.

14. receiving the cache update message includes receiving updated metadata to be added to the metadata database; updating the local cache based on the cache update message includes updating the local cache to include the updated metadata.

14. One or more non-transitory computer-readable storage media as recited in claim 13.

Citation Information

Patent Citations

  • Data cache system

    JP2014052928A

  • Distributed key / value store system using asynchronous messaging systems

    US20180019985A1

  • Presence, access, and seen state for local copies of shared content items

    US20180188930A1

  • Accessing historical content items of a content management system through placeholders

    US20180189334A1

  • Optimizing content storage through stubbing

    WO2018147876A1