by phani gowthami tammineni. overview this presentation is about the issues in real-time database...

38
INTRODUCING REAL-TIME DATABASES By Phani Gowthami Tammineni

Upload: junior-marsh

Post on 03-Jan-2016

219 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

INTRODUCING REAL-TIME DATABASESBy Phani Gowthami Tammineni

Page 2: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Overview

This presentation is about the issues in real-time database systems and presents an overview of the state of the art.

Page 3: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

DATABASE AND REAL-TIME SYSTEMS

Page 4: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

What are Real-Time Databases

Real-Time database is a database system by definition which has queries, schemas, transactions, concurrency control support, commit protocols and storage management.

In a real-time database system timing constraints are associated with transactions and data are valid for specific time intervals.

The transaction timing constraints can be completion deadlines, start times, periodic invocations and so on…

Page 5: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Databases Versus Real-Time DatabasesTRADITIONAL DATABASES

Traditional databases referred as simple databases deal with persistent data

Transactions access this data while maintaining consistency

Serializability is the correctness criterion associated with the transactions

The goal of transaction and query processing approaches adopted in database system is to achieve good throughput or response time

Page 6: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Databases Versus Real-Time DatabasesREAL-TIME DATABASES

Real-time databases deal with temporal data i.e. data becomes outdated after certain time.

Due to temporal nature of the data tasks in real-time system posses time constraints such as deadlines or periods

The goal of real-time system is to meet the time constraints of the activities.

Page 7: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

CHARACTERISTICS OF REAL-TIME DATABASE SYSTEMS

Page 8: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

Data Types Transaction Behaviors Performance Issues

Page 9: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

DATA CHARACTERSTICS

Depending on the applications, real-time system may have to handle multimedia information like audio, graphics and images.

Since systems are constantly recording the information data must have their temporal attributes recorded.

Some input devices may be to subject to noise degradation and need to record the quality of the attributes along with the data.

Systems must store execution history for maintenance or error recovery purpose

Page 10: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

TRANSACTION CHARACTERSTICS

Transactions in real-time database system can be categorized as hard and soft transactions

Hard real-time transactions are those transactions whose timing constraints are guaranteed. Missing the deadlines of these transactions result in catastrophic consequences

Soft real-time transactions have timing constraints but there may be still some justification in completing the transaction after its deadline.

Page 11: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

TRANSACTION CHARACTERSTICS

Transactions in real-time database system are used to record device readings or to handle system events. They are either periodic or event driven.

For periodic transactions most will perform updates in every period

Transactions triggered by events must take timely decisions

Page 12: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

PERFORMANCE ISSUES

The most important performance criterion is the control of concurrent transactions in order to ensure that the effect of concurrent executions is equivalent to the effect of those transactions would have had, if they had been run in some serial order

The most important requirement for real-time application is to provide a feasible schedule so that transactions can meet their hard deadlines.

Page 13: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Characteristics of RTDBS

PERFORMANCE ISSUES

Systems should degrade gracefully since their applications are often safety-critical.

To make fast and correct decisions, data availability is critical to system performance

Page 14: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

TRANSACTION SCHEDULING

Page 15: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Transaction Scheduling

Much of the work done on real-time job scheduling focuses mainly on CPU scheduling.

Transaction Scheduling however involves not only the CPU but also other resources such as data, I/O and memory. Algorithms for scheduling these resources will be discussed in the following sections of concurrency control, I/o Scheduling and Memory Management.

Page 16: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Transaction Scheduling

In a RTDBS transactions should be scheduled according to their criticalness and the tightness of their deadlines, even if this means sacrificing fairness and system throughput.

A popular method is to assign a numeric priority to each transaction which reflects its relative urgency.

A transaction has many attributes that may affect its priority.

Page 17: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Attributes that affect transaction priority Criticalness

Deadline

Amount of unfinished work

Amount of computation already invested

Age

Slackness

Page 18: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

CONCURRENCY CONTROL

Page 19: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Concurrency Control

Concurrency control refers to the control of the interaction among concurrent transactions in such a way that database consistency is preserved.

Serializability is the most popular criterion in concurrency control.

Any inconsistency introduced by concurrent transactions does not spread too much over the database because data are often short-lived

Page 20: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Concurrency Control

The prevalent approaches to concurrency control are lock based protocols and optimistic concurrency control protocols.

2PL is the most common locking protocol in conventional database system. But these conventional locking protocols are unsatisfactory for RTDBS because of

a) Priority Inversion

Higher priority transaction waiting for lower

priority one.

b) Deadlock

Page 21: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Concurrency Control

Solution:

The problem is that we still let a low priority transaction block a higher priority transaction

Page 22: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Concurrency Control

Solution:

The problem is cyclic restart

Page 23: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Concurrency Control

Solution:

Snapshot 2008-04-20 15-38-39.tiff

Page 24: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

I/O SCHEDULING

Page 25: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

I/O Scheduling

Disk I/O occupies a major portion of transaction execution time.

Disk scheduling algorithms taking timing constraints into account can significantly improve the real-time performance.

The order in which I/O requests are serviced has an immense impact on the response time and throughput of the I/O subsystem.

Page 26: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Disk Scheduling Algorithms

For example

Four requests in the I/O Queue: A, B, C, D pr(A)>pr(B)>pr(C)>pr(D)

Page 27: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Disk Scheduling Algorithms

Highest Priority First (HPF):

Highest priority is served first

HPF: A, B, C, D

The problem here is that it is not a very smart scheduling algorithm if throughput or response time is concern.

Page 28: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Disk Scheduling Algorithms

Elevator:

It moves the head from one end of the disk to the other and then back, servicing whatever requests are on its way and changing the direction whenever there are no more requests ahead in its direction.

Elevator: D, B, C, A

Elevator principle says that “ do pick them up because the disk is already there”.

The problem here is that the priority of requests is not considered.

Page 29: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Disk Scheduling Algorithms

FD-SCAN:

FD-SCAN stands for feasible deadline scan

It targets the disk head towards the track with the highest priority request but also services the requests which are on its way.

FD-SCAN: C, A, D, B

FD-Scan performs best among the algorithms tested in terms of the ability to meet deadlines.

Page 30: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

MEMORY MANAGEMENT

Page 31: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Memory Management

This section is divided into two parts

-- The dividing issue is whether memory space is tight or plentiful. If a real time system has limited amount of memory buffer management concerns the allocation of memory space.

-- Another one is, if memory is plentiful much of the data can reside in main store known as memory resident database systems

Page 32: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Buffer Management

The goal here is that highest priority transaction is not hindered by the lack of memory.

The availability of memory affects transaction response time in two ways

First before a transaction starts its execution buffers have to be allocated to the transaction. These buffers are used to store execution code, copies of file and data paged in from disk.

Page 33: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Buffer Management

Depending on the transaction, a certain number of buffers have to be allocated in order to prevent the transaction from thrashing. When memory is low transaction is blocked from execution.

Secondly some application such as image processing have high demands of memory. Their executions will be significantly slowed down if memory is tight and frequent memory swapping is done.

Thus the job of buffer manager is to allocate memory buffers to transactions intelligently such that higher priority transactions enjoy shorter response times.

Page 34: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Memory Resident Database Systems As the price of the memory continues to drop one

possible remedy is to put data directly into memory, thus eliminating I/O accesses.

Main memory access time is much faster (1000-10000) and is more predictable (no disk access).

These features are very desirable in RTDB’s and may even be necessary if transactions have extremely tight time constraints.

Page 35: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Memory Resident Database SystemsDISADVANTAGES:

MRDBS is more costly than disk based systems.

There is still a limit on how much data can be memory resident.

Data stored in main memory usually do not survive through a power failure nor a CPU failure.

Page 36: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

CONCLUSION

Page 37: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

Conclusion

Discussed various issues concerning the design and implementation of real time databases and transaction processing.

Distinguished RTDBS from traditional database systems

CPU, data, I/O and memory scheduling were also discussed.

Thus the performance of real-time database systems is measured by how well the time constraints associated with transactions are met.

Page 38: By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the

QUERIES??????