Chapter 20: Database System Architectures
Chapter 20: Database System Architectures
20.2
Centralized Systems
Run on a single computer system and
desk-top unit, single user, usually has only one CPU and one or two hard disks;
Multi-user system:
Serve a large number of users who are connected to the system via terminals Often called server systems.
20.3
20.4
Client-Server Systems
Server systems satisfy requests generated at m client systems,
20.5
Client-Server Systems
Database functionality can be divided into:
(Cont.)
Back-end: manages access structures, query evaluation and optimization, concurrency control and recovery. Front-end: consists of tools such as forms, report-writers, and graphical user interface facilities.
20.6
better functionality for the cost flexibility in locating resources and expanding facilities
20.7
20.8
Transaction Servers
Also called query server systems or SQL server systems
Clients send requests to the server Transactions are executed at the server Results are shipped back to the client.
20.9
Server processes
execute them and send results back allowing a single process to execute several user queries concurrently
20.10
Server processes :
simply add log records to log record buffer outputs log records to stable storage.
Checkpoint process
takes recovery actions if any of the other processes fail E.g. aborting any transactions being executed by a server process and restarting it
20.11
20.12
Buffer pool Lock table Log buffer Cached query plans (reused if same query submitted again)
All database processes can access shared memory To ensure that no two processes are accessing :
the same data structure at the same time, mutual exclusion using either: Operating system semaphores Atomic instructions such as test-and-set
20.13
database process operates directly on the lock table of sending requests to lock manager process
instead
deadlock detection
20.14
Data Servers
Used in high-speed LANs, in cases where:
The clients are comparable in processing power to the server The tasks to be executed are compute intensive.
Smaller unit of shipping more messages Worth prefetching related items along with requested item Page shipping can be thought of as a form of prefetching
Locking
Overhead of requesting and getting locks from server is high due to message delays Can grant locks on requested and prefetched items;
when there are lock conflicts. Locks on unused items can then be returned to server.
20.16 Silberschatz, Korth and Sudarshan
Data can be cached at client even in between transactions But check that data is up-to-date before it is used (cache coherency) Check can be done when requesting lock on data item
Lock Caching
Locks can be retained by client system even in between transactions Transactions can acquire cached locks locally, without contacting server Server calls back locks from clients: when it receives conflicting lock request. Client returns lock once no local transaction is using it. Similar to deescalation, but across transactions.
20.17
Parallel Systems
Parallel database systems consist of:
Throughput:
the number of tasks that can be completed in a given time interval the amount of time it takes to complete a single task from the time it is submitted
response time:
20.18
Measured by:
Scaleup:
N-times larger system used to perform N-times larger job Measured by:
Speedup
Speedup
Database System Concepts - 5th Edition, Aug 22, 2005. 20.20 Silberschatz, Korth and Sudarshan
Scaleup
Scaleup
Database System Concepts - 5th Edition, Aug 22, 2005. 20.21 Silberschatz, Korth and Sudarshan
Transaction scaleup:
20.22
Interference:
compete with each other, thus spending time waiting on other processes, rather than performing useful work.
Skew:
increases the variance in service times of parallely executing tasks. Overall execution time determined by slowest parallel tasks.
20.23
a single communication bus; Does not scale well with increasing parallelism. Mesh. Components are arranged as nodes in a grid, and each component is connected to all adjacent components Communication links grow with growing number of components, and so scales better. But may require 2n hops to send message to a node (or n with wraparound connections at edge of grid). Hypercube. Components are numbered in binary; components are connected to one another : if their binary representations differ in exactly one bit. n components are connected to log(n) other components and can reach each other via at most log(n) links; reduces communication delays.
Database System Concepts - 5th Edition, Aug 22, 2005. 20.24 Silberschatz, Korth and Sudarshan
Interconnection Architectures
20.25
Shared disk
Shared nothing
Hierarchical
20.26
20.27
Shared Memory
Processors and disks have access to a common memory,
20.28
Shared Disk
All processors can directly access all disks
if a processor fails, the other processors can take over its tasks
Downside:
Shared Nothing
Node consists of a processor, memory, and one or more disks. Processors at one node communicate with another processor at another node
Ex: Teradata, Tandem, Oracle-n CUBE Data accessed from local disks (and local memory accesses)
do not pass through interconnection network, thereby minimizing the interference of resource sharing.
Shared-nothing multiprocessors :
without interference.
Hierarchical
Combines characteristics of :
a shared-disk system, and each of the systems sharing a set of disks could be a shared-memory system.
20.31
Distributed Systems
Data spread over multiple machines
20.32
Distributed Databases
Homogeneous distributed databases
Same software/schema on all sites, data may be partitioned among sites Goal: provide a view of a single database, hiding details of distribution
Heterogeneous distributed databases
Different software/schema on different sites Goal: integrate existing databases to provide useful functionality
Differentiate between local and global transactions
A local transaction accesses data in the single site at which the transaction was initiated. A global transaction either accesses data in a site different from the one at which the transaction was initiated or accesses data in several different sites.
20.33
stored locally.
Higher system availability through redundancy data can be
replicated at remote sites, and system can function even if a site fails.
Disadvantage: added complexity required to ensure proper
Software development cost. Greater potential for bugs. Increased processing overhead.
20.34
Basic idea: each site executes transaction until just before commit, and
then leaves final decision to a coordinator even if there is a failure while waiting for coordinators decision
Network Types
Local-area networks (LANs)
20.36
Networks Types
(Cont.)
Data is replicated. Updates are propagated to replicas periodically. Copies of data may be updated independently. Non-serializable executions can thus result. Resolution is application dependent.
20.37
End of Chapter