IM 101 - Fundamentals of Database Systems - Unit 2
IM 101 - Fundamentals of Database Systems - Unit 2
All rights reserved. No part of this module may be reproduced, repurposed, distributed, or transmitted in
any form or by any means including photocopying, reprinting, or other electronic or mechanical
methods without the prior written permission of PLV and the individual developers of instructional
materials (IMs) except in the case of brief quotations embodied in critical and creative reviews and
certain other noncommercial uses permitted by the Copyright Law. For permission request, address your
written correspondence whether printed or electronic to the Chair of the University Committee on
Instructional Materials Development and Evaluation at the address below:
Essential Question
How can we differentiate the types of database system ?
How do we differentiate the different File systems ?
What are the advantages and disadvantages of the said file systems?
Lessons Input
Types of Databases
number of users
used by the entire organization and supports many users (more than 50,
usually hundreds) across many departments, the database is known as an
enterprise database
Location
o a database that supports data located at a single site is called a centralized database
Centralized systems are systems that use client/server architecture where one or more client
nodes are directly connected to a central server. This is the most commonly used type of system
in many organisations where client sends a request to a company server and receives the
response.
o Presence of a global clock: As the entire system consists of a central node(a server/ a
master) and many client nodes(a computer/ a slave), all client nodes sync up with the
global clock(the clock of the central node).
o One single central unit: One single central unit which serves/coordinates all the other
nodes in the system.
o Dependent failure of components: Central node failure causes entire system to fail.
This makes sense because when the server is down, no other entity is there to
send/receive response/requests.
Scaling
Only vertical scaling on central server is possible. Horizontal scaling will contradict the single
central unit characteristic of this system of a single central entity.
Server.
Communication link (Cables, Wi-Fi, etc.).
Use Cases
Centralized databases – all the data in one server for use.
Single player games like Need For Speed, GTA Vice City – entire game in one
system(commonly, a Personal Computer)
Application development by deploying test servers leading to easy debugging, easy deployment,
easy simulation
Personal Computers
Organisations Using
National Informatics Center (India), IBM
o A database in which every node makes its own decision, the final behavior of
the system is the aggregate of the decisions of the individual nodes is
called a decentralized database
Scaling
Vertical scaling is possible. Each node can add resources(hardware, software) to itself to increase
the performance leading to increase in performance of the entire system.
6
Components
Components of Decentralized System are,
Node (Computer, Mobile, etc.)
Communication link (Cables, Wi-Fi, etc.)
Use Cases
Blockchain
Decentralized databases – Entire database split in parts and distributed to different nodes
for storage and use. For example, records with names starting from ‘A’ to ‘K’ in one node,
‘L’ to ‘N’ in second node and ‘O’ to ‘Z’ in third node
Cryptocurrency
Organisations Using
Bitcoin, Tor network
o A database that supports data distributed across several different sites is called a
distributed database
Example
Google search system. Each request is worked upon by hundreds of computers which crawl the
web and return the relevant results. To the user, the Google appears to be one system, but it
actually is multiple computers working together to accomplish one single task (return the results
to the search query).
Scaling
Horizontal and vertical scaling is possible.
Use Cases
SOA-based systems
Multiplayer online games
Organisations Using
Apple, Google, Facebook.
how they will be used and on the time sensitivity of the information gathered from them
o Unstructured data are data that exist in their original (raw) state, that is, in the format
in which they were collected
o Structured data are the result of taking unstructured data and formatting (structuring)
such data to facilitate storage, use, and the generation of information.
o Semistructured data are data that have already been processed to some extent. For
example, if you look at a typical Web page, the data are presented to you in a
prearranged format to convey some information.
Database design refers to the activities that focus on the design of the database structure that will be
used to store and manage end-user data. A database that meets all user requirements does not just
happen; its structure must be designed carefully.
Data - “Raw”facts, such as a telephone number, a birth date, a customer name, and a year-to-
date(YTD) sales value. Data have little meaning unless they have been organized in some logical
manner.
Field – A character or group of characters (alphabetic or numeric) that has a specific meaning. A
field is used to define and store data.
Record – A logically connected set of one or more fields that describes a person, place, or thing. For
example, the fields that constitute a record for a customer might consist of the customer’s name,
address, phone number, date of birth, credit limit, and unpaid balance.
File – A collection of related records.For example, a file might contain data about the students
currently enrolled at Gigantic University
Difficulty of getting quick answers. The need to write programs to produce even the
simplest reports makes ad hoc queries impossible.
Lack of security and limited data sharing. Another fault of a file system data repository is
a lack of security and limited data sharing. Data sharing and security are closely related.
Sharing data among multiple geographically dispersed users introduces a lot of security risks.
1. Atomicity
It simply says “All or Nothing”. There is no intermediate.
If you are doing any database transaction (set of the read/write operations), all the operations should be
executed otherwise none.
All the operation in the transaction is considered to be one unit or atomic task.
If the system fails or any read/write conflicts occur during the transaction, the system needs to revert
back to its previous state.
Example:
Let’s check ACID properties in DBMS with examples.
Here, the set of operations are
If the system fails to add the amount in Bob’s account after deducting from Alice’s account,
revert the operation on Alice’s account.
2. Consistency
Every attribute in the database has some rules to ensure the stability of the database. The constraint puts
on the data value should be constant before and after the execution of the transaction.
If the system fails because of the invalid data while doing an operation, revert back the system to its
previous state.
Example:
The total amount in Alice’s and Bob’s account should be the same before and after the
transaction. The sum of the money in Alice and Bob’s account before and after the transaction is
$200. So this transaction preserves consistency ACID properties in DBMS.
3. Isolation
12
If you are performing multiple transactions on the single database, operation from any transaction
should not interfere with operation in other transactions. the execution of all transactions should be
isolated from other transactions.
Example:
If there is any other transaction (between Mac and Alice) going, it should not make any effect on
the transaction between Alice and Bob. Both the transactions should be isolated.
4. Durability
All the above three properties should be satisfied while the transaction in progress. But durability issues
can happen even after the completion of the transaction.
So this is the ACID Property After Completion of Transaction.
The changes made during the transaction should exist after completion of the transaction.
Sometimes it may happen as all the operation in the transaction completed but the system fails
immediately. In that case, changes made while transactions should persist. The system should return to
its previous stable state.
Example:
It may happen. A system gets crashed after completion of all the operations. If the system restarts
it should preserve the stable state. An amount in Alice and Bob’s account should be the same
before and after the system gets a restart.
ACID properties in DBMS make the transaction over the database more reliable and secure. This is one
of the advantages of the database management system over the file system.
1. From the discussed types of database systems, create your own database system including a
sample diagram of the nodes and server/s. Explain how it will work and it's advantages and
disadvantages. Also, explain the use cases of your design.
References
Garcia-Molina, H.,Ullman, J.,Widom, J. (2008). Database Systems: The Complete Book (2nd ed., pp 2-
14). Pearson