Federation: Functional Partitioning of Database + FDBS

Free Linux Book

Get FREE domain for 1st year and build your brand new site

In this article, we have explained the concept of Federation including Functional Partitioning of Database + Federated Database System (FDBS). These System Design concepts are important to design efficient Database for systems.

Table of contents:

  1. Introduction to Database
  2. Strategies for partitioning data
  3. Horizontal partition
  4. Vertical partitioning
  5. Functional / Federation partitioning
  6. Federated Database System (FDBS)

Let us get started with Federation: Functional Partitioning of Database + FDBS.

Introduction to Database

Database is an organized collection of data, or structured information, they are typically stored in a computer system. Database are everywhere, one of the simplest example may comes from Facebook, Amazon, or Google Drive. When we go on facebook and look at facebook's posts, images,... We are looking at the contents inside facebook's database. It typically contains all the data of every users on facebook and more.

As we know, the facebook database is large, we cannot see all of them, we cannot download over 300 petabytes of data into our computer, that would take a long time. That is the reason why we need to partition our data, to improve stability, optimize performance and reduce contention.

Strategies for partitioning data

There are three common ways to partition data, they are:

  • Horizontal partition
  • Vertical partitioning
  • Functional partitioning.

However, in this article, we are going to talk about functional / Federation partitioning.

Horizontal partitioning

So first, let's talk a bit about horizontal partitioning. Horizontal partitioning is partioned based key of the value. For example, we have a column of role, and in that column we can divide it by the first letter of each role, let's say we have 2 ranges, A to G and H to Z. In this case, this large table will become two smaller tables.

Employee Address Phone Role Laptop Quantity
John 01 Street A 0123 Web Designer Macbook 1
Emily 02 Street B 0023 Tech Lead Dell 1
Alex 05 Street C 0124 Customer Support HP 1
Louis 07 Street E 0000 Manager Acer 1

Table A.

Employee Address Phone Role Laptop Quantity
Alex 05 Street C 0124 Customer Support HP 1

Table B.

Employee Address Phone Role Laptop Quantity
John 01 Street A 0123 Web Designer Macbook 1
Emily 02 Street B 0023 Tech Lead Dell 1
Louis 07 Street E 0000 Manager Acer 1

And there we go.
The goal of Horizontal partitioning is to balance the workload between all subtables, to support faster access, therefore it is important to choose our key range carefully.
NOTE: This is just a small example, in real-world, there can be as many keys as you want, and many smaller tables, this note applied for every parition method.

Vertical partitioning

What about vertical paritioning? You heard the name, "Vertical", it is vertically divided. Let me demonstrate.

Employee Address Phone Role Laptop Quantity
John 01 Street A 0123 Web Designer Macbook 1
Emily 02 Street B 0023 Tech Lead Dell 1
Alex 05 Street C 0124 Customer Support HP 1
Louis 07 Street E 0000 Manager Acer 1

Table 1:

Employee Address Phone
John 01 Street A 0123
Emily 02 Street B 0023
Alex 05 Street C 0124
Louis 07 Street E 0000

Table 2:

Employee Role Laptop Quantity
John Web Designer Macbook 1
Emily Tech Lead Dell 1
Alex Customer Support HP 1
Louis Manager Acer 1

Here we divided our employees by their personal information and our things that related to our employees in the company. What benefits does this partition bring? It can brings security, because we can store our employee's personal information in a serperate table. It supports faster access to information as we don't have to get all the data from a large table.

Functional / Federation partitioning

So functional paritioning is a partitioning strategy that divides data according to the data's context.

Let's take an example for easier understanding. Imagine we are assigning laptops for employees in our company, each emloyee will have one laptop. We also keep our employees' personal records such as their phone numbers, adress, roles.

Laptop Name Quantity Employee Address Phone Role
Macbook John 1 John 01 Street A 0123 Web Designer
Dell Emily 1 Emily 02 Street B 0023 Tech Lead
HP Alex 1 Alex 05 Street C 0124 Customer Support

Is there anything wrong with this table? Of course, maybe, however, if we have more data, let's say we want to add our company's revenue, assets, spending then we have some problems. For example, this table is meant to store the assigned laptops to our employees, and their personal informations, if we were to add our finanical data, it would be hard to accessing those information. Therefore, we need to seperate our data away.

Let's continue with our table above, that table is doing 2 functions, one is to record the assigned laptops and two is to store our employees record. We want to perform functional partitioning, then the table will be divided according to its context, our contexts here are: Personal information and Laptop information, thus we will have two sub-tables to save those information.

Table 1: Laptop information

Laptop Name Quantity
Macbook John 1
Dell Emily 1
HP Alex 1

Table 2: Personal information

Employee Address Phone Role
John 01 Street A 0123 Web Designer
Emily 02 Street B 0023 Tech Lead
Alex 05 Street C 0124 Customer Support

These two subtables will belong to a large table, let's say it is our database. Whenever we want to access our employee's personal informations, we just need to access one smaller table instead of access to our entire database, and that will save our time.There you go, you have just partioned the a large database into two smaller databases.

And that is the concept of functional partitioning. Now, let's dive in a little bit of the technical details.

Federated Database System (FDBS)

As said above, functional partition creates multiple smaller sub tables (sub databases). That would makes our database a multiple of database, which makes our current partition a Federated Database System (FDBS), it can be characterized along three dimensions:

  • Distribution
  • Heterogeneity
  • Autonomy

We will take a look at these three below.

Distribution

Distribution states the physical distribution of data across the different sites.
In a Federated Database System, there exists a multiple Database System. The data can be stored on one or multiple computers and can be distributed among multiple databases. These computers can be placed anywhere but it needed to interconnected by a network. This help with the availability and reliability and improve access time.

Autonomy

Autonomy indicates the distribution of control of the database system and the degree to which each constituent DBMS can operate independently.
Therefore, FDBS's autonomy depends on its DBS, there are four type of autonomy: Design autonomy, Execution autonomy, Association autonomy and Execution autonomy.

Heterogeneity

Heterogeneity refers to the uniformity or dissimilarity of the data models, system components and databases.
And also, this dependsd on our DBS's autonomy.

Last note, what controls these databases? It is called "Data Federation", Data Federation is a software that allows multiple databases to function as one, and that's all!

I hope you will get the concept of functional partitioning with this article at OpenGenus. Thank you for reading!