unit i adbms

Upload: abhishek920124nair

Post on 02-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Unit I ADBMS

    1/41

    Prepared by Prof Sujit K Singh

    Unit I

    ADBMS : CONCEPTS ANDARCHITECTURES

  • 8/10/2019 Unit I ADBMS

    2/41

    UC Berkeley: IEOR 215

    Centralized and Client-Server SystemsServer System ArchitecturesParallel Database

    Distributed DatabaseWeb based system

  • 8/10/2019 Unit I ADBMS

    3/41

    UC Berkeley: IEOR 215

  • 8/10/2019 Unit I ADBMS

    4/41

    Centralized Systems Run on a single computer system and do not interact with other computer systems. General-purpose computer system: one to a few CPUs and a number of device

    controllers that are connected through a common bus that provides access to sharedmemory.

    Single-user system (e.g., personal computer or workstation): desk-top unit, singleuser, usually has only one CPU and one or two hard disks; the OS may support onlyone user.

    Multi-user system: more disks, more memory, multiple CPUs, and a multi-user OS.Serve a large number of users who are connected to the system vie terminals. Oftencalled server systems.

  • 8/10/2019 Unit I ADBMS

    5/41

    A Centralized Computer System

  • 8/10/2019 Unit I ADBMS

    6/41

    Client-Server Systems Server systems satisfy requests generated at mclient systems, whose general structure is

    shown below:

  • 8/10/2019 Unit I ADBMS

    7/41

    Client-Server Systems (Cont.) Database functionality can be divided into:

    Back-end: manages access structures, query evaluation and optimization,concurrency control and recovery.

    Front-end: consists of tools such asforms, report-writers, and graphical userinterface facilities.

    The interface between the front-end and the back-end is through SQL or through anapplication program interface.

  • 8/10/2019 Unit I ADBMS

    8/41

    Client-Server Systems (Cont.) Advantages of replacing mainframes with networks of workstations or personalcomputers connected to back-end server machines:

    better functionality for the cost

    flexibility in locating resources and expanding facilities

    better user interfaces easier maintenance

  • 8/10/2019 Unit I ADBMS

    9/41

    UC Berkeley: IEOR 215

  • 8/10/2019 Unit I ADBMS

    10/41

    Server System Architecture Server systems can be broadly categorized into two kinds: transaction serverswhich are widely used in relational database systems, and

    data servers, used in object-oriented database systems

  • 8/10/2019 Unit I ADBMS

    11/41

    Transaction Servers Also called query serversystems or SQLserversystems Clients send requests to the server

    Transactions are executed at the server

    Results are shipped back to the client.

    Requests are specified in SQL, and communicated to the server through a remoteprocedure call (RPC) mechanism.

    Transactional RPC allows many RPC calls to form a transaction.

    Open Database Connectivity (ODBC) is a C language application program interfacestandard from Microsoft for connecting to a server, sending SQL requests, andreceiving results.

    JDBC standard is similar to ODBC, for Java

  • 8/10/2019 Unit I ADBMS

    12/41

    Transaction Server Process Structure

    A typical transaction server consists of multiple processes accessing data in sharedmemory.

    Server processes

    These receive user queries (transactions), execute them and send results back

    Processes may be multithreaded, allowing a single process to execute several userqueries concurrently

    Typically multiple multithreaded server processes

    Lock manager process

    More on this later

    Database writer process

    Output modified buffer blocks to disks continually

    Transaction Ser er Processes (Cont )

  • 8/10/2019 Unit I ADBMS

    13/41

    Transaction Server Processes (Cont.)

    Log writer process

    Server processes simply add log records to log record buffer

    Log writer process outputs log records to stable storage.

    Checkpoint process

    Performs periodic checkpoints

    Process monitor process

    Monitors other processes, and takes recovery actions if any of the other processes

    fail E.g. aborting any transactions being executed by a server process and restarting

    it

    T ti S t P (C t )

  • 8/10/2019 Unit I ADBMS

    14/41

    Transaction System Processes (Cont.)

  • 8/10/2019 Unit I ADBMS

    15/41

    Transaction System Processes (Cont.)

    Shared memory contains shared data 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 sametime, databases systems implement mutual exclusionusing either

    Operating system semaphores

    Atomic instructions such as test-and-set

    To avoid overhead of interprocess communication for lock request/grant,each database process operates directly on the lock table

    instead of sending requests to lock manager process Lock manager process still used for deadlock detection

  • 8/10/2019 Unit I ADBMS

    16/41

    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.

    Data are shipped to clients where processing is performed, and then shipped resultsback to the server.

    This architecture requires full back-end functionality at the clients.

    Used in many object-oriented database systems

    Issues:

    Page-Shipping versus Item-Shipping

    Locking

    Data Caching

    Lock Caching

  • 8/10/2019 Unit I ADBMS

    17/41

    Data Servers (Cont.) Page-shippingversus item-shipping

    Smaller unit of shippingmore messages

    Worth prefetchingrelated 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 messagedelays

    Can grant locks on requested and prefetched items; with page shipping,transaction is granted lock on whole page.

    Locks on a prefetched item can be P{called back} by the server, and returned byclient transaction if the prefetched item has not been used.

    Locks on the page can be deescalatedto locks on items in the page when thereare lock conflicts. Locks on unused items can then be returned to server.

  • 8/10/2019 Unit I ADBMS

    18/41

    Data Servers (Cont.) Data Caching

    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 backlocks from clients when it receives conflicting lock request.Client returns lock once no local transaction is using it.

    Similar to de-escalation , but across transactions.

  • 8/10/2019 Unit I ADBMS

    19/41

    Cloud Computing?

    The cloud is Internet-based computing,whereby shared resources, software, andinformation are provided to computersand other devices on demand pay peruse.

    Cost-effective means of virtualising and making use ofresources more effectively Low start-up costs pay for use helps to kick-start companies

    Scaling is proportional to demand (revenue) so it

    s a good businessmodel

    Vast range of Cloud Computing applications Virtual private servers, Web hosting, data servers, Transaction server,

    etc

  • 8/10/2019 Unit I ADBMS

    20/41

    Basic Cloud Characteristics The no-need-to-knowin terms of the underlying details

    of infrastructure, applications interface with the

    infrastructure via the APIs.

    The flexibility and elasticityallows these systems to

    scale up and down at will

    utilising the resources of all kinds

    CPU, storage, server capacity, load balancing, and databases

    The pay as much as used and neededtype of utility

    computing and the always on, anywhere and any place

    type of network-based computing.

    19

  • 8/10/2019 Unit I ADBMS

    21/41

    Basic Cloud Characteristics Cloud are transparent to users and applications, they can be

    built in multiple ways

    branded products, proprietary open source, hardware or

    software.

    In general, they are built on clusters of PC servers plus Open

    Source software combined with in-house applications and/orsystem software.

    20

  • 8/10/2019 Unit I ADBMS

    22/41

    Motivation Example: Forbes.com

    You offer on-line real timestock market data

    Why pay for capacityweekends, overnight?

    9 AM - 5 PM,M-F

    ALL OTHER

    TIMES

    Rate of

    Server

    Accesses

  • 8/10/2019 Unit I ADBMS

    23/41

    Forbes' Solution

    Host the web site inAmazon's EC2 Elastic ComputeCloud

    Provision new servers every day, and deprovisionthem every night

    Pay just $0.10* per server per hour

    * more for higher capacity servers

    Let Amazon worry about the hardware!

  • 8/10/2019 Unit I ADBMS

    24/41

    virtualization to the next step

    You dont have to own the hardware

    You rentit as needed from a cloud

    There are public clouds

    e.g. Amazon EC2, and now many others (Microsoft, IBM,Sun, and others ...)

    A company can create a private one

    With more control over security, etc.

    Cl d C ti O i

  • 8/10/2019 Unit I ADBMS

    25/41

    Cloud Computing Overview

  • 8/10/2019 Unit I ADBMS

    26/41

    UC Berkeley: IEOR 215

    A Basic Introduction

  • 8/10/2019 Unit I ADBMS

    27/41

    Web Based system :Web servers are the machines or programs from which requests are

    made and fulfilled over the Internet. They provide one of theendpoints in communication when users request an online service

    Tiermean a physical tier defined by a physical server.

    Layermean a section of the system that is contained within its own process or

    deployment unit. Multiple layers may co exist on one tier.

    Business LogicA workflow or procedure that defines the way a company conducts business .

  • 8/10/2019 Unit I ADBMS

    28/41

    Client Server Architecture

    A network architecturein which each computeror process on thenetwork is either aclientor a server.

    May 2002 UNT Center for Digital Knowledge 27

    Source: http://webopedia.lycos.com

  • 8/10/2019 Unit I ADBMS

    29/41

    Components Clients

    Servers

    Communication Networks

    May 2002 UNT Center for Digital Knowledge 28

    Client

    Server

  • 8/10/2019 Unit I ADBMS

    30/41

    Clients Applications that run on computers

    Rely on servers for

    Files

    Devices

    Processing power Example: E-mail client

    An application that enables you to send and receive e-mail

    May 2002 UNT Center for Digital Knowledge 29

    Clients are Applications

  • 8/10/2019 Unit I ADBMS

    31/41

    Servers Computers or processes that manage network resources

    Disk drives (file servers)

    Printers (print servers)

    Network traffic (network servers) Example: Database Server

    A computer system that processes database queries

    May 2002 UNT Center for Digital Knowledge 30

    Servers Manage Resources

    Cli S C i

  • 8/10/2019 Unit I ADBMS

    32/41

    ClientServer Computing

    Process takes place

    on the server and on the client

    Servers

    Store and protect data

    Process requests from clients Clients

    Make requests

    Format data on the desktop

    May 2002 UNT Center for Digital Knowledge 31

    Client-Server Computing Optimizes

    Computing Resources

  • 8/10/2019 Unit I ADBMS

    33/41

    Problem Of Client/Server The biggest and the most pressing problem at that time was one

    of connection count

    Servers were often licensed per client connection

    In the 1990's most databases began to become heavily and thespeed of database reduced

  • 8/10/2019 Unit I ADBMS

    34/41

    3-Tier Architecture Come To Solve Client/Server Problems

    A middle layer can solve these problems(Transactionprocessing monitors, Message servers, Application servers,Object Request Brokers (ORB))

  • 8/10/2019 Unit I ADBMS

    35/41

    N-Tier Architecture

  • 8/10/2019 Unit I ADBMS

    36/41

    N Tier Architecture N-Tier: An unlimited number of tiers.

    Each tier may have multiple computers.

    Advantages: More powerful applications

    Many services to many clients

    Enhanced security, scalability and availability

    Disadvantages: Much more complicated to design and model

    Performance risks

    Reliability is more difficult to achieve

    More difficult to maintain software

  • 8/10/2019 Unit I ADBMS

    37/41

    Types Of N-Tier Architecture

    Business Logic

  • 8/10/2019 Unit I ADBMS

    38/41

    Business Logic

    Business logicis a non-technical term generally used todescribe the functional algorithms that handleinformation exchange between a database and a userinterface.

    models real life business objects (such as accounts, loans,itineraries, and inventories)

    enforces the methods by which business objects are accessedand updated.

    business rules that express business policy (such as Taxes,logistics, prices, and products)

  • 8/10/2019 Unit I ADBMS

    39/41

    Location of business logic

    In a multilayered architecture (2-tire architecture)business logic is a separate module.

    In the common 3-tier architecture, the business logic is

    the middle tier.

  • 8/10/2019 Unit I ADBMS

    40/41

    Business Logic SOAP (Simple Object Access Protocol) SOAP is an XML-based messaging protocol. It defines a set of

    rules for structuring messages that can be used for simple one-way messaging but is particularly useful for performing RPC-style (Remote Procedure Call) request-response dialogues.

    It is not tied to any particular transport protocol though HTTP ispopular. Nor is it tied to any particular operating system orprogramming language so theoretically the clients and servers inthese dialogues can be running on any platform and written inany language as long as they can formulate and understandSOAP messages

  • 8/10/2019 Unit I ADBMS

    41/41

    SOAP (Simple Object Access Protocol) is a way for aprogram running in one kind of operating system (such as

    Windows 2000) to communicate with a program in thesame or another kind of an operating system (such asLinux) by using the World Wide Web's HypertextTransfer Protocol (HTTP)and its Extensible MarkupLanguage (XML) as the mechanisms for informationexchange .

    SOAP was developed byMicrosoft, DevelopMentor, andUserland Software and has been proposed as a standardinterface to the Internet Engineering Task Force (IETF).