Theoretical Background Exercise Beginning Database: A Practical Approach for Non-relational Database.

8.1 Theoretical Background

In designing distributed computer systems, there are two critical aspects that need to be considered. These include the placement of data and programs across the sites or nodes of computer network. In this module, it is assumed that DBMS software and application programs are stored at each site where data are kept. Therefore, the primary concern is on the distribution of data. To design a distributed database, it is important to know how to partition database into fragments, where to put the fragments and decide whether to replicate the fragments or not. If replication is applied, one needs to choose which fragments are involved. The following exercise requires the students to design a simple distributed database system. Example of fragments allocation to sites in a distributed database environment is provided in Figure 8-1 a,b. 58 STAFF Staff_Num Name IC_num Salary Branch_num S002 Ali 750212-01-5636 30000 D008 S006 Zainab 740312-02-5326 25000 D008 S009 Atikah 770216-02-5632 25000 D008 S012 Ramadan 740316-04-5236 41000 D008 ZONBRANCH Branch_Num Branch_Name Manager_Num D008 Selatan S002 DISTRICTBRANCH Branch_Num District_Name D008 Keluang D008 Pontian D008 Segamat D008 Muar Figure 8-1 a : Relation fragments at site 2 for department D008 STAFF Staff_Num Name IC_num Salary Branch_num S005 Hamid 730519-03-5636 33000 D003 S007 Vinosh 750818-04-5326 25000 D003 S011 Salim 781216-06-5632 23000 D003 ZONBRANCH Branch_Num Branch_Name Manager_Num D003 Utara S005 DISTRICTBRANCH Branch_Num District_Name S005 Alor Star S005 Ipoh Figure 8-1 b : Relation fragments at site 3 for department D003 59

8.2 Exercise

Below are the requirements and constraints of database system for a local Software Consultation and Maintenance company in Malaysia:  The company provides maintenance service across various states in Malaysia. One branch is located within each state.  In total, the company hires 8,000 employees across the states.  The company needs to produce annual reports and ad hoc queries such as :  How many services below or exceeds expected profit RM10,000?  How many services in each branch?  How many employees for each job title involve in maintenance service? In fact, each branch needs to handle all services provided in that particular branch state. Nevertheless, all branches should be able to get information about all employees and the payment rate. Currently, all tables are located at company headquarters in PUTRAJAYA. Below are the table structure and its associated data for the company’s database. STAFF_ID NAME HIRE_DATE S001 AHMAD MUZAFFAR 12-OCT-1987 S002 SITI MUZALIFFAH 11-MAR-1988 S003 ADURAH JAMIL 03-MAR-1989 S004 ANAS MALEK 10-02-1989 Figure 8-2: STAFF table 60 STAFF_ID SERVICE_ID JOB_TITLE S001 S1 MANAGER S002 S1 ANALYST S002 S2 ANALYST S003 S3 CONSULTANT S003 S4 ENGINEER S004 S2 PROGRAMMER S004 S2 MANAGER Figure 8-3: ASSIGNMENT table SERVICE_ID SERVICE_NAME EXPECTED_PROFIT STATE S1 System analysis 9000 Selangor S2 Instrumentation 12000 Melaka S3 CADCAM 11000 Kedah S4 PC Maintenance 8000 Melaka S5 System analysis 9000 Kedah S6 Instrumentation 12000 Kedah Figure 8-4: SERVICE table PAYMENT_RATE JOB_TITLE SALARY MANAGER 40000 ANALYST 37000 CONSULTANT 35000 ENGINEER 32000 PROGRAMMER 15000 Figure 8-5: PAYMENT_RATE table The company decide to decentralize the management in order to overcome all the problems they face with centralized management. Based on the requirements answer the following questions: 1. What do you recommend regarding to the type of the required database systems? 2. What type of data fragmentation strategy is required for each table? 3. Define the criteria to partition each table. 61 4. Is there any replication need? If yes, specify the replication strategy and tables or fragments that involve in replication. 5. Design the database fragments. Please specify node names, location, fragment names and demonstration data. 62

8.3 Self Review Questions