S
RELATIONAL DATABASE
MANAGEMENT SYSTEMS
(RDBMS)
Levon Khachatryan:
Database Developer
What they have in common?
Agenda
S Why to use databases?
S Database design importance
S Accessing RDBMS with SQL
S RDBMS vs. Not RDBMS
Why to use databases?
Suppose we are building a system to store the information about:
S students
S courses
S professors
S who takes what
S who teaches what
Can we do it without RDBMS?
Sure we can!
Start by storing the data in files:
S students.txt
S courses.txt
S professors.txt
Doing it without a RDBMS...
Our Task: Enroll “Mary Sargsyan” in “Programming”:
S Write a program to do the following:
1. Read ‘students.txt’
2. Read ‘courses.txt’
3. Find and update the record ‘Mary Sargsyan’
4. Find and update the record ‘Programming’
5. Write ‘students.txt’
6. Write ‘courses.txt’
Write ‘Students.txt’
Possible Issues
1. Lost connection
2. Large datasets (say 50GB)
3. Simultaneous access by many users
Why we don’t have this issues in
RDBMS?
S A transaction = sequence of statements that either all
succeed, or all fail
S Transactions have the ACID properties:
A = atomicity
C = consistency
I = isolation
D = durability
ACID
S Automicity: Each transaction is unique and make sure that if one logical
part of a transaction fails everything is rollbacked so that data are
unchanged.
S Consistency: All data written to the database are subject to the rules
defined (constraints, triggers, etc.)
S Isolation: Changes made in a transaction are not visible to other
transactions until they are committed.
S Durability: Changes committed in a transaction are stored and available in
the database even if there is power failure or the database goes offline
suddenly.
The most popular RDBMS
1. MS SQL Server
2. PostgreSQL
3. Oracle
4. DB2
Database design importance
Databases cause
90% of application
performance issues.
S Google has 3.5 billion searches
per day, which is 40,000 search
queries every second
S Amazon has 310 million active
users
Database design importance
Database design examples:
Solution 1
Database design examples:
Solution 1
Database design examples:
Solution 2
Accessing RDBMS with SQL
SQL – Structured Query
Language
S DML – Data manipulation language
S DDL – Data Definition Language
Categories of Non-relational
databases
S Key-values database: This is the simplest form of NoSQL database
where each value is associated with unique key.(ex Redis)
S Column database: This database is capable of storing and processing
large amount of data using a pointer that points to many columns
that are distributed over a cluster.(ex HBase)
S Document database: This database can contain many key-values
documents with many nested level. Efficient Querying is possible
with this database. The documents are stored in JSON format.(ex
MongoDB)
S Graph database: Instead of traditional rows and columns, this
databases uses nodes and edges to represent graph structures and
store data.(ex Neo4J)
RDBMS vs. Not RDBMS
ADVANTAGES
1. They support ACID transactional consistency and support joins.
2. Relationships in this system have constraints
3. Strong SQL
1. Relational Databases do not scale out horizontally very well (CAP Theorem)
2. Data is normalized, meaning lots of joins, which affects speed
3. They have problems working with semi-structured data
DISADVANTAGES
RDBMS
RDBMS vs. Not RDBMS
NOT RDBMS
ADVANTAGES
1. They scale out horizontally and work with unstructured and semi-
structured data
2. Mostly are open source and so free
1. Weaker or eventual consistency (BASE) instead of ACID
2. Limited support for joins
3. Does not have built-in data integrity (must do in code).
DISADVANTAGES
THANK YOU
Synergy International Systems

RDBMS

  • 1.
  • 2.
    What they havein common?
  • 3.
    Agenda S Why touse databases? S Database design importance S Accessing RDBMS with SQL S RDBMS vs. Not RDBMS
  • 4.
    Why to usedatabases? Suppose we are building a system to store the information about: S students S courses S professors S who takes what S who teaches what
  • 5.
    Can we doit without RDBMS? Sure we can! Start by storing the data in files: S students.txt S courses.txt S professors.txt
  • 6.
    Doing it withouta RDBMS... Our Task: Enroll “Mary Sargsyan” in “Programming”: S Write a program to do the following: 1. Read ‘students.txt’ 2. Read ‘courses.txt’ 3. Find and update the record ‘Mary Sargsyan’ 4. Find and update the record ‘Programming’ 5. Write ‘students.txt’ 6. Write ‘courses.txt’ Write ‘Students.txt’
  • 7.
    Possible Issues 1. Lostconnection 2. Large datasets (say 50GB) 3. Simultaneous access by many users
  • 8.
    Why we don’thave this issues in RDBMS? S A transaction = sequence of statements that either all succeed, or all fail S Transactions have the ACID properties: A = atomicity C = consistency I = isolation D = durability
  • 9.
    ACID S Automicity: Eachtransaction is unique and make sure that if one logical part of a transaction fails everything is rollbacked so that data are unchanged. S Consistency: All data written to the database are subject to the rules defined (constraints, triggers, etc.) S Isolation: Changes made in a transaction are not visible to other transactions until they are committed. S Durability: Changes committed in a transaction are stored and available in the database even if there is power failure or the database goes offline suddenly.
  • 10.
    The most popularRDBMS 1. MS SQL Server 2. PostgreSQL 3. Oracle 4. DB2
  • 11.
    Database design importance Databasescause 90% of application performance issues.
  • 12.
    S Google has3.5 billion searches per day, which is 40,000 search queries every second S Amazon has 310 million active users Database design importance
  • 13.
  • 14.
  • 15.
  • 16.
    Accessing RDBMS withSQL SQL – Structured Query Language S DML – Data manipulation language S DDL – Data Definition Language
  • 17.
    Categories of Non-relational databases SKey-values database: This is the simplest form of NoSQL database where each value is associated with unique key.(ex Redis) S Column database: This database is capable of storing and processing large amount of data using a pointer that points to many columns that are distributed over a cluster.(ex HBase) S Document database: This database can contain many key-values documents with many nested level. Efficient Querying is possible with this database. The documents are stored in JSON format.(ex MongoDB) S Graph database: Instead of traditional rows and columns, this databases uses nodes and edges to represent graph structures and store data.(ex Neo4J)
  • 18.
    RDBMS vs. NotRDBMS ADVANTAGES 1. They support ACID transactional consistency and support joins. 2. Relationships in this system have constraints 3. Strong SQL 1. Relational Databases do not scale out horizontally very well (CAP Theorem) 2. Data is normalized, meaning lots of joins, which affects speed 3. They have problems working with semi-structured data DISADVANTAGES RDBMS
  • 19.
    RDBMS vs. NotRDBMS NOT RDBMS ADVANTAGES 1. They scale out horizontally and work with unstructured and semi- structured data 2. Mostly are open source and so free 1. Weaker or eventual consistency (BASE) instead of ACID 2. Limited support for joins 3. Does not have built-in data integrity (must do in code). DISADVANTAGES
  • 20.