Database Applications and the Database System Environment

Where databases are actually used, and what sits inside a running database system: the DBMS software, the stored database, the catalog, the applications and the people who keep it working.

Concept

The first phase closes by placing everything learned so far into one picture: where databases are used, and what a complete database system is made of.

Where databases are used

DomainWhat the database holdsWhat makes it demanding
BankingAccounts, transactions, loans, customersAtomicity and durability are non negotiable
Airlines and railwaysSchedules, seats, bookings, faresExtreme concurrency on a small set of rows
UniversitiesStudents, courses, enrolments, resultsHeavy read spikes on result day
Retail and e-commerceProducts, stock, orders, paymentsStock accuracy under concurrent orders
HospitalsPatients, admissions, prescriptions, testsPrivacy, auditing and long retention
TelecomSubscribers, call records, billingVery high insert volume
LibrariesTitles, copies, members, loansSimple, and the classic teaching example
ManufacturingParts, suppliers, production, inventoryComplex relationships between parts
Social platformsUsers, posts, relationships, messagesGraph shaped data and enormous scale

The database system environment

                        PEOPLE
   end users   programmers   designers   DBA   analysts
        |            |           |        |       |
        +------------+-----------+--------+-------+
                             |
                       APPLICATIONS
              screens, reports, batch jobs, APIs
                             |
                     +-------v--------+
                     |  DBMS SOFTWARE |
                     +----------------+
                     | DDL compiler   |  processes definitions
                     | DML compiler   |  processes data requests
                     | query optimiser|  chooses a plan
                     | runtime engine |  executes the plan
                     | buffer manager |  memory and pages
                     | txn manager    |  atomicity, isolation
                     | recovery mgr   |  log, undo, redo
                     | authorisation  |  who may do what
                     +-------+--------+
                             |
              +--------------v---------------+
              |  STORED DATABASE             |
              |  + STORED DATA DICTIONARY    |
              +------------------------------+

The components in words

ComponentResponsibility
DDL compilerReads definition statements and records the structure in the catalog.
DML compilerTurns data requests into an internal form the engine can run.
Query optimiserChooses among many correct plans using catalog statistics.
Runtime engineExecutes the chosen plan and returns results.
Buffer managerDecides what stays in memory and what is written to disk.
Storage managerManages files, pages, records and index structures.
Transaction managerProvides atomicity and isolation across concurrent work.
Recovery managerUses the log to restore consistency after a failure.
Authorisation managerChecks privileges before any access happens.
Data dictionaryStores the metadata every other component reads.

Example

One request through the whole system

  a student presses "show my result"
    -> application builds a request for the results view
    -> authorisation manager checks the account may read it
    -> DML compiler turns it into an internal form
    -> optimiser reads catalog statistics, picks an index scan
    -> runtime engine asks the buffer manager for pages
    -> buffer manager finds two pages cached, reads one
       from disk through the storage manager
    -> rows are returned, the application renders the page

  Nine components. The student saw a screen.

Common mistakes

  • Listing applications as part of the DBMS. They sit above it and use it.
  • Leaving the data dictionary out of the diagram. It is stored inside the database and read by nearly every component.
  • Confusing the buffer manager with the storage manager. One manages memory, the other manages files on disk.
  • Forgetting people are part of the environment. The standard diagram includes them, and marks are given for it.

Exam and interview questions

  1. Draw the database system environment and label every component.
  2. State the responsibility of the DDL compiler, the optimiser and the recovery manager.
  3. Trace one query through the system, naming each component it touches.
  4. Give five application areas of a DBMS and say what makes each demanding.
  5. Why is the data dictionary drawn inside the stored database?

Practice

  1. Pick any application on your phone. List four entities its database probably stores and one reason it needs transactions.
  2. Trace an insert, rather than a read, through the components above.
  3. Name the component that fails when: a query is suddenly slow, a crash loses data, an unauthorised user reads a table.

Conclusion

A database system is the stored database and its catalog, the DBMS software that manages them, the applications built on top and the people who design, use and administer the whole thing. Phase 2 zooms in on how those pieces are deployed across tiers.

Useful resources

Hand picked references for this topic
Written by Lorens Mishra

Default administrator account created by the installer.

Continue reading

All DBMS notes →
DBMS

File System versus DBMS

The file based approach fails on redundancy, inconsistency, isolation, atomicity, concurrency, security and integrity. Each failure maps to one specif...

Read more

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.