(10) Multi-Tier-Architecture Flashcards
What is a naive design of the IT infrastructure and which problems does it have?
- Each PC has all kinds of software and good hardware
- Data is managed on each PC separately
Problems:
- Software: administration, updates
- Hardware: expense factor, administration
- Data: consistency, redundancy
How are information systems designed today?
- Distributed Systems
- Reason: used by a large number of software and hardware components
What are the three major responsibilities of application architecture?
- Interaction with the user
Processing the business process
Storing/ managing the involved data
Explain N-Tier Architecture
- Software systems are often divided into parts (tiers)
- Tiers are developed and tested separate from each other
- Tiers only communicate with its adjacent
- The single components are interconnected by a network composing a distributed system
What Tiers does the Three-Tier-Architecture contain?
- Presentation Tier (low cost computer): Interaction with the user, takes input and shows result
- Processing Tier (The application’s brain): Take input of presentation tier and processes it, seres a number of presentation tiers
- Data Tier (Persistent storage of data): Stores all necessary data and information, manages access to data and its manipulation
What are the components of a typical Three-tier-Architecture?
- Workstation which runs a standard user interface (presentation tier)
- Application Server (processing tier)
- Database (Data Tier)
What are the components of the Presentation Tier?
- PC
- Workstations
- Mobile Terminals
- Identification Technology
What are the components of the Processing Tier?
Application Server: Server in a computer network on which applications are hosted
- provides services which can be used by network terminals via interfaces
- knowledge about how the input is to be processed and which data has to be retrieved for the process
- Business logic is implemented here
What is Business logic good for?
Defines a process over actors, activities and relations
How is a business process realised?
- over workflows
- the state of processes is maintained in a database
Name two examples where the three-tier system can be applied
- Machine scheduling
- Product distribution
What is the task of the Data Tier?
The state of the business logic has to be stored and must be accessible for users and the application server.
What are responsibilities of the Data Tier?
- Persistent storage of data
- Coordination of concurrent access
How is the data organised in the Data Tier?
Data Tier comprises elements which provide:
- persistent storage of data
- reading and writing access to this data
Within a computer system data can be organised in a hierarchical way.
What is the Data File Approach?
Data is stored in the computer’s file system.
- Often IS-systems were not planned inter-divisional, but separate from each other
- Sharing of data was not considered
- The organisation of data was tailored towards division-specific applications (data cannot be used by other applications)
What are the problems of the Data File Approach?
- Redundancy and inconsistency
- Dependency between application and data
- No exchange of data and lack of flexibility
- No data security
Explain the Problem “Redundancy and inconsistency” of the Data File Approach
- Redundancy: multiple copies of a date in different data files
- Inconsistency: different values are saved for one attribute
Explain the Problem “Dependency between application and data” of the Data File Approach
- Data in files and software for data processing are strongly connected
- Change in program code requires change in data structure
Explain the Problem “No exchange of data and lack of flexibility” of the Data File Approach
- Data in files are inflexible with respect to evaluations and relationships
- Concurrent access to multiple attribute and selection of data element s requires expensive searching and sorting
- No data exchange between divisional information systems
Explain the Problem “No data security” of the Data File Approach
- Access to data and their modification cannot be controlled
What does a Database System consist of?
Database (data) + Database Management System (code to access data)
What is a database?
A database is a structured collection of data records.
- It stores data in a way that a computer program may query the database
- The returned data is the answer to the query
- The extracted data records are said to be information
What is a database schema and what is it good for?
The structural description of a database is called the schema of the database.
A database needs a structural description of:
- the objects which are stored in the database and their characteristics
- the relationship between these objects
Relational Database Definition
- Data is stored in tables
- Every column is identified by a name
- Every row is identified by several values composing a data record
- Every table represents a set of entities of the same type
- The entity type is specified by a set of attributes (defined by columns names)
- Specific entity is specified by the attribute values
What are advantages of relational databases?
- In contrast to a file, tables allow easy structuring of data
- Single data records can be retrieved, updated or deleted
- Primary key for each table is required
Database Management System Definition
- Collection of programs which enable the central and efficient management of data
- Interface between application and data
- Separates the physical from the logical data structure (physical: How is data structured, e.g. Hashmap); logical: how is data represented to user -> tables)
Which components for creation, manipulation and evaluation of data does a DBMS offer?
- Data Definition Language (DDL)
- Data Manipulation Language (DML)
- Data Control Language (DCL)
Data Definition Language - Definition
Provides means to define the schema of a database (logical view)
Data Manipulation Language - Definition
- Used to process the data in the database
- Offers constructs to the user to retrieve, insert, delete, and update data in the database
Data Control Language - Definition
- Allows to control the acmes to data in the database
What is SQL?
- Most popular computer language for relational databases
- Provides a set of instructions to define and create databases and manipulate data in databases
- Originally developed as a DML but provides means to be used as as DDL and DCL
What are the advantages of a DBMS?
Solves the problems the traditional file approach reveals:
- Redundancy and inconsistency control
- Independence between application and data
- Provides a transaction mechanism
- Allows and manages the data access of multiple users
- Manages and enforces the access rights to data
Explain the Advantage “Redundancy and inconsistency control” of DBMS
- Specific entity should be stored exactly once
- Additional information for entity may be stored in other tables (use foreign key)
- DBMS provides means to propagate changes to referencing elements in databases
Explain the Advantage “Independence between application and data” of DBMS
- Applications do not directly access or manipulate data
- Data is exclusively managed by DBMS
Explain the Advantage “Provides a transaction mechanism” of DBMS
- Besides atomic database operations a DBMS also allows transaction
- Either the entire group of operations is executed or not a single operation at all
- If a transaction is executed every single operation has to be performed and the resulting database state has to be consistent (otherwise roll-back)
What is a transaction?
Group of atomic operations which is executed as a single unit without interference by other database operations.
Explain the ACID paradigm
- Atomicity: transaction has to be treated as the smallest, non-dividable unit (either all operations are executed or no operation at all)
- Consistency: state of the database may be inconsistent during transaction but has to be consistent after completion
- Isolation: different transactions which are executed in parallel must not interfere with each other; intermediate results of transactions are not visible to any other transaction
- Durability: effects of a successful transaction on a database are persistent
What is the problem regarding the data access of multiple users?
- If data is organised on a central unit, data access has to be coordinated
- Problem: multiple users may perform operations at the same time but restricting the use of the database to a single user at at time would waste resources
- > Lost update, Dirty read, Phantoms
Lost Update Definition
- The effect of one transaction is overwritten by another transaction (the update gets lost)
Dirty Read Definition
- Transaction T2 was processed based on inconsistent data
- Rollback of T1 also requires rollback of T2
Phantoms Definition
- While processing transaction T2, transaction T1 generates a date that should have been considered by T2
- The generated data is called a phantom
What are solution to the problems of multiple user data access?
DBMS provides means to synchronise multiple users:
- Serializability: Controlled execution of a set of transactions -> transactions appear to be performed in isolation
- Locking: Data which needs to be accessed is locked for a particular transaction and is unlocked when transaction is executed
Example for DDL
Create
Example for DML
Select
Example for DCL
Grant
SQL (DDL): Which different possibilities exist when updating/deleting a row?
- On Delete No Action: not allowed, rolle-back
- On Delete Cascade: row in foreign table is deleted as well (or foreign key is updated for update)
- On Delete Set Null: Foreign key is set to null
- On Delete Set Default: Foreign key is set to a default value
What are the most important SQL statements of the DML language?
- Select
- Insert
- Delete
- Update
SQL Query that gives certain rows as output
SELECT * FROM course
JOIN room ON (course.room = room.name)
WHERE (room_number = O131);
What is the advantage of using foreign keys in relational databases over extending tables by the required columns?
Avoiding redundancy and inconsistency