Example: barber

Introduction to Database Systems What Is a DBMS? CS186

1 Introduction to Database SystemsCS186 Knowledge is of two kinds: we know a subject ourselves, or we know where we can find information upon it. --Samuel Johnson (1709-1784)What Is a DBMS? Database : a very large, integrated collection of data. Models real-world enterprise Entities ( , students, courses) Relationships ( , Janet Reno is taking CS186 ) A Database Management system (DBMS)is a software system designed to store and manage Study Databases?? 1990 s: shift from computationto information always true for corporate computing the Web made this point for personal computing more and more true for scientific computing Datasets increasing in diversity and volume. Corporate: retail swipestreams/clickstreams, customer relationship management , supply chain management , data warehouses , etc. Scientific: digital libraries, Human Genome project, NASA Mission to Planet Earth, sensors .. need for DBMS has exploded in the last years DBMS encompasses most of CS in a practical discipline OS, languages, theory, AI, multimedia, logic Yet traditional focus on real-world apps?

1 Introduction to Database Systems CS186 “Knowledge is of two kinds: we know a subject ourselves, or we know where we can find information upon it.”

Tags:

  Database, Introduction, System, Introduction to database systems

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Introduction to Database Systems What Is a DBMS? CS186

1 1 Introduction to Database SystemsCS186 Knowledge is of two kinds: we know a subject ourselves, or we know where we can find information upon it. --Samuel Johnson (1709-1784)What Is a DBMS? Database : a very large, integrated collection of data. Models real-world enterprise Entities ( , students, courses) Relationships ( , Janet Reno is taking CS186 ) A Database Management system (DBMS)is a software system designed to store and manage Study Databases?? 1990 s: shift from computationto information always true for corporate computing the Web made this point for personal computing more and more true for scientific computing Datasets increasing in diversity and volume. Corporate: retail swipestreams/clickstreams, customer relationship management , supply chain management , data warehouses , etc. Scientific: digital libraries, Human Genome project, NASA Mission to Planet Earth, sensors .. need for DBMS has exploded in the last years DBMS encompasses most of CS in a practical discipline OS, languages, theory, AI, multimedia, logic Yet traditional focus on real-world apps?

2 What s the intellectual content? Main themes: representing information data modeling languages and Systems for queryingdata complex queries with real semantics* over massive data sets concurrency controlfor data manipulation controlling concurrent access ensuring transactional semantics reliable data storage maintain data semantics even if you pull the plug* semantics: the meaning or relationship of meanings of a sign or set of signsThis Week: A CS186 Infomercial A free tasting of things to come in this class: file Systems & DBMSs data modeling concurrent, fault-tolerant data management DBMS architecture An Introduction to the Relational Model & SQL (Next time)Administrivia I am not Prof. Franklin! He is away until Thursday. He will hold special office hours this week Friday 2-3 (687 Soda). You need to see Prof. Franklin for any administrative questions you have. Discussion sections will not be held this week.

3 They will begin next week on Wed, 9/6. NT and UNIX accounts To be handed out on Wed, 9/6. Homework 0 (mandatory) is due Mon, 9 Home page: ~ CS186 Yanlei Diao and Asha Tarachandani Office Hours: TBA Textbook Ramakrishnanand Gehrke, 2ndEdition Grading policy, etc. on Web Page Class bulletin board Overenrollment again across CS The CS department administration makes the call : forms up front, see Michael-David Sasson TA s & Prof. cannot help!! Course is overbooked, drops won t free space CS186 will be offered again in the spring people who can t get in now are supposed to get priorityOS Support for Data Management Data can be stored in RAM this is what every programming language offers! RAM is fast, and random access Isn t this heaven? Every OS includes a File system manages fileson a magnetic disk allows open, read, seek, closeon a file allows protections to be set on a file drawbacks relative to RAM?

4 Database Management Systems What more could we want than a file system ? Simple, efficient ad hoc1queries concurrency control recovery benefits of good data modeling Not as we ll see this semester in fact, the OS often gets in the way!1ad hoc: formed or used for specific or immediate problems or needs2 SMOP: Small Matter Of ProgrammingDescribing Data: Data Models A data modelis a collection of concepts for describing data. Aschemais a description of a particular collection of data, using the a given data model. The relational model of datais the most widely used model today. Main concept: relation, basically a table with rows and columns. Every relation has a schema, which describes the columns, or of Abstraction Many views, single conceptual (logical) schemaand physical schema. Views describe how users see the data. Conceptual schema defines logical structure Physical schema describes the files and indexes SchemaConceptual SchemaView 1 View 2 View 33 Example: University Database Conceptual schema: Students(sid: string, name: string, login: string, age: integer,gpa:real) Courses(cid: string,cname:string, credits:integer) Enrolled(sid:string, cid:string, grade:string) Physical schema: Relations stored as unordered files.

5 Index on first column of Students. External Schema (View): Course_info(cid:string,enrollment:intege r)Data Independence Applications insulated from how data is structured and stored. Logical data independence: Protection from changes in logical structure of data. Physical data independence: Protection from changes in physicalstructure of of the most important benefits of using a DBMS!Concurrency Control Concurrent execution of user programs: key to good DBMS performance. Disk accesses frequent, pretty slow Keep the CPU working on several programs concurrently. Interleaving actions of different programs: trouble! , deposit & withdrawal on same account at once DBMS ensures such problems don t arise: users can pretend they are using a single-user system . Thank goodness!Transaction: An Execution of a DB Program Key concept is a transaction: an atomic sequence of Database actions (reads/writes). Each transaction, executed completely, must take the DB from one consistent state to another.

6 Users can specify simple integrity constraints on the data. The DBMS will enforce these constraints. Beyond this, the DBMS does not understand the semantics of the data. ( , it does not understand how the interest on a bank account is computed). Ensuring that a single transaction (run alone) preserves consistency is ultimately the user s responsibility!Scheduling Concurrent Transactions DBMS ensures that execution of {T1, .. ,Tn} is equivalent to some serialexecution T1 ..Tn . Before reading/writing an object, a transaction requests a lock on the object, and waits till the DBMS gives it the lock. All locks are held until the end of the transaction. (Strict 2 PLlocking protocol.) Idea: If an action of Ti (say, writing X) affectsTj(which perhaps reads X), one of them, say Ti, will obtain the lock on X first andTjis forced to wait until Ti completes; this effectively orders the transactions. What ifTjalready has a lock on Y and Ti later requests a lock on Y?

7 (Deadlock!) Ti orTjis abortedand restarted! Ensuring Atomicity DBMS ensures atomicity(all-or-nothing property) even if system crashes in the middle of aXact. Idea: Keep a log(history) of all actions carried out by the DBMS while executing a set ofXacts: Beforea change is made to the Database , the corresponding log entry is forced to a safe location. (WAL protocol; OS support for this is often inadequate.) After a crash, the effects of partially executed transactions are undoneusing the log. (Thanks to WAL, if log entry wasn t saved before the crash, corresponding change was not applied to Database !)4 The Log The following actions are recorded in the log: Ti writes an object: the old value and the new value. Log record must go to disk beforethe changed page! Ti commits/aborts: a log record indicating this action. Log records chained together byXactid, so it s easy to undo a specificXact( , to resolve a deadlock).

8 Log is oftenduplexedand archivedon stable storage. All log related activities (and in fact, all CC related activities such as lock/unlock, dealing with deadlocks etc.) are handled transparently by the of a DBMS A typical DBMS has a layered architecture. The figure does not show the concurrency control and recovery components. This is one of several possible architectures; each system has its own Optimizationand ExecutionRelational OperatorsFiles and Access MethodsBuffer ManagementDisk Space ManagementDBThese layersmust considerconcurrencycontrol andrecoveryFYI: A text search engine Less system than DBMS Uses OS files for storage Just one access method One hardwired query regardless of search string Typically no concurrency or recovery management Read-mostly Batch-loaded, periodically No updates to recover OS a reasonable choice Smarts: text tricks Search string modifier ( stemming and synonyms) Ranking Engine (sorting the output, by word or document popularity) no semantics.

9 WYGIWIGYThe Access MethodBuffer ManagementDisk Space ManagementDBOSThe QuerySearch String ModifierSimple DBMS}Ranking EngineThere may be time to talk about some of thesetext tricks in this class, but it won t be a of a DBMS Data independence Efficient data access Data integrity & security Data administration Concurrent access, crash recovery Reduced application development time So why not use them always? Can be expensive, complicated to set up and maintain This cost & complexity must be offset by need General-purpose, not suited for special-purpose tasks ( text search!)-Yet often worth usingDatabases make these folks happy .. DBMS vendors, programmers Oracle, IBM, MS, Sybase, Informix, NCR, .. End users in many fields Business, education, science, .. DB application programmers Build data entry & data analysis tools on top of DBMSs Build web services that run off DBMSs Database administrators (DBAs) Design logical/physical schemas Handle security and authorization Data availability, crash recovery Database tuning as needs understand how a DBMS worksSummary DBMS used to maintain, query large datasets.

10 Benefits include: recovery from system crashes, concurrent access, quick application development, data integrity and security. Levels of abstraction give data independence. A DBMS typically has a layered architecture.. , cont. DBAs, DB developers a keypart of the informationeconomy DBMS R&D represents a broad,fundamental branch of the scienceof computatio


Related search queries