Abstract
A grocery supply chain cannot afford to stop for a moment. Disruptions can spoil food, delay fulfilment, and frustrate customers. Achieving continuous availability for a business-critical component is thus essential; standby database protection enables such capability. This paper synthesizes observations on standby protection and related topics such as recovery models, failover mechanisms, and architectures supporting 24/7 operations, specifically in relation to grocery supply chains. The exploration begins by defining key concepts; concepts are placed within context by a historical overview of reliability practices that also reveals areas of evolution. The Linux Database Management System (LDDBMS) catalogue of commonly used database technologies is then consulted to describe the specific set of capabilities present in 2021. Finally, supporting operational practices—including incident response workflows, disaster recovery planning, and tabletop-testing plugs—are covered. Databases are an essential part of almost every service. They handle high volumes of read traffic and moderate amounts of write traffic. Although services can be supported by a cluster of servers, a single database is still often a key business area. A database requires technical and engineering expertise to maintain. It is also the service that most needs to be changed, scaled, and monitored. Often, e-commerce and content-management systems are required to run 24/7 without any interruptions. Any planned maintenance will require at least a maintenance window or some downtime. To facilitate a stand-by database for business-continuity compliance, there are standard operating procedures for major incidents and a design document fulfilling all major aspects of continuous availability.
1. Introduction
Food and grocery supply chains increasingly employ 24/7 operations to meet consumer demand, adapt to the pandemic, and comply with supermarket data regulation. Uninterrupted availability of supporting database systems can be hard to achieve [1], yet downtime usually impacts sales and customer service. An analysis of standby database protection as a means of achieving continuous availability finds that the standby concept, applied to both hot and cold operations, has been around for years but is still frequently neglected or misunderstood.
Food and grocery supply chains have been operating on a 24/7 basis for some time, shaped by meeting shift worker lifestyle demands, preparing for online retail activities [2], ensuring timely response to the pandemic [3, 4], and delivering in-house customer or citizen demand. Evolving supermarket data regulations require controlled and audited use of customer information. However, operational continuity for technology systems, notably for supporting database servers, is frequently overlooked. Yet, any significant outage usually results in unplanned loss of sales and deteriorating customer service. The technology answer typically revolves around standby database protection, a topic with a long history in the data engineering and production space. It has been found that standby naturally applies to environments running two or more data centres, be they hot, poised for rapid availability, or cold, waiting to offer any availability at all.
2. Background and Context
The impact of database failure on the ability of grocery supply chains to fulfil online requirements is increasingly significant, and requires continuous database availability. Availability is commonly considered the most important quality criterion for computing systems, and fourth-quadrant operations emphasise 24/7 capability. Historical databases offer good reliability and fast recovery but leave large windows of vulnerability. Active-active high-availability databases eliminate downtime, but entail increased operating costs [5, 6]. Other standby protection techniques – where a replica only serves in the event of primary failure – achieve higher service levels than historical methods, while accepting greater downtime than active-active solutions [7]. Grocery operations are particularly sensitive to operational downtime because they use the underlying infrastructure (e.g. warehouses, fulfilment centres) round the clock [8, 9], with other disruptions and delay costs tending to crowd the fourth quadrant. It is thus possible to enhance operational resilience at acceptable cost and risk by aligning standby-capable database technologies with suitable operational practices. A review of supporting business processes demonstrates that 24/7 supply chain practice is supported by standby-capable database technologies, processes for detecting issues and tracking system health, a dedicated group to investigate and resolve incidents, and a programme of disaster recovery planning that validates incident escalation plans and supports testing of the standby database.
In the fast-moving world of retail logistics, reliability is of paramount importance: systems must not only be available seven days a week, but also supported 24 hours a day. Unlike for many organisations that employ the underlying infrastructure sporadically to stabilise financial performance, retailers’ investments in order-fulfilment systems are committed throughout the week and day. Earnings reports indicate that for some retailers, as much as 80% of trading profit is generated by online operations. But as parts of the service-level agreement associated with grocery home shopping service fulfilment become internalised and part of the operation of the store offer, the cost of downtime increases. Disruption to these non-scale resources (warehouses and fulfilment centres) can not only have direct operational delays and issues, but also incur a hidden cost of creating delays for more scale-type resources (trucks) for a period of time after the event [10]. During 2021 it was suggested that three-quarters of service requests were restoration in nature; it should therefore be possible to enhance resilience by adopting standby-capable database technologies, supported by suitable operational practices. The standby architectures compared in this study are summarized in Table 1, and the model parameters and their provenance are listed in Table 2.
2.1. Evaluation Setup
Assumed values are illustrative engineering choices and should be replaced with organizational data before use in decisions.
2.2. Recovery and Availability
Figure 1 presents the RTO and RPO ranges of the four standby models, and Figure 2 shows the corresponding annual downtime and availability.
2.3. Latency
Figure 3 illustrates how replication lag varies with apply-queue utilization, and Figure 4 shows write commit latency as a function of inter-site round-trip time.
2.4. Failure-Detection Accuracy
Figure 5 shows the accuracy of failure detection for the standby models.
2.5. Resource Utilization
Figure 6 compares the peak CPU utilization of the primary and standby sites.
2.6. Cost versus Performance
Figure 7 presents the components of expected annual cost, Figure 8 shows its sensitivity to the outage-cost multiplier, and Figure 9 compares cost-effectiveness relative to Model A.
3. Standby Database Protection: Concepts and Architectures
Standby database protection systems protect a primary database from failure, but allow the business or service that uses it to continue operating [11, 12]. Without standby protection, incidents such as software bugs, system misconfiguration, network failure, and hardware faults can cause data access to be interrupted or halted for extended periods of time. Around-the-clock grocery supply chain operations need standby protection for their database systems to guard against these types of events.
Standby protection architectures can be classified into two main categories: those that allow a service to break for a short time (measured in seconds or minutes) and those that enable 24/7 operation with almost no break—and even the latter may not be suitable for grocery systems under all conditions. Services rely on databases for various periods of time during the normal course of operations, but action is not expected from the rest of the supporting system every second of every minute. Yet even allowing for a break of one or two minutes is too much for around-the-clock grocery supply chain operations. Any conceivable issue that results in the database being momentarily unavailable or able to process only a subset of requests at a time constitutes a critical incident, one that can open the door to problems so severe that the entire service may fail.
3.1. Detailed Recovery Models and Failover Mechanisms
Recovery Point Objectives (RPO) and Recovery Time Objectives (RTO) define the acceptable levels of data loss and downtime, respectively, in the intended resilience model. Consequently, selection of the primary storage technology and configuration directly impacts the overall service delivery capacity. Four specific RPO and RTO scenarios now warrant consideration, together with the prescribed Storage Area Network (SAN) architecture that facilitates their implementation.
Asynchronous log shipping with manual failover can achieve a zero touch, passive standby at a remote site with RPO of 1–24 hours and RTO of 8–24 hours. Applications remain readable with up-to-date information through a load-balanced read-only configuration during normal operation. The standby system is managed by operational acceptance procedures for activation and data completeness testing. Asynchronous log shipping remains an attractive approach for non-mission-critical applications that can afford such levels of disruption.
Asynchronous streaming replication with manual failover can deliver a near-real-time, passive standby on an alternative data centre with RPO of 5–30 minutes and RTO of 30–120 minutes. Partition-level asynchronous replication allows for differential service-level agreements (SLA) [13, 14]; systems within the same geolocation can be physically hosted in separate clusters. Failover is triggered by operations teams via a pre-approved runbook.
Synchronous streaming replication with automated cutover can enable application-aware, continuous zero RPO at an alternate data centre with RTO of 5–30 minutes [15]. Automated failover can be initiated by the database administrator or network operations centre based on predefined criteria. Regular cutover testing ensures that the standby remains ready for production load, thus providing confidence in the required RT systems without the need for a separate operational runbook.
Synchronous streaming replication with automated cutover can also establish an active-active clustering over two or more geo-distributed data centres with RPO of 0 minutes and RTO of 0 minutes [16, 17]. Application-level awareness and support for multihome communication are essential, as is the ability to withstand the loss of any single location, application service, or server within an active-active zone. Testing the failover capability of individual services within the cluster should be managed by the appropriate application support teams and performed at least annually.
4. Systems and Infrastructure for Continuous Availability
Continuous availability of an entire system around the clock requires much more than standby database protection. Key system-level considerations include proper monitoring for underlying issues, system performance to handle peak loads, and sufficient capacity for anticipated growth [18]. In addition to these operational imperatives, the supporting infrastructure includes data centers, networks, storage subsystems, and virtualization facilities.
Monitoring must ensure that system-level problems—such as resource exhaustion, misconfigurations or network defects—are detected well before serious degradation occurs. The frequency of monitoring should reflect the severity of the potential customer experience issue and the impact on brand reputation. In many cases, running a database read-only copy on a nearby application configuration will monitor for both availability and latency increases.
Continuous availability is not cheap. It cannot be taken as a given. The cost of standby systems, backup site subscriptions, enhanced incident response capabilities, testing, capacity planning, runbooks and so on needs to be proportionate to the scale of potential financial loss, reputational damage, loss of market share or business opportunity by failing to satisfy the continuity target. Monitoring for scenarios that would require a failover is a sensible first step to understand if that cost will ever yield a return.
4.1. Database Technologies Employed in 2021
Database technologies for implementing standby protection in 2021 allow for continuous operation of grocery supply chain applications across diagnostic, test, and production environments. All databases must be resilient, yet those positioned at the interface between the application and the backup must also support fast and cost-effective replication [19]. Relational databases provide the ideal foundation for most transactional operations and the majority of standbys. NoSQL databases fill the niches of document stores and key-value stores, where seamless distribution of latency-sensitive read traffic is essential [20].
For main databases, replication is typically implemented either using the technology build into the chosen database or by using an external tool. The replication support within the database is generally deployed for the primary and the standby on different cloud service providers, regions, or availability zones providing the required resilience. Within these environments, the bandwidth for the binary log replication is sufficient to allow an RPO in seconds. For other databases without replication support, tools such as Veeam and Commvault Snapshot Replication are employed. For failover with NoSQL databases, the architecture includes twos copies of the data, with automated script-driven failover detection. The databases form part of the operational monitoring layered alerts infrastructure.
Database backups are normally hosted within the same environment as the standby. For databases that support the facility to split a storage volume and host the two RDBMS instances on the same volume, a tiered storage strat-planning selfish swag is used. The Tier 1 SSD storage serves diagnostics and testing; Tier 1 D drive SSD storage is used for production; and all remaining databases are Tier 2 SATA st-planning ballast storage hosted within the same environment. For all other databases, a combination of tiered storage and storage snapshots hosted on external providers is used.
5. Operational Practices for 24/7 Availability
Several specific technologies can be employed to reduce the likelihood of outages where customers are unable to complete their orders. For a grocery operation such as the one reviewed in this paper, where many of the customers are ordering groceries for delivery within hours, service interruptions, although rare, are particularly disruptive. These interruptions are especially painful when there is a significant weather event and many customers are turning to the grocery store’s website for their needs. As a result, being able to respond to such incidents in a timely manner and minimize the impact are especially critical.
Database technologies used in 2021 included an Oracle DataGuard Standby and SQL Server Log Shipping for the database supporting the order management system, and SQL Server Replication for the databases supporting the other websites. While steady state operations are supervised on a 24×7 basis, a smaller number of people could be on standby during off-peak hours, preventing the need for overnight on-call availability. If a significant incident occurred, the operations would switch to a “war room” mode, where substantially greater resources would be devoted to eliminating the problem.
5.1. Availability and Downtime
Let λ be the number of failover-class incidents per year, the overbarred RTO the midpoint RTO of model k (min), and Dres a residual downtime that standby protection cannot remove (e.g., application-tier faults). Annual downtime and availability are
where Dₖ is in minutes. Availability is also expressed in "nines":
5.2. Recovery Objectives
Recovery time is decomposed into the stages of a failover, which makes explicit where automation removes time:
with detection, decision (human approval under a runbook), standby promotion, client redirection and data-completeness validation. Data-loss exposure is measured in hours of committed business data placed at risk per year:
5.3. Replication Lag and Commit Latency
For log shipping with shipping interval Ts, lag is approximately uniform on [0, Ts], so
For streaming replication, the apply queue is modelled as an M/M/1 queue with mean batch service time s and utilization ρ; the sojourn time is exponential, giving
Write commit latency depends on how many inter-site round trips lie on the commit path:
where mₖ = 0 for asynchronous models (A, B), 1 for synchronous cutover (C) and 2 for two-phase coordination in active-active operation (D).
5.4. Failure-Detection Accuracy
Monitoring must raise a failover alarm for genuine primary failures without false alarms. With TP, FP and FN the true positives, false positives and false negatives of the alarm stream:
A health signal (e.g., replication heartbeat delay) is assumed Gaussian with unit variance under both healthy and degraded states. Averaging nₖ = Tw/Δₖ samples in a window Tw separated by polling interval Δₖ gives a detectability index, and an alarm at threshold z has
where Φ is the standard normal CDF and π the prior probability that a monitoring window contains a degraded state. The operating threshold maximizes F₁:
5.5. Cost and Optimization
Costs are normalized to annual trading profit. With online share s of trading profit, one hour of total outage costs ch = 100s/8760 percent of annual profit. The expected annual cost of model k is
where Cinf,ₖ is the standby infrastructure and operations cost, κ ≥ 1 is a surge multiplier for outages during peak demand (e.g., weather events [1]) and cl is the cost of one hour of lost data relative to one hour of outage. Selection is a constrained minimization against the service-level targets:
Setting Cⱼ(κ) = Cₖ(κ) gives the break-even surge multiplier at which the costlier model k becomes cheaper than model j:
5.6. Efficiency, Improvement and Utilization
Cost-effectiveness is the downtime avoided per percentage point of trading profit invested relative to baseline Model A, and relative improvement of any metric X over the baseline is
for lower-is-better metrics (the sign is reversed for F₁ and availability). With offered peak load ρ₀ (fraction of one node's capacity) and read-offload fraction φₖ routed to the second site, node utilizations are
6. Conclusion
Continuous availability of the grocery company was achieved by regularly backfilling a standby copy of the primary database, with tight alignment of infrastructure redundancy and effective incident response and failover processes. Concepts and architectures related to standby database protection, including potential recovery models and failover mechanisms, were discussed. The use of transaction logs and synchronous replication for a truly hot standby database is often desirable, but such a complex architecture needs careful consideration and is not for every environment; doing something simpler and less costly may be better than not having a standby database. The approach described here has reduced the risk of an extended outage impacting imminent supply chain operations. In 2021, the Oracle Database was used for standby database protection at the grocery company, while Microsoft SQL Server, PostgreSQL, and MySQL were supported for other business units.
In the face of a bank virus outbreak, in another part of the world, a country enforced immediate border shut down for a week. Although opened some days later, several European countries announced urgent airport closure and travellers were no longer permitted to enter. Supply chain was still under normal operation within rest of Asia and one third of the restaurant business of the grocery company relied on ingredients imported from this affected country. Supply chain operation of 24/7 grocery company supported several countries and such an incident may not have large impact; incident planning, redundancy, standby database copy remained to be critical. Beside system fault tolerances, standby database covered failovers with at maximum of 15 minutes loss of business transactions and such a precaution measure relieved the effect to the business during the short operation disruption. Supply chain incident planning and standby database preparation suitable for real emphasis.
References
- Campêlo, R. A., Casanova, M. A., Guedes, D. O., & Laender, A. H. F. (2020). A brief survey on replica consistency in cloud environments. Journal of Internet Services and Applications, 11, Article 1.[CrossRef]
- Vallandingham, L. R., Yu, Q., Sharma, N., Strandhagen, J. W., & Strandhagen, J. O. (2018). Grocery retail supply chain planning and control: Impact of consumer trends and enabling technologies. IFAC-PapersOnLine, 51(11), 612–617.[CrossRef]
- Hobbs, J. E. (2020). Food supply chains during the COVID-19 pandemic. Canadian Journal of Agricultural Economics/Revue canadienne d'agroeconomie, 68(2), 171–176.[CrossRef]
- Ivanov, D. (2020). Predicting the impacts of epidemic outbreaks on global supply chains: A simulation-based analysis on the coronavirus outbreak (COVID-19/SARS-CoV-2) case. Transportation Research Part E: Logistics and Transportation Review, 136, Article 101922.[CrossRef] [PubMed]
- Khelifa, A., Hamrouni, T., Mokadem, R., & Ben Charrada, F. (2020). SLA-aware task scheduling and data replication for enhancing provider profit in clouds. Procedia Computer Science, 176, 3143–3152.[CrossRef]
- Mokadem, R., & Hameurlain, A. (2020). A data replication strategy with tenant performance and provider economic profit guarantees in cloud data centers. Journal of Systems and Software, 159, Article 110447.[CrossRef]
- Kaseb, M. R., Khafagy, M. H., Ali, I. A., & Saad, E. M. (2019). An improved technique for increasing availability in big data replication. Future Generation Computer Systems, 91, 493–505.[CrossRef]
- Kiil, K., Dreyer, H. C., Hvolby, H.-H., & Chabada, L. (2018). Sustainable food supply chains: The impact of automatic replenishment in grocery stores. Production Planning & Control, 29(2), 106–116.[CrossRef]
- Mou, S., Robb, D. J., & DeHoratius, N. (2018). Retail store operations: Literature review and research directions. European Journal of Operational Research, 265(2), 399–422.[CrossRef]
- Bendoly, E., Craig, N., & DeHoratius, N. (2018). Consistency and recovery in retail supply chains. Journal of Business Logistics, 39(1), 26–37.[CrossRef]
- Ferreira, L., Coelho, F., Alonso, A. N., & Pereira, J. (2019). Towards intra-datacentre high-availability in CloudDBAppliance. In Proceedings of the 9th International Conference on Cloud Computing and Services Science. SciTePress.[CrossRef]
- Chen, Y.-J., & Tsai, H. (2019). Implementation and verification of high data availability on database. Transactions on Networks and Communications, 7(5).[CrossRef]
- Castro-Medina, F., Rodríguez-Mazahua, L., Abud-Figueroa, M. A., Romero-Torres, C., Reyes-Hernández, L. A., & Alor-Hernández, G. (2019). Application of data fragmentation and replication methods in the cloud: A review. In 2019 International Conference on Electronics, Communications and Computers (CONIELECOMP) (pp. 47–54). IEEE.[CrossRef]
- Gopinath, S., & Sherly, E. (2018). A dynamic replica factor calculator for weighted dynamic replication management in cloud storage systems. Procedia Computer Science, 132, 1771–1780.[CrossRef]
- Verbitski, A., Gupta, A., Saha, D., Corey, J., Gupta, K., Brahmadesam, M., Mittal, R., Krishnamurthy, S., Maurice, S., Kharatishvili, T., & Bao, X. (2018). Amazon Aurora: On avoiding distributed consensus for I/Os, commits, and membership changes. In Proceedings of the 2018 International Conference on Management of Data (pp. 789–796). Association for Computing Machinery.[CrossRef]
- Taft, R., Sharif, I., Matei, A., VanBenschoten, N., Lewis, J., Grieger, T., Niemi, K., Woods, A., Birzin, A., Poss, R., Bardea, P., Ranade, A., Darnell, B., Gruneir, B., Jaffray, J., Zhang, L., & Mattis, P. (2020). CockroachDB: The resilient geo-distributed SQL database. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data (pp. 1493–1509). Association for Computing Machinery.[CrossRef]
- Bacon, D. F., Bales, N., Bruno, N., Cooper, B. F., Dickinson, A., Fikes, A., Fraser, C., Gubarev, A., Joshi, M., Kogan, E., Lloyd, A., Melnik, S., Rao, R., Shue, D., Taylor, C., van der Holst, M., & Woodford, D. (2017). Spanner: Becoming a SQL system. In Proceedings of the 2017 ACM International Conference on Management of Data (pp. 331–343). Association for Computing Machinery.[CrossRef]
- Hofmann, E. (2017). Big data and supply chain decisions: The impact of volume, variety and velocity properties on the bullwhip effect. International Journal of Production Research, 55(17), 5108–5126.[CrossRef]
- Mahfoud, Z., & Nouali-Taboudjemat, N. (2019). Consistency in cloud-based database systems. Informatica, 43(3), 313–319.[CrossRef]
- Mealha, D., Preguiça, N., Gomes, M. C., & Leitão, J. (2019). Data replication on the cloud/edge. In Proceedings of the 6th Workshop on Principles and Practice of Consistency for Distributed Data. Association for Computing Machinery.[CrossRef]