Input: Tmax: number of transactions issued in the database Fmax: number of the disjoint fragments used for allocation Cmax: number of clusters in the distributed database system Step 1: Set 1 to k Step 2: Do steps (3 - 32) until k > Tmax Step 3: Set 1 to i Step 4: Do steps (5 - 30) until i > Fmax Step 5: Set False to allocation flag Step 6: Set 1 to j Step 7: Do steps (8 - 26) until j > Cmax Step 8: initialize Cost of Remote Update (0) to 0 initialize Cost of Remote Communication (0) to 0 initialize Cost of Remote Retrieval (0) to 0 Step 9: Set 1 to y Step 10:Do steps (11 - 17) until y > Cmax Step 11: If y ¹ j Then Do steps (12-15) Else Go to step (15) Step 12: Cost of Remote Update(y) = Cost of Remote Update(y -1) + (Cost of Local Update * Average Frequency of Remote Update) Step 13: Cost of Remote Communication(y) = Cost of Remote Communication(y -1) + (Average Cost of Remote Communication * Average Frequency of Local Update * Uratio) Step 14: Cost of Remote Retrieval(y) = Cost of Remote Retrieval(y -1) + (Cost of Communication between Clusters * Frequency of Remote Retrieval * Rratio) Step 15: End If Step 16: Add 1 to y Step 17: Loop Step 18: Cost of Allocation = Cost of Local Retrieval + Cost of Local Update + Cost of Storage + Cost of Remote Update + Cost of Remote Communication Step 19: Cost of Not allocating = Cost of Local Retrieval + Cost of Remote Retrieval Step 20: Allocation Decision Value = (Cost of Not allocating >= Cost of Allocation) # Comments: Allocation Decision Value is a Boolean value # Step 21: If Allocation Decision Value = True Then Go to step (22) Else Go to step (23) Step 22: Allocate the fragment to the current cluster Set True to allocation flag Go to step (24) Step 23: Cancel the fragment from the current cluster Step 24: End If Step 25: Add 1 to j Step 26: Loop Step 27: If allocation flag = False Then Allocate the fragment to the cluster who has the least communication cost Step 28: End If Step 29: Add 1 to i Step 30: Loop Step 31: Add 1 to k Step 32: Loop |