Chapter 2 - Client-Server Systems Flashcards
What is a database?
- collection of data
- links between entries
- accessible from many perspectives
6 advantages of a database
- Easy to share info
- see relationships
- avoid data duplication
- easier to enforce data security
- easier to enforce data integrity
- transaction friendly
2 types of database
Relational
Object Oriented
Describe Relational Database
Tables with mathematical relationships.
Rows=records
Columns=attributes
What is a foreign key?
A foreign key in this table is a primary key in that table
What does Java need in order to connect to a DBMS?
A driver (eg JDBC)
Statements vs prepared statements
Prepared statements are
- prepared long before execution
- compiled at the DB, not at the client
- safer from code injection
3 Layers of basic multi tier system (MVC)
- VIEW (the browsers/clients)
- CONTROL (the server)
- MODEL (DBMS/database)
What is the purpose of the CONTROLLER layer in a multi tier system?
Handles DB (SQL) transactions.
- load balancing
- concurrency control
- security
- logic & control
What protocols are used between the VIEW and CONTOLLER layer in a multitier system?
http - used between browser clients and server
What protocols are used between the CONTROLLER and MODEL layers in a multitier system?
SQL (between server and DBMS)
3 Advantages of Multitier Systems
- scale ability
- Reduce network congestion
- Flexibility (eg languages)
give 2 database models
Relational and Object-Oriented
What is a candidate key in a DB table?
a collection of attributes (column values) which can uniquely identify a single record
What is a primary key?
A candidate key made up of only one attribute… that attribute is the primary key
What is a foreign key?
when a record in one table refers to a primary key from another table, the primary key is called a foreign key