Presentation is loading. Please wait.

Presentation is loading. Please wait.

 You will be able to: › Explain how databases may be stored in more than one physical location and how distribution may be carried out using different.

Similar presentations


Presentation on theme: " You will be able to: › Explain how databases may be stored in more than one physical location and how distribution may be carried out using different."— Presentation transcript:

1

2  You will be able to: › Explain how databases may be stored in more than one physical location and how distribution may be carried out using different approaches:  Partitioned (Horizontal and Vertical)  Duplicated databases  Central databases with remote local indexes

3  As previously mentioned, databases are the backbone of most, if not all, companies.  The wealth of information stored on a database system can sometimes be overwhelming and sometimes irrelevant to some people.  Databases can be setup in different ways and different solutions are appropriate in different situations.

4  You are probably used to working with one database.  This database will store all the tables and all of the data.  However, there are methods which allow us to split databases into different parts and to store those parts in different physical locations.  However, a good database system will not make the user aware of this.

5  In a partitioned database, the database is split into different parts.  Each part is stored in a different physical ‘site’.  Each site can be on a different part of a server or on separate computers.  There are two types of partitioning: › Horizontal › Veritcal

6  Data is partitioned based on records.  For example, an estate agency has many outlets across the country.  Instead of having one central database, the estate agency have split their database based on the agency and the location of the houses.

7 UK houses and flats. Imagine all the records for all the houses that are for sale or rent are stored in one database. Filtering houses would take longer because of the larger number of records. Also, returning results would be longer because the request has further distance to travel. Instead of saving all these records in one database you could split the records into their own database based on their locations. Imagine all the records for all the houses that are for sale or rent are stored in one database. Filtering houses would take longer because of the larger number of records. Also, returning results would be longer because the request has further distance to travel. Instead of saving all these records in one database you could split the records into their own database based on their locations.

8 Leicester Coventry Birmingham Each branch now has its own database. If someone wanted to buy a house in their area, they would walk into their branch and the estate agent could search their database quickly. Each branch now has its own database. If someone wanted to buy a house in their area, they would walk into their branch and the estate agent could search their database quickly.

9 Leicester Coventry Birmingham If someone wanted to move area, the estate agent would need to request data from another branch’s database.

10  This type of partition splits data across sites based on the fields.  For example, a small chain of shops which specialises in rare, one off, products may have different departments which are in different locations.  Each shop stocks different items as most of their products are one off or bespoke.  These departments include the head office, purchasing and the actual shop.

11 Head Office Purchasing Shop The head office stores information about what products are stocked in different shops. They are uninterested in the prices or who the supplier is. The head office stores information about what products are stocked in different shops. They are uninterested in the prices or who the supplier is.

12 Head Office Purchasing Shop The purchasing department is interested in making orders to suppliers when they receive an order request from a shop.

13 Head Office Purchasing Shop The vendor is interested in stocking particular items and knowing: -How much stock they have -How much to sell the stock for The vendor is interested in stocking particular items and knowing: -How much stock they have -How much to sell the stock for

14 ItemIDItemNameBranchSupplierQuantityPrice AB111Mega Old Clock LeicesterYe Oldie Clocks 1£995 AC222Wobbly ChairLeicesterSteady on2£569 AD333Grand PianoCoventryChop Sticks1£5995 AE444Old PictureBirminghamArts R Us1£9995 ……………… ……………… Head OfficePurchasingShop All databases use this field

15  Thinking back to our estate agency example with horizontal partitions…  Each branch had only part of all the possible records.  With replicated databases, each branch would have a complete copy of the entire database.

16 UK houses and flats. This is the full version of the database.

17 UK houses and flats. Horizontal Partition means each branch has only some of the database. Leicester Coventry Birmingham

18 UK houses and flats. Replicated databases means all branches have a full copy of the original database. LeicesterCoventryBirmingham

19  This database is stored in one place and one place only.  For example, a bank stores all the records of its customers in one database.  The problem is each branch has to search the database every time it wants to find a customer’s records.

20  However, to speed things up, each branch keeps a database which stores the customers account number and an index number.  Now, when a branch requests data from the head office server, it can tell the server exactly where the record can be found.

21  Think of it like a library system.  All the books are in one big room.  To find the book you were looking for you would have to search all the titles on the shelf until you found the book you wanted.  However, if you knew the index number of the book you could go straight to that section of the shelf and pick it up.

22 IndexAccount #SurnameForenameBalance 101234567BealeIan£300 …………… 500012345678ButcherFrank-£34.83 500198765432MitchellPeggy£923 … Account #Index 012345671 …… 123456785000 987654325001 Head Office Leicester Branch

23  Describe how data can be distributed using horizontal partitioning.  Describe the difference between horizontal and vertical partitioning.  How could local indexes be used with a centralised database?

24  Well now you know about different ways of distributing a database…  But you still need to know when it is appropriate to use those types of database.  Read through pages 147-150 and answer the questions at the end.  Those pages are packed full of advantages and disadvantages of using different types of database.


Download ppt " You will be able to: › Explain how databases may be stored in more than one physical location and how distribution may be carried out using different."

Similar presentations


Ads by Google