数据库简介 --- Database Introduction

136 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路

What is Database

  • A collection of files that store the data

What is Database Management System

  • Software that manages the DB
  • A big program that accesses and updates those files
  • Example of DBMS:

Why we need DBMS

Can we store data without DBMS ?

在这里插入图片描述 在这里插入图片描述

Problem without an DBMS

Integrity

  • The txt files cannot enforce integrity, but DBMS helps us to keep the data correct For example, GPA should be between 0 to 4, and user cannot insert values that are greater than 4.

Scalability

  • If we have big datasets,
  • the time cost for searching would be unacceptable.
  • the main memory can only keep a small fraction of the datasets, and the rest has to stay on disk

Different Views

  • The text file solution only allows one view of the data.
  • With a DBMS, could arrange for different people to have different views of the data. For example, a professor can see everything, while student can see only his/her data, and a TA can see data for students in his/her section, etc.

Security

  • A DBMS will allow multiple levels of security

Crash Recovery

  • A DBMS is able to guarantee 100% recovery from system crashes (to a consistent state)