Article

October 27, 2026

Applied Chaos Engineering: Comparison of Network Partition Tolerance in Elasticsearch and MongoDB

Laiza Aparecida Paulino da Silva; Carolina Rutili de Lima

DOI: 10.22167/2675-6528-202601083

Article prepared by the ResumeAI tool, an artificial intelligence solution developed by the Pecege Institute focused on synthesis and writing.

Summary

The study conducted a comparative analysis between Elasticsearch and MongoDB under controlled network failures, considering the impacts on availability and consistency. The objective was to verify which guarantee each database prioritized in the presence of network partitioning, based on the CAP theorem. To this end, an experimental approach was adopted in a Kubernetes environment, where a backend application developed in Node.js, using the gRPC protocol, interacted with distributed instances of Elasticsearch and MongoDB. The Chaos Mesh tool was employed to inject controlled failures, such as latency, network partitions, and abrupt failures, simulating degradation scenarios. Latency and error metrics were collected via Prometheus and visualized in Grafana. The results highlighted behavioral distinctions between the systems. Elasticsearch prioritized consistency, which resulted in interruptions in persistence and replication, as well as degradation of availability in several scenarios of partitioning and latency injection, with the occurrence of timeouts. In contrast, MongoDB demonstrated a greater balance between consistency and availability, maintaining service continuity with high latencies and less impact on availability, showing faster recovery in scenarios of primary node failure and packet loss. The observed differences reflected the architectural decisions of each distributed system. The research provided empirical evidence on how these decisions manifest in practice, highlighting the role of chaos engineering in assessing resilience and identifying critical behaviors in distributed systems.

Keywords: Consistency; Availability; Kubernetes; Resilience; CAP Theorem.

1. Introduction

Modern software systems operate in distributed environments, an architecture that, while offering scalability and resilience, introduces inherent complexities in coordination and communication (Steen & Tanenbaum, 2023). The growing demand for applications capable of processing large volumes of data and supporting high concurrency drives the adoption of distributed databases, which have become the backbone of critical infrastructures. However, the interconnected nature of these environments makes them susceptible to communication failures. The stability and performance of these infrastructures are directly impacted by how they manage the fundamental requirements of consistency, availability, and partition tolerance, concepts formalized by the CAP theorem, a pillar of distributed systems engineering.

The CAP theorem, introduced by Brewer (2012), is often misinterpreted as a binary choice between two of three attributes. In reality, it postulates that, in a network partition scenario, where communication between nodes is interrupted, a distributed system cannot simultaneously guarantee full consistency and total availability. Consistency refers to the guarantee that all reads will return the most recent data. Availability ensures that the system remains operational and responds to all requests. Partition tolerance is the system’s ability to continue operating despite communication failures. Faced with a partition, developers must prioritize one of these guarantees, as it is impossible to maintain both in their entirety, implying critical “trade-offs”, such as the risk of inconsistent data or compromised access (Rodrigues, 2025).

The theoretical understanding of the CAP theorem’s “trade-offs” is complemented by the practical need to test and validate the behavior of distributed systems under adverse conditions. It is in this context that chaos engineering emerges as a systematic approach to identify vulnerabilities and build more resilient systems. This discipline gained notoriety with Netflix’s experience in 2008, when the company faced significant instabilities after migrating to the cloud. This spurred the development of tools to inject controlled failures and consolidate a culture of resilience (Rosenthal & Jones, 2020). The central premise is that failures are an inevitability in complex systems (Richards & Ford, 2024). By proactively simulating failures such as latency, packet loss, or network partitions in a controlled environment, teams can observe the system’s reaction, identify weak points, and implement improvements to ensure the robustness and availability of the service.

The joint application of the CAP theorem and chaos engineering is crucial for evaluating the resilience of distributed databases, fundamental components in microservices and cloud architectures. Recent empirical studies explore this intersection, such as the validation of the CAP theorem in systems like Cassandra, which demonstrated the impact of consistency on latency and the role of dynamic “timeouts” in optimizing availability (Gorbenko & Tarasyuk, 2020). Research on latency injection in cloud APIs has also revealed non-linear impacts on performance and availability (Ahmad et al., 2024). These works underscore the importance of understanding the nuances of each system’s behavior under stress, especially for databases like Elasticsearch and MongoDB, whose architectural decisions directly influence their consistency and availability priorities.

Despite the growing literature on distributed systems and chaos engineering, a detailed empirical comparative analysis of the behavior of widely used databases, such as Elasticsearch and MongoDB, under controlled network failure scenarios still presents gaps. The complexity of their architectures demands in-depth investigation so that developers and architects can make informed decisions. The present research is justified by the need to provide empirical evidence on how the architectural decisions of Elasticsearch and MongoDB manifest in practice in network partition tolerance. Thus, the objective of this study is to comparatively analyze the behavior of Elasticsearch and MongoDB in the face of controlled network failures, verifying which guarantee each database prioritizes in the presence of network partition, based on the CAP theorem.

2. Material and Methods

This study was characterized as an experimental research, focused on the implementation of practical tests to evaluate network partition tolerance in distributed database systems. The methodological approach employed chaos engineering, a discipline that simulates controlled failures to identify vulnerabilities and enhance the resilience of complex systems. The central objective was to comparatively analyze the behavior of Elasticsearch and MongoDB under adverse network conditions, verifying which guarantee each database prioritizes in the presence of a partition, according to the principles of the CAP theorem. This methodology allowed for a rigorous empirical investigation of the systems’ responses to communication interruptions.

The research was conducted in a local Kubernetes cluster environment, specifically configured to replicate production scenarios of distributed systems. This environment provided the necessary infrastructure for the deployment and orchestration of the databases and the test application. The unit of analysis consisted of the behavior of distributed instances of Elasticsearch and MongoDB, observed individually under controlled network failure injection. The execution period of the experiments was not explicitly detailed in the TCC, but the experimental nature implies a period of controlled and repetitive tests for each scenario.

The implementation of the experimental system involved the development of a “backend” application in Node.js, designed to simulate a message exchange environment. For communication between client and server, the gRPC protocol was used, chosen for its support of advanced features such as bidirectional “full-duplex” communication and internal “streaming”, which allow simultaneous requests and responses. Node.js’s asynchronous architecture and its “event loop” model ensured non-blocking operations, essential for isolating database behavior during network partition simulations and stress conditions.

The data generated by the test application were alternately stored in MongoDB and Elasticsearch, both configured in distributed mode to simulate production environments. For controlled fault injection and chaos scenario simulation, the Chaos Mesh tool was employed. This tool was integrated directly into the Kubernetes environment, allowing precise manipulation of network and communication conditions between the database nodes and the application, which were running in containers. Chaos Mesh enabled the controlled creation of network partitions, latency, and packet loss.

The database configurations were meticulously defined to ensure equivalence and realism in the tests. Elasticsearch was configured with three nodes, one “master” and two “data nodes”, using 20 GB persistent volumes provisioned by “Local Path Provisioner” and Zen2 discovery orchestration. Each Elasticsearch pod received 2 CPU and 4 GB of RAM. MongoDB, in turn, was configured as a ReplicaSet with three members (“primary”, “secondary”, “arbiter”), using 10 GB of persistent volumes via Rook-Ceph and discovery orchestration based on priority and voting. Each MongoDB pod was allocated 1 CPU and 2 GB of RAM.

Five distinct test scenarios were developed to evaluate the tolerance of databases to network partitions. These scenarios included: a 75% partition between the database and the application, a partition between the nodes of the “cluster” itself, injection of 2 seconds of latency, loss of 20% of network packets, and simulation of primary node failure. Each scenario was designed with the objective of simulating extreme network degradation conditions, allowing observation of the impacts on data consistency and availability, as well as the systems’ recovery capability.

The research execution followed a sequence of well-defined steps, according to the established methodological flow. Initially, the implementation and detailed configuration of the test environment were carried out. Subsequently, the rigorous definition of failure scenarios, which guided the chaos engineering experiments, was proceeded. The third stage consisted of the controlled execution of these chaos tests, injecting the planned failures into the systems. Afterwards, the systematic collection of performance and error data was performed, culminating in the in-depth analysis phase of the obtained results.

During the execution of the experiments, performance and behavior metrics were collected in real-time using monitoring tools. Prometheus was employed for the collection and storage of time-series data, while Grafana was used for the visual representation and analysis of this data. Each chaos test lasted 15 minutes, with metrics recorded at three crucial moments: before, during, and after the fault injection. This approach allowed for a detailed observation of the system’s response to stress conditions and its subsequent recovery.

The selected metrics for measuring the results focused on latency and observed errors. Specifically, we analyzed the replication latency between cluster nodes, the latency of successful persistence operations, the latency of persistence operations that resulted in errors, and the count of different types of recorded errors. These metrics were crucial for evaluating the impact of failure scenarios on system behavior, encompassing both the performance of write operations and data propagation between nodes, as well as the occurrence of application request failures.

To simulate a realistic load environment during testing, a massive message sending scenario was implemented. Three users were simulated, continuously sending messages and remaining connected to the real-time message “stream”. This procedure ensured that the databases and the application were subjected to a consistent workload while failures were injected. The focus of observability during this load included replication and insertion latency, API errors, and leader node stability, providing a comprehensive view of the system’s behavior under stress.

The analysis of the collected data was performed comparatively, identifying the behavior of each database (Elasticsearch and MongoDB) in the face of simulated failures and their respective impacts on consistency and availability. This analysis was complemented by theoretical references on the concepts of the CAP Theorem and the specific architectural characteristics of each system. The approach allowed for the evaluation of the databases’ resilience and their suitability for partition tolerance scenarios in distributed environments, providing empirical evidence on the priorities of each system in the face of network interruptions.

3. Results and Discussion

This section describes the results obtained in this work from the chaos tests on the configured infrastructure, validating the defined scenarios to compare the observed behavior in Elasticsearch and MongoDB. The in-depth analysis of the collected data allows for a detailed understanding of the consistency and availability priorities of each system in the face of network partitions, according to the principles of the CAP Theorem. The chaos engineering methodology, employed to simulate controlled failures, revealed nuances in the databases’ behavior that would be difficult to identify in conventional testing environments, providing a robust empirical basis for subsequent discussions.

The “backend” application for message exchange, available at https://github.com/laizapaulino/app-chat, was developed consisting of two gRPC APIs that were packaged in Docker containers and deployed on a local Kubernetes cluster. The choice of gRPC, with its support for “full-duplex” bidirectional communication and internal “streaming”, was strategic to simulate a real-time message exchange environment, where latency and consistency are critical metrics. The Unary API, operating in the traditional “request-response” model, establishes and terminates a new connection for each message sending, while the API with “Server-side Streaming” maintains a persistent connection, allowing asynchronous data transfer from the server to the client. These two communication modalities were essential to test the impact of network failures on different interaction paradigms, reflecting common scenarios in modern distributed applications. The robustness of Node.js’s asynchronous architecture, with its “event loop” model, ensured that non-blocking operations could isolate the behavior of databases under stress, allowing the effects of network partitions to be attributed directly to the characteristics of the persistence systems, and not to bottlenecks in the intermediate application.

To ensure that the scenarios matched a production environment, the databases were configured as “Stateful Sets”, ensuring that each node maintained a fixed and unique name, as well as persistent data linked even after restarts. This configuration is vital in distributed systems, as it allows nodes to be restarted or reallocated without loss of identity or data, a fundamental requirement for resilience. The detailed configuration, presented in Table 1, demonstrates the equivalence of the test environments for Elasticsearch and MongoDB, despite their inherent architectural differences. Elasticsearch, with three nodes (one “master” and two “data nodes”) and 20 GB persistent volumes, was allocated 2 CPU and 4 GB RAM per pod, while MongoDB, configured as a ReplicaSet with three members (“primary”, “secondary”, “arbiter”) and 10 GB persistent volumes, received 1 CPU and 2 GB RAM per pod. These specifications were carefully balanced to allow a fair comparison of the systems’ behavior under the same network stress conditions, despite distinct resource demands and replication models. The Zen2 discovery orchestration for Elasticsearch and priority and voting-based for MongoDB reflects each system’s native approaches to cluster management and leader election, crucial aspects in fault and partition tolerance.

Table 1: Configuration used in the Elasticsearch and MongoDB databases.

Characteristic

Elasticsearch

MongoDB

Cluster architecture

3 nodes (1 “master”, 2 “data nodes”)

ReplicaSet with 3 members (“primary”, “secondary”, “arbiter”)

Persistent volumes

20 GB using “Local Path Provisioner”

10 GB using Rook-Ceph

Discovery orchestration

Zen2

ReplicaSet with priority and voting

Resources by pod

2 CPU / 4 GB per “pod”

1 CPU / 2 GB per “pod”

Source: Original research results.

The 75% partition scenario between database and application primarily aimed to evaluate network isolation, analyzing how the database cluster behaves when faced with partially blocked communication with the application. This scenario simulated a temporary unavailability in the application layer, allowing observation of the impacts on persistence and interaction with the database. The expectation was data loss sent to the /sendMessage endpoint and temporary interruption of the stream from the /receiveMessage endpoint, without compromising the integrity of the application or the cluster. This expectation aligns with the CAP Theorem, which postulates that in a partition scenario, a system must choose between consistency and availability. In this case, the partition between the application and the database would force a choice, and the expectation was that cluster integrity would be maintained (consistency), even at the expense of temporary availability for the application.

As presented in Figure 1 and Table 2, the data replication latency in Elasticsearch was interrupted for 3 minutes and 45 seconds during the chaos interval, reaching recovery in the final interval. In the final interval, the percentiles showed lower latencies than in the interval preceding the chaos. This prolonged interruption of replication in Elasticsearch, even if temporary, suggests a prioritization of consistency over immediate availability of write and replication operations. The system chose to wait for the resolution of the partition or the re-establishment of communication to ensure that data was replicated consistently across nodes. This behavior is a direct reflection of Elasticsearch’s architecture, which, although a distributed system designed for high availability, tends to favor eventual consistency and data integrity in partition scenarios. The recovery with lower latencies at the end of the experiment may indicate that the system managed to optimize its communication routes or that the workload was processed more efficiently after network stabilization, demonstrating its capacity for self-organization and adaptation to normal operating conditions after a chaos event. The literature corroborates that systems prioritizing consistency may experience interruptions during partitions but guarantee data integrity (Brewer, 2012).

Source: Original research results

Figure 1. Replication Latency – 75% Partition Scenario – Elasticsearch

Table 2. Replication Latency – 75% Partition Scenario – Elasticsearch

Break

P50 (ms)

P95 (ms)

P99 (ms)

0 – 5 min

129-146

283-286

297-299

5-6:15 minutes

133-143

286-287

298-338

6:15 – 10 minutes

10-15 minutes

82,1 – 82,8

266-275

293 – 299

Source: Original research results

In contrast, in the test with MongoDB, according to Figure 2 and Table 3, replication interruption occurred during 4 minutes of the chaos interval, recovering in the last minute of the interval. In the final interval, replication had already been completely re-established with latency values slightly higher than in the initial interval. Although there was also an interruption, MongoDB’s faster recovery, with latencies returning to near-initial levels, suggests a slightly different approach regarding the CAP Theorem. MongoDB, as a document-based NoSQL system, is often configured to prioritize availability over strong consistency in partition scenarios, allowing writes even when replication is compromised, and resolving inconsistencies later (Steen & Tanenbaum, 2023). The ability to recover and stabilize replication in a relatively short period, even with network partitioning, indicates that MongoDB may be more resilient in terms of service continuity, even if this may imply windows of inconsistency during the failure period. The observation of slightly higher latencies in the final interval, compared to the initial one, can be attributed to an additional effort by the system to synchronize the data accumulated during the partition, a “catch-up” that is expected in systems that prioritize availability.

Source: Original research results

Figure 2. Replication Latency – 75% Partition Scenario – MongoDB.

Table 3. Replication Latency – 75% Partition Scenario – MongoDB.

Break

P50 (ms)

P95 (ms)

P99 (ms)

0 – 5 min

5,28 – 5,35

12,4 – 38

45,8 – 59,3

5 to 9 minutes

9 – 10 minutes

5,43 – 5,48

30,3 – 38,7

84,8 – 85,8

10 – 15 minutes

5,45 – 5,56

23,2 – 34,5

47,3 – 81,4

Source: Original research results.

Regarding latency in persistence requests, as shown in Figure 3, in Elasticsearch, the latency record for successful responses was interrupted during chaos, with an isolated peak in P99 of just over 7 seconds at the beginning of recovery, followed by stabilization. During chaos, all persistence attempts in Elasticsearch failed. Error responses from the endpoint had constant latency, reaching close to 1 minute. This observation reinforces Elasticsearch’s prioritization of consistency. The complete interruption of persistence operations during the partition means the system refused to accept new writes that could not be immediately replicated or confirmed according to its consistency guarantees. This prevents the introduction of inconsistent data or the creation of “split-brain” scenarios, where different parts of the cluster have conflicting views of the data. However, this choice comes at a direct cost to application availability, as it cannot persist data during the chaos event. The P99 latency peak during recovery indicates a period of system overload or readjustment, where pending or new requests were processed with significant delay before stability was re-established. The constant and high error latencies, close to 1 minute, suggest that the application was waiting for a long period for a database response before logging the failure, which can impact user experience and overall application performance in failure scenarios. Richards and Ford (2024) emphasize that chaos engineering reveals that failures are inevitable, and how a system reacts to them defines its resilience. In this case, Elasticsearch’s resilience is manifested in protecting consistency, even if it means a temporary interruption of availability.

Source: Original research results

Figure 3. Response latency for persistence – 75% Elasticsearch Partition Scenario.

The synthesis of the observed behavior in this 75% partition scenario between database and application revealed an alignment with expectations, where message loss due to persistence interruption directly impacted operation availability. MongoDB demonstrated faster recovery and more predictable behavior compared to Elasticsearch, where replication interruption occurred later. In both cases, the impact was limited to communication, without compromising cluster integrity, meaning data consistency within the cluster was preserved. This result is crucial as it indicates that, although application availability may be affected, the fundamental integrity of data in the distributed database was not compromised. The difference in recovery speed and behavioral predictability between the two systems can be attributed to their underlying design philosophies regarding the CAP Theorem. MongoDB, with its ReplicaSet architecture, may be more prone to allowing writes to a primary node even with partitions, resolving inconsistencies later, which translates to higher availability but with a potential risk of eventual inconsistency. Elasticsearch, on the other hand, with its strong emphasis on eventual consistency and index integrity, may prefer to halt write operations until consistency can be guaranteed, resulting in lower availability during the partition. Gorbenko and Tarasyuk (2020) observed in their studies with Cassandra that consistency levels directly impact latency, and the choice between consistency and availability is an inherent “trade-off” in distributed systems. The practical implications of these findings are significant for system architects: the choice between Elasticsearch and MongoDB must consider not only performance and scalability characteristics but also acceptable tolerance for interruptions and the priority between consistency and availability in network failure scenarios. For applications requiring continuous high availability, even with the risk of temporary inconsistency, MongoDB may be more suitable. For applications where data consistency is paramount, and temporary interruptions are acceptable, Elasticsearch may be the preferred choice.

The partition scenario between the “cluster” nodes aimed to evaluate internal network isolation, analyzing how the database “cluster” reacts to communication interruptions between its own nodes. This scenario simulated an internal partition in the “cluster”, allowing observation of the effects on data replication, consistency, and availability. The expectation was the formation of a replication “gap”, followed by a new master node election, with possible temporary unavailability of read and write operations. In Elasticsearch, stable latency was observed most of the time, with a peak at the beginning of the chaos interval before the master node switch, indicating consistency degradation. After the switch, latency returned to stability, presenting lower across all percentiles. This behavior suggests that Elasticsearch, upon detecting the internal partition, prioritized the election of a new master and the cluster’s re-stabilization, even if it implied a brief period of elevated latency and consistency degradation. The recovery with lower latencies after the new master election may indicate an optimization in internal communication or a more efficient cluster reconfiguration. The temporary unavailability of write operations, lasting approximately 15 seconds, characterized an availability interruption, and the increase in replication latency between nodes indicated a slight degradation of consistency over the period. During this scenario, Elasticsearch presented 36 occurrences of message sending “timeouts”, due to the application’s inability to communicate with the database during the new master node election. This demonstrates that, even with consistency being internally prioritized, external availability for the application was compromised.

In MongoDB, the test started with a latency spike across all percentiles, showing variations in all intervals. After the master node switch at the beginning of the chaos, P99 specifically presented a slightly higher latency that persisted until the end. MongoDB registered only one latency spike, without interruption of operations, and there was no replication interruption in any of the databases, even during the election of a new leader node. This indicates a maintenance of consistency, albeit with temporary performance variations. MongoDB’s behavior, with its ability to keep write and replication operations active during the election of a new primary, even with latency spikes, reflects a prioritization of availability. Although latency increased, the service remained operational, which is an acceptable “trade-off” in many distributed systems scenarios. The occasional errors observed in MongoDB (1 in message sending and 3 in receiving) were attributed to user disconnections due to the absence of persistent new data transmission, and not to direct “timeouts” between the application and the database. This suggests that MongoDB managed the internal partition to minimize direct impact on application communication, although user experience may have been affected by the lack of new data. The comparative analysis in this scenario reinforces that Elasticsearch tends to be more conservative, prioritizing data consistency and integrity at the cost of availability interruptions, while MongoDB seeks to maintain availability, even if it implies temporary consistency degradation or high latency. Rodrigues (2025) highlights that understanding these “trade-offs” is crucial for building resilient systems.

The 2-second latency injection scenario aimed to evaluate the system’s limits, observing the application and database cluster behavior under progressively increasing latency. The expectation was that increased latency would result in elevated API response times, potentially causing temporary failures as the system’s operational limits were reached. In Elasticsearch, replication was interrupted for approximately 4 minutes during the chaos period, recovering in the last minute. During the recovery interval, stability returned, with latency slightly lower than in the initial interval. Persistence also experienced unavailability for about 4 minutes, with errors recorded at a stable latency close to 1 minute. Elasticsearch experienced 36 “timeouts” on message reception and 33 on transmission, due to the inability to identify the primary node during the chaos. This behavior is consistent with prioritizing consistency: the system, when facing severe latency, opts to halt operations to prevent the propagation of inconsistent data or the formation of “split-brain”. The prolonged interruption of replication and persistence, along with the “timeouts”, demonstrates that Elasticsearch is sensitive to network latency, and its resilience manifests in protecting data integrity, even if it means temporary service interruption.

In MongoDB, there was no interruption of replication. With the chaos injection, an immediate increase in latency was observed, which remained with little variation until the middle of the interval, indicating consistency degradation. From that point on, the P95 and P99 percentiles showed a reduction, approaching the P50 values, which indicates stabilization of behavior. Recovery occurred during the chaos interval itself. Persistence latency showed a constant increase during the chaos, with recovery near the end of the period and return to values similar to those of the initial interval. In MongoDB, no error responses were observed on the “endpoints”, nor occurrences of “timeout” or primary node switch. This behavior of MongoDB, maintaining the availability of replication and persistence operations even under high latency, reinforces its prioritization of availability. Although consistency may have been degraded due to increased latency and slower data propagation, the service remained operational. This is a classic example of the CAP “trade-off”, where partition tolerance and availability are favored, allowing the system to continue functioning, even with degraded performance. Ahmad et al. (2024) observed that latency injection can affect availability non-linearly, and MongoDB appears to manage this degradation more gracefully in terms of service continuity.

The 20% packet loss scenario aimed to evaluate the system’s limits in the face of network degradation, directly affecting message exchange between database nodes, including data replication and state synchronization. The expectation was that progressive packet loss would generate temporary inconsistencies and intermittent API failures, allowing identification of the point at which network degradation would effectively impact the operation of the application and the “cluster”. In Elasticsearch, replication latency peaked in the first minute, followed by replication interruption. During the recovery interval, replication was re-established, showing a slight reduction in latency. Persistence latency peaked followed by an abrupt drop, before data insertion was interrupted until the end of the interval. P99 registered a peak of approximately 26 seconds at the beginning of the final interval. During chaos injection, Elasticsearch experienced 37 “timeouts” in message reception and 32 in sending, as the application failed to identify the primary node. This scenario reinforces Elasticsearch’s sensitivity to packet loss, resulting in significant interruptions in replication and persistence. The prioritization of consistency causes the system to fail explicitly when communication integrity is compromised, rather than operating with potentially inconsistent data.

In MongoDB, there was no interruption of replication. Throughout the chaos interval, an increase in latency was observed across all percentiles, more pronounced at P99, which showed variations between 3.5 and 4 seconds. Latency stabilized at levels higher than those in the initial interval. Persistence latency showed variations in the P95 and P99 percentiles during the chaos interval, with peaks close to 3 seconds. No errors were recorded in the MongoDB tests. MongoDB’s behavior in this scenario, maintaining the availability of replication and persistence operations even with packet loss but with elevated latencies, is a clear indication of its prioritization of availability. The system continues to operate, accepting temporary consistency degradation and increased latency as a “trade-off” to ensure service continuity. The absence of “timeouts” and explicit API errors, in contrast to Elasticsearch, demonstrates greater resilience in terms of operational continuity, although service quality (latency, data consistency) is affected.

The primary node failure scenario aimed to evaluate the system’s resilience in the face of the “cluster’s” leader node unavailability. The injected chaos consisted of the abrupt shutdown of the primary MongoDB node and the isolation of the Elasticsearch master node. The expectation was that the “cluster” would automatically elect a new leader node, preserving data integrity and maintaining the continuity of read and write operations whenever possible, even with temporary impact. In Elasticsearch, during the first 45 seconds of the chaos interval, all percentiles showed a latency spike before the master node switch. After the election, behavior returned to patterns similar to the initial interval. Data persistence suffered an interruption of approximately 15 seconds at the beginning of the chaos interval, resuming shortly after, with a latency spike at P99. Some requests returned errors with high latency for about 1 minute and 15 seconds. Only the message sending “endpoint” presented “timeout” errors, totaling 35 occurrences, concentrated at the beginning of the chaos period and persisting for approximately 1 minute and 15 seconds. Elasticsearch, in this scenario, demonstrated lower resilience compared to MongoDB. The brief interruption of operations during the primary node switch and the persistence of errors after the application’s recovery indicate a temporary compromise in availability, although consistency was maintained. The prioritization of consistency, even in the face of a primary node failure, leads to a more notable service interruption.

In MongoDB, during the chaos period, the primary node was swapped, accompanied by greater latency variation. In the recovery interval, P50 and P99 percentiles showed distinct behaviors, with P50 increasing in steps and P99 with peaks followed by drops. During persistence, there was no interruption, and P50 and P95 percentiles showed low variation, while P99 registered more pronounced variations, with the highest peak shortly after the chaos began. The loss of the primary node resulted in 3 errors in message reception at the beginning of the chaos period, related to user disconnections. No “timeout” errors were observed. MongoDB’s behavior was distinct, with minimal impact. The identified error was not directly related to the database, but to the application itself, which forced the disconnection of the “stream” due to the absence of transmission of new persisted data in connections prior to the primary node swap. Although there was variation in persistence and replication latency, this variation was negligible, not compromising availability and with no signs of relevant degradation in consistency. MongoDB, with its automatic election of a new primary and the ability to maintain write operations, even with latency variations, demonstrates greater resilience and prioritization of availability. The minimal interruption and absence of direct “timeouts” are evidence that the system was able to quickly adapt to the main node failure, maintaining service continuity.

By consolidating the obtained results, it was possible to observe how each database behaved when faced with different types of failures, highlighting the inherent “trade-offs” in distributed systems. The comparative analysis revealed that Elasticsearch consistently prioritized consistency across all evaluated scenarios. This manifested through interruptions in persistence and replication, occurrence of errors and “timeouts” in situations of network partition and primary node failure. Although this approach ensures data integrity, it frequently resulted in temporary compromise of operational availability for the application. For example, in the scenario of a 75% partition between the database and the application, persistence in Elasticsearch became unavailable, with high error latencies, indicating that the system preferred to cease operations rather than risk inconsistency. This strategy aligns with the view that consistency is a fundamental pillar, and that unavailability is an acceptable price to maintain it (Brewer, 2012).

In contrast, MongoDB demonstrated a clear prioritization of availability in most scenarios. In situations of network partitioning, latency injection, and packet loss, MongoDB maintained replication and persistence operations active, albeit with consistency degradation manifested by high latencies and response time variations. In the scenario of primary node failure, MongoDB exhibited a balanced behavior, maintaining operations with a punctual impact on stream availability, but without total interruption. This reflects an architecture that seeks service continuity, even if it means eventual or delayed consistency. MongoDB’s ability to recover more quickly and maintain operations, even under stress, makes it a robust choice for applications requiring high continuous availability, where small windows of inconsistency are tolerable. Steen and Tanenbaum (2023) argue that distributed systems are inherently unreliable, and the choice between consistency and availability is a fundamental design decision.

The comparison between the databases highlights that there is no universally superior solution, but rather architectural choices that align with different business requirements. For applications where data integrity is absolutely critical and temporary interruptions are acceptable, Elasticsearch, with its prioritization of consistency, may be the most suitable choice. This includes search and log analysis systems where index consistency is vital. On the other hand, for applications that demand high availability and partition resilience, where eventual consistency is acceptable, MongoDB proves more advantageous. Examples include e-commerce platforms or real-time messaging systems, where service continuity is paramount, even if some data may be temporarily outdated. Chaos engineering, by exposing these “trade-offs” under controlled conditions, provides valuable insights for architectural decision-making, allowing developers and architects to choose the technology that best suits the specific needs of their distributed systems, considering the balance between consistency, availability, and partition tolerance.

4. Conclusion

It is concluded that the objective was achieved, as this study comparatively analyzed the behavior of Elasticsearch and MongoDB in the face of controlled network failures, verifying the consistency and availability priorities of each database in the presence of network partitioning, based on the CAP theorem. The results demonstrated that Elasticsearch consistently prioritized consistency, manifested by interruptions in operations and occurrence of errors, temporarily compromising availability. In contrast, MongoDB prioritized availability, keeping operations active even under stress, albeit with degradation of consistency and high latencies. Chaos engineering revealed critical resilience nuances, exposing the inherent “trade-offs” of each architecture in adverse scenarios.

However, this study had as a limitation the emphasis on the tolerance to network partition (P) of the CAP theorem, with the aspects of consistency (C) and availability (A) being analyzed mainly as a function of the partition. For future studies, it is suggested to broaden the analysis to the other aspects of the CAP theorem, investigating C and A in a more isolated way, without the need for inducing network failures. Scenarios of reducing write and read acknowledgment levels in both databases can be evaluated to observe the impact on latency and availability. Additionally, exploring high write concurrency contexts without network partitioning would allow understanding how systems manage conflicts and the order of operations, deepening the understanding of the balance between consistency and availability under load.

Bibliographic References

Al-Said Ahmad, A.; Al-Qora’n, L. F.; Zayed, A. (2024). Exploring the impact of chaos engineering with various user loads on cloud native applications: an exploratory empirical study. Software Quality Journal, v. 106, n. 7. Springer Science+Business Media.

Brewer, E. A. (2012). CAP Twelve Years Later: How the ‘Rules’ Have Changed. Computer, v. 45, n. 2, p. 23-29. IEEE Computer Society.

Gorbenko, A.; Tarasyuk, O. (2020). Exploring Timeout as a Performance and Availability Factor of Distributed Replicated Database Systems. Radio Electronics, Computer Science, Control, v. 4. National Aerospace University – Kharkiv Aviation Institute.

Richards, M

Richards, M.; Ford, N. (2024). Fundamentos da Arquitetura de Software: Uma Abordagem de Engenharia. 1. ed. Alta Books.

Rodrigues, D. (2025). SQL para Big Data: Consultas Otimizadas, Indexação e Escalabilidade. 1. ed. StudioD21.

Rosenthal, C.; Jones, N. (2020). Chaos Engineering. 1. ed. O’Reilly Media.

Van Steen, M.; Tanenbaum, A. S. (2023). Distributed Systems. 4. ed. distributed-systems.net.

Article originating from the Final Course Work of the Specialization in Software Engineering of the MBA USP/Esalq

To learn more about the course, click here and access the MBX Academy platform

You may also like

Executive Mba In Leadership And Management

November 23, 2026

Improvements in the efficiency of a secondary biological sludge drying plant

The management of industrial solid waste, especially secondary biological sludge, represented an operational and strategic challenge for a company in the pulp and paper sector. A secondary biological sludge drying plant, installed to meet environmental requirements and reduce costs, operated with low efficiency and high unavailability. The objective of this study was to evaluate and propose a set of actions to increase the operational availability of the plant, ensure the integral processing of the generated sludge, and reduce treatment and transportation costs, in addition to mitigating environmental risks. To this end, an analysis of the root causes of low efficiency was carried out, using tools such as the cause-and-effect diagram (Ishikawa) and the “5 whys” analysis, and hypotheses were tested to identify the most impactful factors. Three main root causes were identified: addition of low-load effluent to the process, absence of a dedicated maintenance team, and lower consistency of dewatered sludge. The proposed countermeasures, which included stopping the addition of effluent, hiring a maintenance team, and testing polymers, had a monthly implementation cost of R$ 35,000.00. An annual reduction in operating expenses of up to R$ 1,800,000.00 and maintenance costs of R$ 600,000.00 was estimated, in addition to a 25% reduction in operational unavailability. It was concluded that the proposed measures are viable, quick to implement, and capable of ensuring the integral processing of secondary biological sludge, strengthening the company’s ESG strategy and ensuring environmental compliance.

Keywords: Operational costs; Operational efficiency; ESG; Biological sludge; Sludge drying.

Data Science And Analytics For Operations

November 19, 2026

Polyp-YOLO: an efficient, low-latency detector for polyps in colonoscopies

The early detection of colorectal polyps is crucial for the prevention of colorectal cancer, and real-time computer-aided detection (CADe) systems have shown gains in endoscopic practice. The objective was to develop and validate a lightweight colorectal polyp detector, based on the YOLO architecture, capable of operating on restricted hardware with high precision and low latency. The methodology used public datasets of endoscopic images, partitioning the Kvasir-SEG dataset for training and internal validation, and CVC-ClinicDB and ETIS-Larib Polyp DB for cross-dataset evaluation. Lightweight variants of the YOLOv8, YOLO11, and YOLO26 families with 640×640 pixel input were evaluated. A grid search tested 70 combinations of optimizers and activation functions, and identified AdaBelief and LeakyReLU as the configuration with the best generalization. The optimization pipeline applied unstructured pruning, knowledge distillation, and fine-tuning. The optimized YOLO11n-seg model outperformed the higher-capacity architecture (YOLO26m-seg) in mAP50 and showed similar performance in F1-Score, operating with approximately seven times fewer parameters. It achieved an mAP50 of 0.7929 and an F1-Score of 0.7514 on the ETIS-Larib dataset, and fast inference was demonstrated in different formats, with real-time latencies. The explainability of predictions was validated by Grad-CAM activation maps. The proposed solution demonstrated itself to be a promising experimental tool for diagnostic support, with technical feasibility for integration into environments with reduced computational power, although it requires future clinical validation.

Keywords: Computer-aided detection; Edge computing; Hyperparameter optimization; Endoscopic image segmentation; Medical computer vision.

Data Science And Analytics For Operations

November 19, 2026

Multi-touch Attribution in E-commerce: A Comparison between Markov Chains and Last-Click

The research investigated Multi-touch Attribution (MTA) Models in e-commerce, seeking to overcome the limitations of the Last-Click model, widely used in the market. The objective was to compare the performance of first-order Markov Chains with Last-Click and Position-Based approaches, identifying the value of assistance channels frequently ignored. To this end, Markov Chain algorithms were applied to a large volume of purchase journey data from the Google Merchandise Store, extracted via BigQuery. The study probabilistically mapped the purchase journey and calculated the Removal Effect to quantify channel relevance. The results demonstrated that data-driven models identified the strategic role of discovery (awareness) and assistance channels, which Last-Click neglected in 65% of complex journeys. Simulated financial analysis indicated an approximate 28% hidden efficiency in Cost Per Acquisition (CPA) for Paid Search, compared to the Last-Click model. It was concluded that Markov Chains allowed for a more accurate mapping of purchase journeys, validating the technical feasibility of the modeling and providing evidence for more efficient budget allocation in digital media, mitigating the risk of early divestment in crucial channels.

Keywords: Assistance channels; Data science; E-commerce; Digital marketing; Media optimization.

Project Management

November 19, 2026

Integrated Software for Operational Communication and Control: Practical Evidence in a Medium-Sized Company

The study analyzed the impacts of the lack of integration between commercial and operational modules of an integrated management software (ERP/CRM) in a medium-sized company in the mechanical engineering sector. The main objective was to evaluate practical evidence of communication and operational control optimization, identify bottlenecks, and formulate improvement proposals. A qualitative-quantitative approach was adopted through a single case study with documentary research, based on the extraction and filtering of historical task records from the Bitrix24 software and statistical correlation analysis between workload and allocated team. Based on the diagnosis, an action plan structured in the 5W2H tool was developed. The results revealed that 54.4% of the registered tasks consisted of duplicate, test, or practically useless records, generated by manual insertion during the scope transition between commercial CRM and engineering. It was also demonstrated that the increase in the commercial team linearly accompanied the growth of inefficient tasks, polluting the database and masking the organization’s real productive capacity. It was concluded that the automation of workflows and native integration between modules are essential to mitigate operational and financial risks, providing replicable guidelines for data governance in small and medium-sized enterprises.

Keywords: System Customization; Enterprise Resource Planning (ERP); Task Management; Management Software.

Project Management

November 19, 2026

Supervised learning in voltammetric quantification with electrochemical sensors

The application of supervised learning in the voltammetric quantification of paraquat in artificial urine was evaluated. The study aimed to quantitatively assess the predictive performance of supervised learning models compared to a univariate “baseline”, preserving independence between devices in the training and testing sets. The research was conducted as an applied case study, processing data from four physical devices, each evaluated under a blank condition and six paraquat concentration levels, totaling 28 square wave voltammetry (SWV) curves. A computational “pipeline” integrated automated file reading, organization of curves into current-potential matrices, generation of potential maps, and device-specific blank correction. Five approaches were considered: conventional univariate calibration, predictive univariate “baseline”, partial least squares (PLS) regression, support vector regression (SVR), and random forest (RF). Predictive evaluation was performed using device-grouped cross-validation. PLS showed the best predictive performance for curves from a device not used in training, with an R² of 0.7981. RF exhibited intermediate performance, while SVR and the predictive univariate “baseline” showed inferior and similar performance between themselves. It was concluded that a compact multivariate representation of the voltammetric profile was more favorable for inter-device prediction than increasing model flexibility under the studied conditions. Grouped validation preserved independence, but the limited number of devices restricts the generalization of results.

Keywords: Supervised learning; Paraquat; PLS; Electrochemical sensors; Square wave voltammetry.

Project Management

November 19, 2026

Improvement of Inventory Management via Lean Six Sigma: Study in the Paper Industry

Organizations seek methodologies to reduce waste, increase efficiency, and become more competitive, promoting sustainable improvements in their processes. In this context, the study aimed to apply the Lean Six Sigma methodology, through the DMAIC cycle, to improve inventory management in a company in the paper industry manufacturing pneumatic hoses, aiming to increase the accuracy between physical and systemic inventories and improve the visual management of parts storage. The research was developed from the collection and analysis of data extracted from the company’s ERP system. Tools such as SIPOC, Ishikawa Diagram, and 5 Whys were used to define and identify the root cause of the problem. As improvement proposals, a Digital Kanban system and an adaptation of the Two-Bin system, called the Three-Bin System, were implemented, in addition to the development of standardized operating procedures and the establishment of control mechanisms. The results demonstrated a significant improvement in inventory accuracy, raising the lowest identified index from 28% to 80%, and detected discrepancies between systemic and physical records equivalent to R$ 134,335.53. It was concluded that the application of Lean Six Sigma, combined with Project Management, represented an effective approach for conducting operational improvement projects, contributed to increased reliability of inventory information, to the improvement of material control processes, and to the strengthening of the organization’s operational management.

Keywords: Inventory accuracy; DMAIC; Visual management.

Data Science And Analytics For Operations

November 19, 2026

Predictive Analysis Methodology for Performance Optimization in E-commerce: Correlation between Public Data and Paid Media

A predictive analysis methodology was developed for e-commerce, integrating transactional data and public search trends. The objective was to develop and validate a predictive model, based on machine learning algorithms, capable of correlating organic search trends with sales performance and paid media costs in the Beauty and Health category of Brazilian e-commerce. The Brazilian E-Commerce Public Dataset by Olist and data from Google Trends were used, processed in Python with the Random Forest Regressor algorithm. A moderate inverse correlation (r = -0.43) with a seven-day lag was identified between organic search volume and purchase. Initial models, based solely on behavioral variables, presented insufficient metrics (R² = -0.47; MAE of R$ 2,120.54). The incorporation of microeconomic (average ticket and shipping) and macroeconomic (exchange rate and Ibovespa index) variables raised the R² of the final model to 0.29, with an MAE of R$ 1,489.63, representing a 24.7% reduction in error compared to the baseline. Temporal cross-validation showed that, in periods of mature operation (2018), the model achieved an R² of 0.42. It was concluded that isolated search volume explains the moment of consumer interest, but not the financial magnitude of sales, making the fusion with transactional and economic data mandatory for predictive viability.

Keywords: Beauty and Health; Consumer Behavior; Google Trends; Machine Learning; Time Series.