0% found this document useful (0 votes)
20 views

Distributed Database

A distributed database runs across multiple interconnected servers or instances located in different physical locations. This allows for increased resilience if an instance fails, easier scalability as more instances can be added, and potentially improved performance by spreading the workload. There are different types of distributed databases, including NoSQL which is non-relational and supports high performance under heavy loads, and distributed SQL which provides a single logical database across multiple physical nodes. Distributed databases can be configured in active-passive, active-active, or multi-active modes which determine how data is replicated and whether replicas are read/write capable.

Uploaded by

srii21rohith
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Distributed Database

A distributed database runs across multiple interconnected servers or instances located in different physical locations. This allows for increased resilience if an instance fails, easier scalability as more instances can be added, and potentially improved performance by spreading the workload. There are different types of distributed databases, including NoSQL which is non-relational and supports high performance under heavy loads, and distributed SQL which provides a single logical database across multiple physical nodes. Distributed databases can be configured in active-passive, active-active, or multi-active modes which determine how data is replicated and whether replicas are read/write capable.

Uploaded by

srii21rohith
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

DISTRIBUTED

DATABASE
BY- A.THEERAN
V.VIRAJESHNITHIN
What is a Distributed Database
A distributed database is a database that runs and stores data
across multiple computers, as opposed to doing everything on a
single machine.

Distributed databases operate on two or more interconnected


servers on a computer network. Each location where a version
of the database is running is often called an instance or a node.

For example , instances running in 3 different locations or


instances running in 3 different machines in same location. A
traditional single-instance database runs in a single location on
a single machine.
USES
1.Distributing the database increases resilience and reduces risk
If a single-instance database goes offline (due to a power outage,
machine failure, or anything else) all of the application services that rely
on it will go offline. But Distributed databases is configured with
replicas of the same data across multiple instances, so if one instance
goes offline, other instances can pick up the slack, allowing the
application to continue operating.

2.Distributed databases are generally easier to scale.


As an application grows to serve more users, the storage and computing
requirements for the database will increase over time. Distributed
databases can satisfy the requirements by adding an additional instance
or node.
USES
3.Distributing the database can improve performance.
A distributed database may be able to operate more efficiently than a
single instance database because it can spread the computing workload
between multiple instances rather than being bottlenecked by having to
perform all reads and writes on the same machine.

4. Geographically distributing the database can reduce latency.


Although not all distributed databases support multi-region deployments,
those that do can also improve application performance for users by
reducing latency. When data can be located on a database instance that is
geographically close to the user who is requesting it, that user will likely
have a lower-latency application experience than a user whose
application needs to pull data from a database instance that’s (for
example) on the other side of the globe.
TYPES
1. NoSQL
A NoSQL database is a distributed, non-relational database designed for
large-scale data storage and massively parallel, high-performance data
processing across many commodity systems. NoSQL gives you a way to
work with data closer to the application. It is a modern data storage
paradigm that provides data persistence for environments where high
performance is the primary requirement. Within a NoSQL database, data
is stored so that both writing and reading are fast, even under heavy load.
Some common features of NoSQL database management systems
include data clustering, flexible schema, replication support, and
eventual consistency, which compares to traditional SQL database
systems usual ACID transaction capability ensuring data integrity.
TYPES
2. Distributed SQL
Distributed SQL is a single logical database deployed across multiple
physical nodes, whether in a single data center or across many data
centers distributed around the globe, that delivers inherently elastic scale
and bulletproof resilience.
A Distributed SQL comprises of
• scale
• consistency
• Resiliency
• Geo-replication
• SQL
Distributed database configurations
Active-Passive
In an active-passive configuration, all traffic is routed to a single
“active” replica, and then copied to the other replicas for backup.
In a three-node deployment, for example, all data might be written to an
active replica on node 1 and then subsequently copied to passive replicas
on nodes 2 and 3.
Active-passive systems offer one of the most straightforward
configuration options – particularly if you’re trying to manually adapt a
traditional relational database for a distributed deployment. They also
introduce risks and trade-offs that can impact database availability and
consistency.
Active- Active

In active-active configurations, there are multiple active replicas, and traffic is routed to all of
them. This reduces the potential impact of a replica being offline, since other replicas will handle
the traffic automatically.

Active-active setups are much more difficult to configure for most workloads, and it is still
possible for consistency issues to arise if an outage happens at the wrong time.

For example, imagine an active-active system with replicas A and B:


A receives a write for key xyz with the value 123, and then immediately fails and goes offline. A
subsequent read for xyz is thus routed to B, and returns NULL, because xyz = 123 hadn’t yet been
copied to B when A went offline. The application, seeing that there isn’t a current value for xyz,
sends an xyz = 456 write to B. A comes back online.

At the end of this sequence, we have an inconsistency: A says xyz = 123 and B says xyz = 456.
While such a scenario is not common, inconsistencies like this one have the potential to cause a
lot of trouble when they do happen, so active-active setups must be configured and tested very
carefully to attempt to mitigate this risk.
Multi-Active

Multi-active is the system for availability used by CockroachDB, which


attempts to offer a better alternative to active-passive and active-active
configurations.
Like active-active configurations, all replicas can handle both reads and
writes in a multi-active system. But unlike active-active, multi-active
systems eliminate the possibility of inconsistencies by using a consensus
replication system, where writes are only committed when a majority of
replicas confirm they’ve received the write.
Pros
•High availability (data is replicated so that the database remains online
even if a machine goes down).

•High scalability (they can be easily scaled horizontally by adding


instances/nodes)

•Improved performance (depending on type, configuration, and


workload)

•Reduced latency (for distributed databases that support multi-region


deployments).
Cons
•Increased operational complexity. Deploying, configuring, managing,
and optimizing a distributed database can be more complex than working
with a single-instance DB.

•Increased learning curve. Distributed databases work differently and it


typically requires some time for teams to adapt to the new set of best
practices. In the case of NoSQL databases, there may also be a learning
curve for developers who aren’t familiar with the language, as some
popular NoSQL databases use proprietary query languages

You might also like