In partitioned databases, trading some consistency for availability through approaches like BASE (Basically Available Soft-state Eventually Consistent) can improve scalability dramatically. The document discusses strategies for horizontal data scaling such as functional partitioning and sharding. It introduces Brewer's CAP theorem, which states that a distributed system cannot guarantee consistency, availability, and partition tolerance simultaneously. The document then contrasts the ACID and BASE approaches, explaining how BASE sacrifices consistency for higher availability in partitioned databases.
The document discusses various database consistency models including ACID, BASE, and eventual consistency. It describes ACID which provides atomicity, consistency, isolation, and durability but has performance limitations. BASE sacrifices consistency for availability. Eventual consistency guarantees that if no new updates are made, all accesses will eventually return the last value. It also discusses solutions like ACID 2.0 and CRDTs which allow for ACID-like consistency in distributed systems through principles like commutativity and idempotence.
HBase is an open-source implementation of Google's Bigtable storage system and is modeled after Bigtable. It is a distributed, scalable, big data store that allows for storage and retrieval of large amounts of data across clusters of commodity servers. HBase provides a key-value data model and uses Hadoop HDFS for storage. It allows for fast random reads and writes across billions of rows and millions of columns.
The document discusses various database consistency models and proposes a new taxonomy called PACELC.
It notes limitations with the CAP theorem, such as inconsistencies between availability and consistency when there are no network partitions. It introduces PACELC which classifies databases based on their behavior during partitions (P) and without partitions.
The document argues for the viability of P*/EC (eventual consistency) systems, noting they can provide stronger guarantees than most NoSQL databases through determinism, which allows for easier replication and reduces the costs of consistency.
A Critique of the CAP Theorem by Martin Kleppmannmustafa sarac
This document provides a critique of the CAP theorem, which states that a distributed system cannot simultaneously provide consistency, availability, and partition tolerance. The summary analyzes inconsistencies in how CAP is defined and formalized. It surveys different definitions of consistency, availability, and partition tolerance that have been proposed. It also discusses problems with interpreting CAP as proof that eventually consistent systems are always more available than strongly consistent systems. As an alternative to CAP, the document proposes analyzing a system's sensitivity to network delays.
This document discusses NoSQL and big data processing. It provides background on scaling relational databases and introduces key concepts like the CAP theorem. The CAP theorem states that a distributed data store can only provide two out of three guarantees around consistency, availability, and partition tolerance. Many NoSQL systems sacrifice consistency for availability and partition tolerance, adopting an eventual consistency model instead of ACID transactions.
This document discusses mobile database systems and their fundamentals. It describes the conventional centralized database architecture with a client-server model. It then covers distributed database systems which partition and replicate data across multiple servers. The key aspects covered are database partitioning, partial and full replication, and how they impact data locality, consistency, reliability and other factors. Transaction processing fundamentals like atomicity, consistency, isolation and durability are also summarized.
The document discusses distributed algorithms and techniques used in NoSQL databases related to data consistency, data placement, and system coordination. It covers topics such as replication, failure detection, data partitioning, leader election, and consistency models. Specifically, it analyzes various techniques for data replication that provide different tradeoffs between consistency, availability, scalability, and latency such as anti-entropy protocols, master-slave replication, quorum-based replication, and using vector clocks to detect concurrent writes.
Chapter 12 transactions and concurrency controlAbDul ThaYyal
This document provides an overview and summary of key concepts related to transactions and concurrency control in distributed systems:
- Transactions allow a sequence of operations to be atomic and isolated despite crashes or concurrent operations. They ensure objects remain in a consistent state.
- Concurrency control techniques like locking and timestamp ordering ensure transactions are isolated and avoid problems like lost updates or inconsistent retrievals that could occur without synchronization.
- Transactions must commit atomically so their effects are durable even after crashes, or abort with no effect. Serializability ensures transactions have an effect equivalent to running serially one at a time.
The document discusses various database consistency models including ACID, BASE, and eventual consistency. It describes ACID which provides atomicity, consistency, isolation, and durability but has performance limitations. BASE sacrifices consistency for availability. Eventual consistency guarantees that if no new updates are made, all accesses will eventually return the last value. It also discusses solutions like ACID 2.0 and CRDTs which allow for ACID-like consistency in distributed systems through principles like commutativity and idempotence.
HBase is an open-source implementation of Google's Bigtable storage system and is modeled after Bigtable. It is a distributed, scalable, big data store that allows for storage and retrieval of large amounts of data across clusters of commodity servers. HBase provides a key-value data model and uses Hadoop HDFS for storage. It allows for fast random reads and writes across billions of rows and millions of columns.
The document discusses various database consistency models and proposes a new taxonomy called PACELC.
It notes limitations with the CAP theorem, such as inconsistencies between availability and consistency when there are no network partitions. It introduces PACELC which classifies databases based on their behavior during partitions (P) and without partitions.
The document argues for the viability of P*/EC (eventual consistency) systems, noting they can provide stronger guarantees than most NoSQL databases through determinism, which allows for easier replication and reduces the costs of consistency.
A Critique of the CAP Theorem by Martin Kleppmannmustafa sarac
This document provides a critique of the CAP theorem, which states that a distributed system cannot simultaneously provide consistency, availability, and partition tolerance. The summary analyzes inconsistencies in how CAP is defined and formalized. It surveys different definitions of consistency, availability, and partition tolerance that have been proposed. It also discusses problems with interpreting CAP as proof that eventually consistent systems are always more available than strongly consistent systems. As an alternative to CAP, the document proposes analyzing a system's sensitivity to network delays.
This document discusses NoSQL and big data processing. It provides background on scaling relational databases and introduces key concepts like the CAP theorem. The CAP theorem states that a distributed data store can only provide two out of three guarantees around consistency, availability, and partition tolerance. Many NoSQL systems sacrifice consistency for availability and partition tolerance, adopting an eventual consistency model instead of ACID transactions.
This document discusses mobile database systems and their fundamentals. It describes the conventional centralized database architecture with a client-server model. It then covers distributed database systems which partition and replicate data across multiple servers. The key aspects covered are database partitioning, partial and full replication, and how they impact data locality, consistency, reliability and other factors. Transaction processing fundamentals like atomicity, consistency, isolation and durability are also summarized.
The document discusses distributed algorithms and techniques used in NoSQL databases related to data consistency, data placement, and system coordination. It covers topics such as replication, failure detection, data partitioning, leader election, and consistency models. Specifically, it analyzes various techniques for data replication that provide different tradeoffs between consistency, availability, scalability, and latency such as anti-entropy protocols, master-slave replication, quorum-based replication, and using vector clocks to detect concurrent writes.
Chapter 12 transactions and concurrency controlAbDul ThaYyal
This document provides an overview and summary of key concepts related to transactions and concurrency control in distributed systems:
- Transactions allow a sequence of operations to be atomic and isolated despite crashes or concurrent operations. They ensure objects remain in a consistent state.
- Concurrency control techniques like locking and timestamp ordering ensure transactions are isolated and avoid problems like lost updates or inconsistent retrievals that could occur without synchronization.
- Transactions must commit atomically so their effects are durable even after crashes, or abort with no effect. Serializability ensures transactions have an effect equivalent to running serially one at a time.
This document discusses concurrency control in database management systems. Concurrency control addresses conflicts that can occur with simultaneous data access or alteration by multiple users. It ensures transactions are performed concurrently without violating data integrity. The document provides examples of concurrency control issues and describes different concurrency control protocols, including lock-based protocols that use locks to control access to data being read or written, and timestamp-based protocols that use timestamps to determine the order of transactions.
Many real-time systems are naturally distributed and these distributed systems require not only highavailability
but also timely execution of transactions. Consequently, eventual consistency, a weaker type of
strong consistency is an attractive choice for a consistency level. Unfortunately, standard eventual
consistency, does not contain any real-time considerations. In this paper we have extended eventual
consistency with real-time constraints and this we call real-time eventual consistency. Followed by this new
definition we have proposed a method that follows this new definition. We present a new algorithm using
revision diagrams and fork-join data in a real-time distributed environment and we show that the proposed
method solves the problem.
EOUG95 - Client Server Very Large Databases - PaperDavid Walker
The document discusses building large scaleable client/server solutions. It describes breaking the solution into four server components: database server, application server, batch server, and print server. It focuses on the database server, discussing how to make it resilient through clustering and scaleable by partitioning applications and using parallel query options. It also covers backup and recovery strategies.
This document provides an overview of NoSQL databases and key-value stores. It discusses why NoSQL databases were created, examples of different NoSQL categories like key-value stores and document stores. It then focuses on key-value stores like Memcached and MemcacheDB. Memcached is an in-memory key-value store while MemcacheDB provides persistence. Both use the BerkeleyDB for storage with MemcacheDB.
This document discusses techniques for managing dynamic shared state in networked virtual environments. It explains that consistency and throughput cannot both be maximized, and outlines several approaches: shared repositories using centralized servers, blind broadcasting of regular state updates, and dead reckoning where clients predict state between updates. Each technique trades off factors like consistency, scalability, bandwidth usage, and complexity. The optimal choice depends on an application's specific requirements.
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
An introductory overview of distributed systems—what they are and why they're difficult to build. We explore fundamental ideas and practical concepts in distributed programming. What is the CAP theorem? What is distributed consensus? What are CRDTs? We also look at options for solving the split-brain problem while considering the trade-off of high availability as well as options for scaling shared data.
This document discusses cluster computing and provides details on key topics such as:
- What a cluster is and how it links multiple computers together for parallel processing.
- The different types of clusters including high availability, load balancing, and parallel/distributed processing clusters.
- The components that make up a cluster including cluster nodes and network.
- Classifications of clusters as open or closed.
- Applications of clusters such as compute intensive tasks, data intensive tasks, and transaction intensive tasks.
- Benefits of using cluster computing such as great processing power, availability, expandability, reliability and cost efficiency.
Highly available distributed databases, how they work, javier ramirez at teowakijavier ramirez
This document summarizes key aspects of distributed databases. It discusses master-slave and multi-master replication approaches. It then covers the challenges of achieving availability, partition tolerance and consistency as defined by Brewer's CAP theorem. The rest of the document dives deeper into data distribution, replication, conflict resolution, membership protocols, and allowing the system to operate during network partitions or node failures. It provides examples of gossip protocols, vector clocks, hinted handoff, and anti-entropy processes used in distributed databases. Finally, it notes that building these systems requires clients to be aware of some internal workings and allows for extra credit in building your own distributed database.
The document discusses the key goals and challenges of distributed systems. The four main goals are:
1. Connecting users and resources to share resources easily.
2. Transparency by hiding locations of processes and resources.
3. Openness through standard services that are flexible and extensible.
4. Scalability to add more users, resources, and administrative organizations.
The main challenges are that solutions for single systems do not always work for distributed systems, and distributed systems introduce new problems like various failure modes and complex distributed state and management across independent systems.
The document discusses NoSQL databases and Cassandra. It provides background on the rise of NoSQL with the need for large web companies to handle big data in a distributed manner. It introduces the CAP theorem and explains that NoSQL databases sacrifice consistency to achieve availability and partition tolerance. Eventual consistency is described where updates eventually propagate throughout the system. Cassandra is summarized as an open source, distributed, column-oriented database developed at Facebook to be highly scalable and fault tolerant. It uses an eventual consistency model and is robust to failures.
This document discusses configuring Microsoft Distributed Transaction Coordinator (MSDTC) in a SQL Server cluster. It describes setting up an Active Directory domain, installing the Failover Clustering feature and creating a Windows cluster. It also discusses configuring a dedicated MSDTC resource for the cluster, including adding a MSDTC resource to a SQL Server role and configuring its dependencies on a disk and hostname. The document provides best practices for using MSDTC in a clustered SQL Server environment.
- Microsoft SQL Server is a relational database management system developed by Microsoft that allows for storing and retrieving data. It provides scalability, integration with .NET, web services support, and tools for data migration and analysis.
- It includes components like the Database Engine, Integration Services, Analysis Services, and Reporting Services.
- Users connect to SQL Server using a login and are mapped to database users to access specific databases. Databases can be created, backed up, restored, and monitored for slow queries. Backups can also be moved to object storage like Amazon S3.
Megastore providing scalable, highly available storage for interactive servicesJoão Gabriel Lima
The document describes Megastore, a storage system developed by Google to meet the requirements of interactive online services. Megastore blends the scalability of NoSQL databases with the features of relational databases. It uses partitioning and synchronous replication across datacenters using Paxos to provide strong consistency and high availability. Megastore has been widely deployed at Google to handle billions of transactions daily storing nearly a petabyte of data across global datacenters.
The document describes Megastore, a storage system developed by Google to meet the requirements of interactive online services. Megastore blends the scalability of NoSQL databases with the features of relational databases. It uses partitioning and synchronous replication across datacenters using Paxos to provide strong consistency and high availability. Megastore has been widely deployed at Google to handle billions of transactions daily storing nearly a petabyte of data across global datacenters.
This document discusses concurrency control in distributed database systems. It begins by defining a distributed database as a single logical database made up of physically separate databases connected by a network. Concurrency control methods are needed to coordinate simultaneous access by multiple users in a way that maintains consistency. The document then summarizes several prominent distributed concurrency control algorithms: distributed two-phase locking, wound-wait, basic timestamp ordering, and distributed optimistic concurrency control. It notes that these algorithms aim to preserve the ACID properties of atomicity, consistency, isolation, and durability for transactions operating across distributed databases.
Scalable Web Architecture and Distributed Systemshyun soomyung
Scalable web architectures distribute resources across multiple servers to improve availability, performance, reliability, and scalability. Key principles for designing scalable systems include availability, performance, reliability, scalability, manageability, and cost. These principles sometimes conflict and require tradeoffs. To improve scalability, services can be split and data distributed across partitions or shards. Caches, proxies, indexes, load balancers, and queues help optimize data access and manage asynchronous operations in distributed systems.
The document discusses cloud computing and designing applications for scalability and availability in the cloud. It covers key considerations for moving to the cloud like design for failure, building loosely coupled systems, implementing elasticity, and leveraging different storage options. It also discusses challenges like application scalability and availability and how to address them through patterns like caching, partitioning, and implementing elasticity. The document uses examples like MapReduce to illustrate how to build applications that can scale horizontally across infrastructure in the cloud.
The document discusses the ACID properties - Atomicity, Consistency, Isolation, and Durability - which are important principles for reliable database transactions. It provides definitions and examples of each property, including Java code snippets demonstrating how to implement the properties. While critical for transaction integrity, maintaining ACID properties in distributed databases can be challenging due to network delays and failures. Techniques for balancing ACID with performance are discussed.
Data management in cloud study of existing systems and future opportunitiesEditor Jacotech
This document discusses data management in cloud computing and provides an overview of existing NoSQL database systems and their advantages over traditional SQL databases. It begins by defining cloud computing and the need for scalable data storage. It then discusses key goals for cloud data management systems including availability, scalability, elasticity and performance. Several popular NoSQL databases are described, including BigTable, MongoDB and Dynamo. The advantages of NoSQL systems like elastic scaling and easier administration are contrasted with some limitations like limited transaction support. The document concludes by discussing opportunities for future research to improve scalability and queries in cloud data management systems.
This document discusses database system architectures and distributed database systems. It covers transaction server systems, distributed database definitions, promises of distributed databases, complications introduced, and design issues. It also provides examples of horizontal and vertical data fragmentation and discusses parallel database architectures, components, and data partitioning techniques.
This document discusses concurrency control in database management systems. Concurrency control addresses conflicts that can occur with simultaneous data access or alteration by multiple users. It ensures transactions are performed concurrently without violating data integrity. The document provides examples of concurrency control issues and describes different concurrency control protocols, including lock-based protocols that use locks to control access to data being read or written, and timestamp-based protocols that use timestamps to determine the order of transactions.
Many real-time systems are naturally distributed and these distributed systems require not only highavailability
but also timely execution of transactions. Consequently, eventual consistency, a weaker type of
strong consistency is an attractive choice for a consistency level. Unfortunately, standard eventual
consistency, does not contain any real-time considerations. In this paper we have extended eventual
consistency with real-time constraints and this we call real-time eventual consistency. Followed by this new
definition we have proposed a method that follows this new definition. We present a new algorithm using
revision diagrams and fork-join data in a real-time distributed environment and we show that the proposed
method solves the problem.
EOUG95 - Client Server Very Large Databases - PaperDavid Walker
The document discusses building large scaleable client/server solutions. It describes breaking the solution into four server components: database server, application server, batch server, and print server. It focuses on the database server, discussing how to make it resilient through clustering and scaleable by partitioning applications and using parallel query options. It also covers backup and recovery strategies.
This document provides an overview of NoSQL databases and key-value stores. It discusses why NoSQL databases were created, examples of different NoSQL categories like key-value stores and document stores. It then focuses on key-value stores like Memcached and MemcacheDB. Memcached is an in-memory key-value store while MemcacheDB provides persistence. Both use the BerkeleyDB for storage with MemcacheDB.
This document discusses techniques for managing dynamic shared state in networked virtual environments. It explains that consistency and throughput cannot both be maximized, and outlines several approaches: shared repositories using centralized servers, blind broadcasting of regular state updates, and dead reckoning where clients predict state between updates. Each technique trades off factors like consistency, scalability, bandwidth usage, and complexity. The optimal choice depends on an application's specific requirements.
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
An introductory overview of distributed systems—what they are and why they're difficult to build. We explore fundamental ideas and practical concepts in distributed programming. What is the CAP theorem? What is distributed consensus? What are CRDTs? We also look at options for solving the split-brain problem while considering the trade-off of high availability as well as options for scaling shared data.
This document discusses cluster computing and provides details on key topics such as:
- What a cluster is and how it links multiple computers together for parallel processing.
- The different types of clusters including high availability, load balancing, and parallel/distributed processing clusters.
- The components that make up a cluster including cluster nodes and network.
- Classifications of clusters as open or closed.
- Applications of clusters such as compute intensive tasks, data intensive tasks, and transaction intensive tasks.
- Benefits of using cluster computing such as great processing power, availability, expandability, reliability and cost efficiency.
Highly available distributed databases, how they work, javier ramirez at teowakijavier ramirez
This document summarizes key aspects of distributed databases. It discusses master-slave and multi-master replication approaches. It then covers the challenges of achieving availability, partition tolerance and consistency as defined by Brewer's CAP theorem. The rest of the document dives deeper into data distribution, replication, conflict resolution, membership protocols, and allowing the system to operate during network partitions or node failures. It provides examples of gossip protocols, vector clocks, hinted handoff, and anti-entropy processes used in distributed databases. Finally, it notes that building these systems requires clients to be aware of some internal workings and allows for extra credit in building your own distributed database.
The document discusses the key goals and challenges of distributed systems. The four main goals are:
1. Connecting users and resources to share resources easily.
2. Transparency by hiding locations of processes and resources.
3. Openness through standard services that are flexible and extensible.
4. Scalability to add more users, resources, and administrative organizations.
The main challenges are that solutions for single systems do not always work for distributed systems, and distributed systems introduce new problems like various failure modes and complex distributed state and management across independent systems.
The document discusses NoSQL databases and Cassandra. It provides background on the rise of NoSQL with the need for large web companies to handle big data in a distributed manner. It introduces the CAP theorem and explains that NoSQL databases sacrifice consistency to achieve availability and partition tolerance. Eventual consistency is described where updates eventually propagate throughout the system. Cassandra is summarized as an open source, distributed, column-oriented database developed at Facebook to be highly scalable and fault tolerant. It uses an eventual consistency model and is robust to failures.
This document discusses configuring Microsoft Distributed Transaction Coordinator (MSDTC) in a SQL Server cluster. It describes setting up an Active Directory domain, installing the Failover Clustering feature and creating a Windows cluster. It also discusses configuring a dedicated MSDTC resource for the cluster, including adding a MSDTC resource to a SQL Server role and configuring its dependencies on a disk and hostname. The document provides best practices for using MSDTC in a clustered SQL Server environment.
- Microsoft SQL Server is a relational database management system developed by Microsoft that allows for storing and retrieving data. It provides scalability, integration with .NET, web services support, and tools for data migration and analysis.
- It includes components like the Database Engine, Integration Services, Analysis Services, and Reporting Services.
- Users connect to SQL Server using a login and are mapped to database users to access specific databases. Databases can be created, backed up, restored, and monitored for slow queries. Backups can also be moved to object storage like Amazon S3.
Megastore providing scalable, highly available storage for interactive servicesJoão Gabriel Lima
The document describes Megastore, a storage system developed by Google to meet the requirements of interactive online services. Megastore blends the scalability of NoSQL databases with the features of relational databases. It uses partitioning and synchronous replication across datacenters using Paxos to provide strong consistency and high availability. Megastore has been widely deployed at Google to handle billions of transactions daily storing nearly a petabyte of data across global datacenters.
The document describes Megastore, a storage system developed by Google to meet the requirements of interactive online services. Megastore blends the scalability of NoSQL databases with the features of relational databases. It uses partitioning and synchronous replication across datacenters using Paxos to provide strong consistency and high availability. Megastore has been widely deployed at Google to handle billions of transactions daily storing nearly a petabyte of data across global datacenters.
This document discusses concurrency control in distributed database systems. It begins by defining a distributed database as a single logical database made up of physically separate databases connected by a network. Concurrency control methods are needed to coordinate simultaneous access by multiple users in a way that maintains consistency. The document then summarizes several prominent distributed concurrency control algorithms: distributed two-phase locking, wound-wait, basic timestamp ordering, and distributed optimistic concurrency control. It notes that these algorithms aim to preserve the ACID properties of atomicity, consistency, isolation, and durability for transactions operating across distributed databases.
Scalable Web Architecture and Distributed Systemshyun soomyung
Scalable web architectures distribute resources across multiple servers to improve availability, performance, reliability, and scalability. Key principles for designing scalable systems include availability, performance, reliability, scalability, manageability, and cost. These principles sometimes conflict and require tradeoffs. To improve scalability, services can be split and data distributed across partitions or shards. Caches, proxies, indexes, load balancers, and queues help optimize data access and manage asynchronous operations in distributed systems.
The document discusses cloud computing and designing applications for scalability and availability in the cloud. It covers key considerations for moving to the cloud like design for failure, building loosely coupled systems, implementing elasticity, and leveraging different storage options. It also discusses challenges like application scalability and availability and how to address them through patterns like caching, partitioning, and implementing elasticity. The document uses examples like MapReduce to illustrate how to build applications that can scale horizontally across infrastructure in the cloud.
The document discusses the ACID properties - Atomicity, Consistency, Isolation, and Durability - which are important principles for reliable database transactions. It provides definitions and examples of each property, including Java code snippets demonstrating how to implement the properties. While critical for transaction integrity, maintaining ACID properties in distributed databases can be challenging due to network delays and failures. Techniques for balancing ACID with performance are discussed.
Data management in cloud study of existing systems and future opportunitiesEditor Jacotech
This document discusses data management in cloud computing and provides an overview of existing NoSQL database systems and their advantages over traditional SQL databases. It begins by defining cloud computing and the need for scalable data storage. It then discusses key goals for cloud data management systems including availability, scalability, elasticity and performance. Several popular NoSQL databases are described, including BigTable, MongoDB and Dynamo. The advantages of NoSQL systems like elastic scaling and easier administration are contrasted with some limitations like limited transaction support. The document concludes by discussing opportunities for future research to improve scalability and queries in cloud data management systems.
This document discusses database system architectures and distributed database systems. It covers transaction server systems, distributed database definitions, promises of distributed databases, complications introduced, and design issues. It also provides examples of horizontal and vertical data fragmentation and discusses parallel database architectures, components, and data partitioning techniques.
High Availability of Services in Wide-Area Shared Computing NetworksMário Almeida
(Check my blog @ http://www.marioalmeida.eu/ )
Highly available distributed systems have been widely used and have proven to be resistant to a wide range of faults. Although these kind of services are easy to access, they require an investment that developers might not always be willing to make. We present an overview of Wide-Area shared computing networks as well as methods to provide high availability of services in such networks. We make some references to highly available systems that are being used and studied at the moment this paper was written (2012).
This document discusses NewSQL databases. It begins with an introduction that describes how enterprises need both reliable transaction processing and the ability to perform analytics on large datasets. This requires different database strategies that are often in conflict.
The document then provides details on NewSQL databases, including that they aim to overcome constraints of SQL and NoSQL databases. Key features of NewSQL databases are described, such as how they store data and provide security and support for big data. NewSQL databases are compared to SQL and NoSQL databases based on several parameters like ACID properties, storage, performance, consistency, and more. Overall, the document analyzes the rise of NewSQL databases as an attempt to achieve the benefits of both traditional SQL and No
This document discusses the challenges of building an optimal data management platform that can leverage on-demand hardware resources. It summarizes the CAP theorem, which states that a distributed system cannot simultaneously provide consistency, availability, and partition tolerance. The document introduces Pivotal's solution, called the Enterprise Data Fabric (EDF), which is designed to mine the gap between strong consistency and availability. The EDF uses service entities, membership roles, and configurable consistency levels to optimize for consistency and availability based on data and workflow requirements. It exploits parallelism and caches data to improve performance across distributed and global deployments.
HIGH AVAILABILITY AND LOAD BALANCING FOR POSTGRESQL DATABASES: DESIGNING AND ...ijdms
The aim of the paper is to design and implement an approach that provides high availability and load balancing to PostgreSQL databases. Shared nothing architecture and replicated centralized middleware architecture were selected in order to achieve data replication and load balancing among database servers. Pgpool-II was used to implementing these architectures. Besides, taking advantage of pgpool-II as
a framework, several scripts were developed in Bash for restoration of corrupted databases. In order to avoid single point of failure Linux HA (Heartbeat and Pacemaker) was used, whose responsibility is monitoring all processes involved in the whole solution. As a result applications can operate with a more reliable PostgreSQL database server, the most suitable situation is for applications with more load of reading statement (typically select) over writing statement (typically update). Also approach presented is only intended for Linux based Operating System.
In this paper, we summarize and outline some of the big challenges in addressing performance, scalability, and availability of web applications with large and complex backend database systems. We present some of the limitations imposed by the CAP theorem on distributed DB development and identify some approaches that can be used to effectively address these limitations. We propose the adoption of an effective Cloud architecture approach that pushes adoption of principles supported by loosely-coupled SPU based design, which can support incremental development and rapid scalability of such complex and dynamic applicative need.
This document describes LinkedIn's Databus, a distributed change data capture system that reliably captures and propagates changes from primary data stores. It has four main components - a fetcher that extracts changes from data sources, a log store that caches changes, a snapshot store that maintains a moving snapshot, and a subscription client that pulls changes. Databus uses a pull-based model where consumers pull changes based on a monotonically increasing system change number. It supports capturing transaction boundaries, commit order, and consistent states to preserve consistency from the data source.
This document proposes a novel distributed architecture for a NoSQL datastore that supports strong consistency while maintaining high scalability. It is based on the Scalable Distributed Two-Layer Data Store (SD2DS) model, which has proven efficient. The architecture considers concurrent and unfinished operations to ensure consistency. Algorithms for scheduling operations are presented and proven theoretically correct. An implementation is evaluated experimentally against MongoDB and MemCached, showing high performance compared to existing NoSQL systems. The architecture aims to augment SD2DS with consistency mechanisms without impacting scalability.
The document summarizes findings from a project testing batch processing performance using J2EE. It discusses considerations for batch frameworks, infrastructure, caching, logging, design challenges, and whether to use batch processing. It also outlines the design of the batch process used, including leveraging raw JDBC, Oracle caching, and tools for performance monitoring.
A Study on Replication and Failover Cluster to Maximize System UptimeYogeshIJTSRD
This document summarizes a study on using replication and failover clusters to maximize system uptime for cloud services. It discusses challenges in ensuring high availability of cloud services from a provider perspective. The study aims to present a high availability solution using load balancing, elasticity, replication, and disaster recovery configuration. It reviews related literature on digital media distribution platforms, content delivery networks, auto-scaling strategies, and database replication impact. It also covers methodologies like CloudFront, state machine replication, neural networks, Markov decision processes, and sliding window protocols. The scope is to build a scalable, fault-tolerant environment with disaster recovery and ensure continuous availability. The conclusion is that data replication and failover clusters are necessary to plan data
Regardless of whether you use a direct attached storage array, or a network-attached storage (NAS) appliances, or a storage area network (SAN) to host your data, if this data infrastructure is not designed for high availability, then the data it stores is not highly available by extension, application availability is at risk – regardless of server clustering.
The purpose of this paper is to outline best practices for improving overall business application availability by building a highly available data infrastructure.
Download this paper to:
- Learn how to develop a High Availability strategy for your applications
- Identify the differences between Hardware and Software-defined infrastructures in terms of Availability
- Learn how to build a Highly Available data infrastructure using Hyper-converged storage
This document discusses distributed data warehouses and online analytical processing (OLAP). It begins by describing different data warehouse architectures like enterprise data warehouses, data marts, and distributed enterprise data warehouses. It then outlines challenges for achieving performance in distributed OLAP systems, including dynamically managing aggregates, using partial aggregates, allocating data and balancing loads. The document proposes techniques like redundancy and patchworking queries across sites to optimize distributed querying.
Leveraging the power of the unbundled databaseAlex Silva
Since the mid-1980s, relational databases have been standard for most applications needing to store and query structured data. As architectures became more complex, databases have generalized to fit a variety of use cases. Simplicity was key: databases encapsulate storage, indexing, caching, querying, and transaction management, all under a unified SQL view.
Alex Silva examines what could happen if you could “unbundle” the database into its separate constituents and distribute these concerns into different layers and be able to optimize them individually. He proposes a stream processing architecture that can be used to successfully “deconstruct” the database while analyzing the challenges and pitfalls.
You’ll approach subscription and replication protocols under a different light by exploring how relational databases have overcome these challenges and focusing on what works and what doesn’t while discussing the paradigm shift proposed by stream processing and the architectural differences between the two approaches.
This document discusses event driven architecture (EDA) and domain driven design. It begins with an introduction to the speaker and an overview of EDA basics. It then describes problems with traditional SOA implementations, where domain logic gets split across many systems. The document proposes that exposing domain events on a shared event bus allows isolating cross-cutting functions to separate systems while keeping domain logic together. It provides examples of how this approach improves scalability and decouples systems. Finally, it outlines potential business benefits of using EDA like enabling complex event processing, business process management, and business activity monitoring on top of the domain events.
The document discusses trends and challenges facing information technology, including building a civic semantic web and waiving rights over linked data. It also discusses whether semantic technologies could permit meaningful brand relationships. The document contains a chart showing government department spending in the UK, with the Department of Health spending £105.7 billion, followed by local and regional government spending £34.3 billion, and the NHS spending £90.7 billion.
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
This document summarizes an Erlang meeting held on July 3, 2009 in Tokyo. It discusses the gen_paxos Erlang module, which implements the Paxos consensus algorithm. Paxos is needed to solve problems like split-brains where data could become inconsistent without coordination between nodes. The document explains the key aspects of Paxos like its phases, data model in gen_paxos, and how nodes communicate through message passing in Erlang. It also provides references to related works and papers about Paxos.
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining case classes and actors for messages. It summarizes that Scala is a pragmatically oriented, statically typed language that runs on the JVM and has a unique blend of object-oriented and functional programming. Functional programming concepts like immutable data structures, functions as first-class values, and for-comprehensions are demonstrated with examples in Scala.
This document is the introduction to "The Little Book of Semaphores" by Allen B. Downey. It provides an overview of the book, which uses examples and puzzles to teach synchronization concepts and patterns. The book aims to give students more practice with these challenging concepts than a typical operating systems course allows. It also discusses the book's licensing as free and open source documentation.
This document provides style guidelines for Scala developers at Twitter. It outlines recommendations for imports, implicit usage, reflection, comments, whitespace, logging, project layout, variable naming conventions, and ends by thanking people for attending.
This document introduces developing a Scala DSL for Apache Camel. It discusses using Scala features like implicit conversions, passing functions as parameters, and by-name parameters to build a DSL. It provides examples of simple routes in the Scala DSL and compares them to Java. It also covers tooling for Scala in Maven and Eclipse and caveats like interacting with Java generics. The goal is to learn basic Scala concepts and syntax for building a Scala DSL, using Camel as an example.
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
The document discusses alternative concurrency paradigms to shared-state concurrency for the JVM, including software transactional memory which allows transactions over shared memory, message passing concurrency using the actor model where actors communicate asynchronously via message passing, and dataflow concurrency where variables can only be assigned once. It provides examples of how these paradigms can be used to implement solutions like transferring funds between bank accounts more elegantly than with shared-state concurrency and locks.
This document discusses using TCP/IP for high performance computing (HPC) applications. It finds that while TCP/IP can achieve bandwidth of 1 Gbps over short distances with low latency, the bandwidth degrades significantly over wide area networks with higher latency. It investigates tuning TCP parameters like socket buffer sizes to improve performance over high latency networks.
Martin Odersky outlines the growth and adoption of Scala over the past 6 years and discusses Scala's future direction over the next 5 years. Key points include:
- Scala has grown from its first classroom use in 2003 to filling a full day of talks at JavaOne in 2009 and developing a large user community.
- Scala 2.8 will include new collections, package objects, named/default parameters, and improved tool support.
- Over the next 5 years, Scala will focus on concurrency and parallelism features at all levels from primitives to tools.
- Other areas of focus include extended libraries, performance improvements, and standardized compiler plugin architecture.
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
This document discusses alternative concurrency paradigms for the Java Virtual Machine (JVM). It begins with an agenda and discusses how Moore's Law no longer solves concurrency problems as processors are becoming multi-core. It then discusses the problems with shared-state concurrency and how separating identity and value can help. The document introduces software transactional memory, message passing concurrency using actors, and dataflow concurrency as alternative paradigms. It uses examples of bank account transfers to demonstrate how these paradigms can be implemented and discusses their advantages over shared-state concurrency.
This document contains the schedule for a conference with sessions on various topics in natural language processing and computational linguistics. The conference will take place from September 14-16. Each day consists of morning and afternoon sessions split into parallel tracks (1a and 1b). Sessions cover areas like semantics, parsing, sentiment analysis, and more. Keynote speakers include Ricardo Baeza-Yates, Kevin Bretonnel Cohen, Mirella Lapata, Shalom Lappin, and Massimo Poesio. Presentations are 20 minutes each with coffee breaks in the mornings and poster sessions in the afternoons.
The article discusses the Guardian's Datastore project, which makes data of public interest freely available online for reuse. Some key points:
- The Datastore contains datasets on topics like MPs' expenses, carbon emissions, and public opinion polls. This data was previously hard to access but the web now allows easy access to billions of statistics.
- Making this data open and machine-readable supports the Guardian's tradition of fact-checking and transparency. It also encourages others to analyze and build upon the data in new ways.
- An early example involved crowdsourcing the review of 500,000 pages of MPs' expenses, revealing new insights. Other Guardian datasets like music recommendations and university rankings are now available for others
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
This document summarizes a presentation on Paxos and gen_paxos. It introduces Paxos as a distributed consensus algorithm that is robust to network failures and allows data replication across multiple nodes. It then describes the gen_paxos Erlang implementation of Paxos, including its data model, state machine approach, and messaging between nodes. Key aspects of Paxos like the prepare and propose phases are explained through examples. The document also provides context on applications of Paxos and references for further reading.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
BASE: An Acid Alternative
1. In partitioned databases, trading some consistency for availability
can lead to dramatic improvements in scalability.
Web applications have grown in popularity over the past reasonably well for data but has several limitations. The
decade. Whether you are building an application for end most obvious limitation is outgrowing the capacity of the
users or application developers (i.e., services), your hope largest system available. Vertical scaling is also expensive,
is most likely that your application will find broad adop- as adding transactional capacity usually requires purchas-
tion—and with broad adoption will come transactional ing the next larger system. Vertical scaling often creates
growth. If your application relies upon persistence, then vendor lock, further adding to costs.
data storage will probably become your bottleneck. Horizontal scaling offers more flexibility but is also
There are two strategies for scaling any application. considerably more complex. Horizontal data scaling
The first, and by far the easiest, is vertical scaling: moving can be performed along two vectors. Functional scaling
the application to larger computers. Vertical scaling works involves grouping data by function and spreading func-
DAN PRITCHETT, EBAY
48 May/June 2008 ACM QUEUE rants: feedback@acmqueue.com
2. tional groups across databases. Splitting data within func- FUNCTIoNAl PARTITIoNINg
tional areas across multiple databases, or sharding,1 adds Functional partitioning is important for achieving high
the second dimension to horizontal scaling. The diagram degrees of scalability. Any good database architecture will
in figure 1 illustrates horizontal data-scaling strategies. decompose the schema into tables grouped by function-
As figure 1 illustrates, both approaches to horizontal ality. Users, products, transactions, and communication
scaling can be applied at once. Users, products, and trans- are examples of functional areas. Leveraging database
actions can be in separate databases. Additionally, each concepts such as foreign keys is a common approach for
functional area can be split across multiple databases for maintaining consistency across these functional areas.
transactional capacity. As shown in the diagram, func- Relying on database constraints to ensure consistency
tional areas can be scaled independently of one another. across functional groups creates a coupling of the schema
AN ACID ALTERNATIVE
more queue: www.acmqueue.com ACM QUEUE May/June 2008 49
3. Availability. Every operation must terminate in an
intended response.
Partition tolerance. Operations will complete, even if
AN ACID ALTERNATIVE
individual components are unavailable.
Specifically, a Web application can support, at most,
only two of these properties with any database design.
Obviously, any horizontal scaling strategy is based on
data partitioning; therefore, designers are forced to decide
to a database deployment strategy. For constraints to be between consistency and availability.
applied, the tables must reside on a single database server,
precluding horizontal scaling as transaction rates grow. In ACID SolUTIoNS
many cases, the easiest scale-out opportunity is moving ACID database transactions greatly simplify the job of the
functional groups of data onto discrete database servers. application developer. As signified by the acronym, ACID
Schemas that can scale to very high transaction transactions provide the following guarantees:
volumes will place functionally distinct data on different Atomicity. All of the operations in the transaction will
database servers. This requires moving data constraints complete, or none will.
out of the database and into the application. This also Consistency. The database will be in a consistent state
introduces several challenges that are addressed later in when the transaction begins and ends.
this article. Isolation. The transaction will behave as if it is the only
operation being performed upon the database.
CAP THEoREM Durability. Upon completion of the transaction, the
Eric Brewer, a professor at the University of California, operation will not be reversed.
Berkeley, and cofounder and chief scientist at Inktomi, Database vendors long ago recognized the need for
made the conjecture that Web services cannot ensure all partitioning databases and introduced a technique known
three of the following properties at once (signified by the as 2PC (two-phase commit) for providing ACID guaran-
acronym CAP):2 tees across multiple database instances. The protocol is
Consistency. The client perceives that a set of operations broken into two phases:
has occurred all at once. • First, the transaction coordinator asks each database
involved to precommit the operation and indicate
whether commit is possible. If all databases agree the
Data Scaling commit can proceed, then phase 2 begins.
functional scaling • The transaction coordinator asks each database to com-
mit the data.
If any database vetoes the commit, then all databases
are asked to roll back their portions of the transaction.
users0 products trans0
Sample Schema
sharding
user transaction
users1 trans1 id xid
name seller_id
amt_sold buyer_id
amt_bought amount
FIG 1 FIG 2
trans2
50 May/June 2008 ACM QUEUE rants: feedback@acmqueue.com
4. What is the shortcoming? We are getting consistency availability in a partitioned database, then opportunities
across partitions. If Brewer is correct, then we must be to relax consistency have to be identified. This is often
impacting availability, but how can that be? difficult because the tendency of both business stake-
The availability of any system is the product of the holders and developers is to assert that consistency is
availability of the components required for operation. paramount to the success of the application. Temporal
The last part of that statement is the most important. inconsistency cannot be hidden from the end user, so
Components that may be used by the system but are not both engineering and product owners must be involved
required do not reduce system availability. A transaction in picking the opportunities for relaxing consistency.
involving two databases in a 2PC commit will have the Figure 2 is a simple schema that illustrates consis-
availability of the product of the availability of each data- tency considerations for BASE. The user table holds user
base. For example, if we assume each database has 99.9
percent availability, then the availability of the transac-
tion becomes 99.8 percent, or an additional downtime of
43 minutes per month.
AN ACID AlTERNATIvE
If ACID provides the consistency choice for partitioned
databases, then how do you achieve availability instead?
One answer is BASE (basically available, soft state, eventu-
ally consistent).
BASE is diametrically opposed to ACID. Where ACID
The tendency of both business
is pessimistic and forces consistency at the end of every stakeholders and developers is
operation, BASE is optimistic and accepts that the to assert that consistency is paramount
database consistency will be in a state of flux. Although
to the success of the application.
this sounds impossible to cope with, in reality it is quite
manageable and leads to levels of scalability that cannot
be obtained with ACID.
The availability of BASE is achieved through support-
ing partial failures without total system failure. Here information including the total amount sold and bought.
is a simple example: if users are partitioned across five These are running totals. The transaction table holds each
database servers, BASE design encourages crafting opera- transaction, relating the seller and buyer and the amount
tions in such a way that a user database failure impacts of the transaction. These are gross oversimplifications of
only the 20 percent of the users on that particular host. real tables but contain the necessary elements for illus-
There is no magic involved, but this does lead to higher trating several aspects of consistency.
perceived availability of the system. In general, consistency across functional groups is
So, now that you have decomposed your data into easier to relax than within functional groups. The example
functional groups and partitioned the busiest groups schema has two functional groups: users and transac-
across multiple databases, how do you incorporate BASE tions. Each time an item is sold, a row is added to the
into your application? BASE requires a more in-depth transaction table and the counters for the buyer and seller
analysis of the operations
within a logical transaction
than is typically applied to Begin transaction
ACID. What should you be Insert into transaction(xid, seller_id, buyer_id, amount);
looking for? The follow- Update user set amt_sold=amt_sold+$amount where id=$seller_id;
ing sections provide some Update user set amt_bought=amount_bought+$amount where id=$buyer_id;
FIG 3
direction. End transaction
CoNSISTENCY PATTERNS
Following Brewer’s con-
jecture, if BASE allows for
more queue: www.acmqueue.com ACM QUEUE May/June 2008 51
5. not uncommon, and in fact people encounter this delay
between a transaction and their running balance regularly
(e.g., ATM withdrawals and cellphone calls).
AN ACID ALTERNATIVE
How the SQL statements are modified to relax con-
sistency depends upon how the running balances are
defined. If they are simply estimates, meaning that some
transactions can be missed, the changes are quite simple,
as shown in figure 4.
are updated. Using an ACID-style transaction, the SQL We’ve now decoupled the updates to the user and
would be as shown in figure 3. transaction tables. Consistency between the tables is not
The total bought and sold columns in the user table guaranteed. In fact, a failure between the first and second
can be considered a cache of the transaction table. It is transaction will result in the user table being permanently
present for efficiency of the system. Given this, the con- inconsistent, but if the contract stipulates that the run-
straint on consistency could be relaxed. The buyer and ning totals are estimates, this may be adequate.
seller expectations can be set so their running balances do What if estimates are not acceptable, though? How
not reflect the result of a transaction immediately. This is can you still decouple the user and transaction updates?
Introducing a persistent
message queue solves the
problem. There are several
Begin transaction choices for implement-
Insert into transaction(id, seller_id, buyer_id, amount); ing persistent messages.
End transaction The most critical factor in
Begin transaction implementing the queue,
Update user set amt_sold=amt_sold+$amount where id=$seller_id; however, is ensuring that
Update user set amt_bought=amount_bought+$amount the backing persistence is
where id=$buyer_id; on the same resource as the
FIG 4
End transaction database. This is necessary
to allow the queue to be
transactionally committed
without involving a 2PC.
Now the SQL operations
look a bit different, as
Begin transaction shown in figure 5.
Insert into transaction(id, seller_id, buyer_id, amount); This example takes
Queue message “update user(“seller”, seller_id, amount)”; some liberties with syntax
Queue message “update user(“buyer”, buyer_id, amount)”; and oversimplifying the
End transaction logic to illustrate the
For each message in queue concept. By queuing a
Begin transaction persistent message within
Dequeue message the same transaction as
If message.balance == “seller” the insert, the information
Update user set amt_sold=amt_sold + message.amount needed to update the run-
where id=message.id; ning balances on the user
Else has been captured. The
Update user set amt_bought=amt_bought + message.amount transaction is contained on
FIG 5
where id=message.id; a single database instance
End if and therefore will not
End transaction impact system availability.
End for A separate message-
processing component will
52 May/June 2008 ACM QUEUE rants: feedback@acmqueue.com
6. into a separate back-end component, you preserve the
Update Table availability of your customer-facing component. The
lower availability of the message processor may be accept-
updates_applied
able for business requirements.
trans_id
Suppose, however, that 2PC is simply never acceptable
balance in your system. How can this problem be solved? First,
user_id you need to understand the concept of idempotence. An
FIG 6
operation is considered idempotent if it can be applied
one time or multiple times with the same result. Idem-
potent operations are useful in that they permit partial
failures, as applying them repeatedly does not change the
final state of the system.
The selected example is problematic when looking
dequeue each message and apply the information to the for idempotence. Update operations are rarely idempo-
user table. The example appears to solve all of the issues, tent. The example increments balance columns in place.
but there is a problem. The message persistence is on the Applying this operation more than once obviously will
transaction host to avoid a 2PC during queuing. If the result in an incorrect balance. Even update operations
message is dequeued inside a transaction involving the that simply set a value, however, are not idempotent
user host, we still have a 2PC situation. with regard to order of operations. If the system cannot
One solution to the 2PC in the message-processing guarantee that updates will be applied in the order they
component is to do nothing. By decoupling the update are received, the final state of the system will be incorrect.
More on this later.
In the case of balance
Begin transaction updates, you need a way to
Insert into transaction(id, seller_id, buyer_id, amount); track which updates have
Queue message “update user(“seller”, seller_id, amount)”; been applied successfully
Queue message “update user(“buyer”, buyer_id, amount)”; and which are still out-
End transaction standing. One technique is
For each message in queue to use a table that records
Peek message the transaction identifiers
Begin transaction that have been applied.
Select count(*) as processed where trans_id=message.trans_id The table shown in
and balance=message.balance and user_id=message.user_id figure 6 tracks the transac-
If processed == 0 tion ID, which balance has
If message.balance == “seller” been updated, and the user
Update user set amt_sold=amt_sold + message.amount ID where the balance was
where id=message.id; applied. Now our sample
Else pseudocode is as shown in
Update user set amt_bought=amt_bought + message.amount figure 7.
where id=message.id; This example depends
End if upon being able to peek a
Insert into updates_applied message in the queue and
(message.trans_id, message.balance, message.user_id); remove it once success-
End if fully processed. This can
End transaction be done with two indepen-
FIG 7
If transaction successful dent transactions if neces-
Remove message from queue sary: one on the message
End if queue and one on the user
End for database. Queue operations
are not committed unless
more queue: www.acmqueue.com ACM QUEUE May/June 2008 53
7. upon which order the messages are processed in, you will
have an incorrect value for last_purchase. Fortunately,
this kind of update can be handled with a minor modifi-
AN ACID ALTERNATIVE
cation to the SQL, as illustrated in figure 9.
By simply not allowing the last_purchase time to go
backward in time, you have made the update operations
order independent. You can also use this approach to
protect any update from out-of-order updates. As an alter-
database operations successfully commit. The algorithm native to using time, you can also try a monotonically
now supports partial failures and still provides transac- increasing transaction ID.
tional guarantees without resorting to 2PC.
There is a simpler technique for assuring idempotent oRDERINg oF MESSAgE QUEUES
updates if the only concern is ordering. Let’s change our A short side note on ordered message delivery is relevant.
sample schema just a bit to illustrate the challenge and Message systems offer the ability to ensure that messages
the solution (see figure 8). Suppose you also want to track are delivered in the order they are received. This can be
the last date of sale and purchase for the user. You can expensive to support and is often unnecessary, and, in
rely on a similar scheme of updating the date with a mes- fact, at times gives a false sense of security.
sage, but there is one problem. The examples provided here illustrate how message
Suppose two purchases occur within a short time ordering can be relaxed and still provide a consistent
window, and our message system doesn’t ensure ordered view of the database, eventually. The overhead required
operations. You now have a situation where, depending to relax the ordering is nominal and in most cases is
significantly less than enforcing ordering in the message
system.
Further, a Web application is semantically an event-
Alternate Schema driven system regardless of the style of interaction. The
user transaction client requests arrive to the system in arbitrary order.
Processing time required per request varies. Request
id xid
scheduling throughout the components of the systems is
name seller_id
nondeterministic, resulting in nondeterministic queuing
amt_sold buyer_id of messages. Requiring the order to be preserved gives a
amt_bought amount false sense of security. The simple reality is that nondeter-
last_sale ministic inputs will lead to nondeterministic outputs.
last_purchase
SoFT STATE/EvENTUAllY CoNSISTENT
Up to this point, the focus has been on trading con-
FIG 8
sistency for availability. The other side of the coin is
understanding the influence that soft state and eventual
consistency has on application design.
As software engineers we tend to look at our systems
For each message in queue:
Peek message
Begin transaction
Update user set last_purchase=message.trans_date where id=message.buyer_id and last_purchase<message.trans_date;
FIG 9
End transaction
If transaction successful
Remove message from queue
End for
54 May/June 2008 ACM QUEUE rants: feedback@acmqueue.com