





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In a distributed system, replication refers to the process of creating and maintaining copies of data or resources across multiple nodes or servers. Replication in distributed systems offers several benefits, including improved data availability, fault tolerance, and reduced latency. To implement replication in a distributed system, you can follow these steps: Determine Replication Strategy: Choose an appropriate replication strategy based on the requirements of your system. Common strategies include full replication, partial replication, and selective replication. Consider factors such as data consistency, read and write performance, network bandwidth, and storage capacity. Identify Replication Factors: Determine the number of replicas to be created for each data item or resource. Decide on the replication factors, such as the total number of replicas or the number of replicas per data center or geographic region. Consistency Model: Choose a consistency model that defines the lev
Typology: Summaries
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























A Transaction
Commit
Saves changes made.
INSERT INTO trans (id,item,quantity) VALUES (NULL,'ink','24');
INSERT INTO trans (id,item,quantity) VALUES (NULL,'pointer','4');
UPDATE trans SET item='HardDisk' WHERE id=3;
Try the following:
INSERT INTO trans (id,item,quantity) VALUES (NULL,'tablet','24');
INSERT INTO trans (id,item,quantity) VALUES (NULL,'ipad');
UPDATE trans SET item='notepad' WHERE id=4;
Notice it will reject all statements even if the first one was correct.
for $
event
Example II Transaction
Permanence of consistent database state complete
Transaction Properties
Roll back
discards all changes in the transaction and returns the
data to the state it was in before work began.
begin transaction
use emp
rollback transaction
are many reads in comparison to writes, and no transactions.
table type of choice.
CREATE TABLE trans
(
id int not null auto_increment,
item varchar(30) not null,
quantity int not null,
primary key(id)
)type=innodb;
Example 2
BEGIN;
UPDATE trans SET quantity =quantity + 10 WHERE id=1;
UPDATE trans SET quantity =quantity + 10 WHERE id=2;
UPDATE trans SET quantity =quantity + 10 WHERE id=10;
COMMIT;
Example 3
BEGIN;
INSERT INTO trans (id,item,quantity) VALUES (NULL,'printer',‘24');
INSERT INTO trans (id,item,quantity) VALUES (NULL,'USB');
INSERT INTO trans (id,item,quantity) VALUES (NULL,'DVD','33');
COMMIT;
consistent reading - Reads committed
data only
BEGIN;
UPDATE trans SET item =‘mouse’ WHERE id=2;
SELECT * FROM trans;
ROLLBACK;
select * from Trans;
Record for beginning of transaction Transaction Log
execution in multiprocessing database
multiuser database environment
Concurrency Control
7