This question is in regards to distributed databases: Many thanks in advance and
ID: 3716381 • Letter: T
Question
This question is in regards to distributed databases:
Many thanks in advance and have a good day.
We study a distributed database of 3 sites that stores a single table T. Our workload is that site 1 issues 30 queries to T per hour, site 2 issues 25, and site 3 issues 10. Similarly, site 1 issues 2 updates to T per hour, site 2 28, and site 3 90. Executing a query locally at a site costs 1, executing remotely if there is no local copy costs 10. Similarly, the cost of locally updating is 5, and 50 for each remote site. Which sites should replicate T? Describe how you arrived at this conclusion. Now, generalize this problem as follows: we study a distributed database of n sites that stores a single table T. Our workload is that each of the sites i issues qi queries and ui updates to T per hour Executing a query locally at a site costs c, executing remotely if there is no local copy costs 10c. Similarly, the cost of locally updating is d, and 10d for each remote site. Describe how to choose the sites at which to replicate T with respect to c and d. a. b.Explanation / Answer
Solution:
Let's calculate the costs of each site first for every operation
site 1:
Locally: 30 * 1 + 2 * 5 = 40
Globally: 30 * 10 + 2 * 50 = 400
Time save(if stored locally)= 360
sire 2:
Locally: 25 * 1 + 28 * 5 = 165
Globally: 25 * 10 + 28 * 50 = 1650
TIme saved (if stored locally)= 1650-165 = 1485
site 3:
Locally: 10 * 1 + 90 * 5 = 460
Globally: 10 * 10 + 90 * 50 = 4600
TIme saved (if stored locally)= 1650-165 = 4140
a)
SIte 3 since it will save most of the time.
b)
As shown above, in the calculations whichever site is saving the most time should be calculated first and then the decision should be taken to replicate the site.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.