Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real-time Databases Presented by Parimala kyathsandra CSE 666 fall 2006 Instructor Prof. Subra ganesan.

Similar presentations


Presentation on theme: "Real-time Databases Presented by Parimala kyathsandra CSE 666 fall 2006 Instructor Prof. Subra ganesan."— Presentation transcript:

1 Real-time Databases Presented by Parimala kyathsandra CSE 666 fall 2006 Instructor Prof. Subra ganesan

2 Introduction A database is a structured and convenient way to manage and sharing of large quantities of data among multiple tasks A database is a structured and convenient way to manage and sharing of large quantities of data among multiple tasks Real time databases occur in many real time applications Real time databases occur in many real time applications In soft real time systems : banking, stock market, and airline reservation systems In soft real time systems : banking, stock market, and airline reservation systems In hard real time systems: early warning systems, In hard real time systems: early warning systems, Emergency alarm systems Emergency alarm systems

3 Basic Definitions A transaction is a sequence of read and write operations A transaction is a sequence of read and write operations In database terms, In database terms, Query –consists of only read operations Query –consists of only read operations Update- consists of write/other operations Update- consists of write/other operations

4 ACID Properties Atomicity: a transaction is done either completely or not at all Atomicity: a transaction is done either completely or not at all Consistency: transactions are executed in a given sequence Consistency: transactions are executed in a given sequence Isolation: the actions of a transaction are not visible to any other transactions until it is committed Isolation: the actions of a transaction are not visible to any other transactions until it is committed Durability: the actions of a database are permanent Durability: the actions of a database are permanent

5 Real-time Vs General Purpose Databases Real time database includes Real time database includes - The ACID properties - The ACID properties - Timing issues - Timing issues Queries to the database Queries to the database -Have soft or hard deadlines -Have soft or hard deadlines Data returned Data returned -Must have both absolute consistency and relative consistency -Must have both absolute consistency and relative consistency

6 Real-time Vs General Purpose Databases (Contd..) Absolute consistency - is the accuracy Absolute consistency - is the accuracy Relative consistency - for multiple data, the data must have been collected reasonably close to one another Relative consistency - for multiple data, the data must have been collected reasonably close to one another

7 Real-time Vs General Purpose Databases (Contd..) Example Example Boiler temperature and pressure Boiler temperature and pressure Timetemperaturepressure 100100360 200300720 300700100

8 Need For Response Time Predictability Since the tasks in real time systems have deadlines, it is important that transactions response times be predictable Since the tasks in real time systems have deadlines, it is important that transactions response times be predictable There are many factors that make it difficult to predict response times There are many factors that make it difficult to predict response times

9 Factors Affecting Predictability Transactions may be aborted to avoid deadlock Transactions may be aborted to avoid deadlock Page faults -this occurs when part of the data is stored on main memory and part of it is stored on the disk systems Page faults -this occurs when part of the data is stored on main memory and part of it is stored on the disk systems system Main memory T1 Disk Part of Data for T1

10 Factors Affecting Predictability (contd..) Transaction read/write may be data dependent Transaction read/write may be data dependent Transaction may suffer a delay because they are waiting for another to complete Transaction may suffer a delay because they are waiting for another to complete

11 Pre Analysis Pre analysis is done in order to make sure Pre analysis is done in order to make sure A transaction completes within its deadline Dry run the transaction to evaluate the processor,data and other needs Dry run the transaction to evaluate the processor,data and other needs

12 Dry Run the Transaction During the process of dry run, During the process of dry run, No writes are permitted No writes are permitted All the data required are brought to the main memory by the end of dry run, so no page fault occurs All the data required are brought to the main memory by the end of dry run, so no page fault occurs Database recovery is not initiated if the resources are not available, since nothing is written to the database Database recovery is not initiated if the resources are not available, since nothing is written to the database Dry run guarantees that the transaction completes within its deadline Dry run guarantees that the transaction completes within its deadline

13 Relaxing the ACID Properties Durability : durability can not be considered in some cases Durability : durability can not be considered in some cases Example- if some data is collected on something, it is discarded after it is outdated Example- if some data is collected on something, it is discarded after it is outdated Serialization consistency can be relaxed in cases Serialization consistency can be relaxed in cases

14 Disk Storage Problems with the disk storage Problems with the disk storage How to prioritize and schedule disk accesses How to prioritize and schedule disk accesses How to position the data on the disk so that access time is minimized How to position the data on the disk so that access time is minimized By tackling these two problems we can improve transaction response time By tackling these two problems we can improve transaction response time

15 Disk Storage (Contd..) Advantages Since disks are passive data storage devices,they hold data unless they are physically damaged Since disks are passive data storage devices,they hold data unless they are physically damaged A system crash does not affect the disk A system crash does not affect the disk When a single disk unit fails, the data on the other units are not affected When a single disk unit fails, the data on the other units are not affected

16 Main Memory Databases Since the disk accesses are slow, in order to improve the response time, we have the entire database in the main memory Since the disk accesses are slow, in order to improve the response time, we have the entire database in the main memory This can be done only if the real time database is small This can be done only if the real time database is small

17 Main Memory Databases (Contd..) If the response time is low, then the probability of lock contention is also low, since the transactions will be in the system for a smaller duration If the response time is low, then the probability of lock contention is also low, since the transactions will be in the system for a smaller duration I.E, there won’t be many transactions which are trying to access the same resources

18 Main Memory Databases (Contd..) Transaction Log Main memory can be used to write in the log when the transaction commits Main memory can be used to write in the log when the transaction commits Since the entire log is too large to be held in the main memory, it is copied to the disk Since the entire log is too large to be held in the main memory, it is copied to the disk

19 Main Memory Databases (Contd..) Transaction Log Transaction by transaction Transaction by transaction Every time a transaction commits,its log is written to the disk Every time a transaction commits,its log is written to the disk Main memory Disk t1 t2 t3 t4 t1 t2 t3 t4

20 Main Memory Databases (Contd..) Transaction Log Batch mode Batch mode The system waits until a certain volume of transactions is committed and then copies the entire batch to the disk The system waits until a certain volume of transactions is committed and then copies the entire batch to the disk Main memory Disk t1 t2 t3 t4 t1 t2 t3 t4 } batch buffer

21 Main Memory Databases (Contd..) Main Memory Databases (Contd..) Organizing Organizing It is done by pointers, if the data occurs more than once in the database,we can simply store one copy of this and have pointers to it It is done by pointers, if the data occurs more than once in the database,we can simply store one copy of this and have pointers to it Using pointers makes many of the tasks easier Using pointers makes many of the tasks easier

22 Main Memory Databases (Contd..) Drawbacks Frequent back ups are necessary Frequent back ups are necessary Main memory has to be restored after a system crash Main memory has to be restored after a system crash If the main memory fails, entire system If the main memory fails, entire system Has to be restored In case of a crash, the database must be stored with data along with the log In case of a crash, the database must be stored with data along with the log

23 Databases for Hard Real Time Systems MDARTS - is an example of a hard real time database system, it stands for multiprocessor database architecture for real time systems MDARTS - is an example of a hard real time database system, it stands for multiprocessor database architecture for real time systems Used mainly in control applications, such as controlling machine tools and robots etc Used mainly in control applications, such as controlling machine tools and robots etc

24 References Real-time systems - C.M krishna and G shin Real-time systems - C.M krishna and G shin Real-time systems design and analysis Real-time systems design and analysis -Phillip A. Laplante Real-time.Org Real-time.Org

25 Thank You !


Download ppt "Real-time Databases Presented by Parimala kyathsandra CSE 666 fall 2006 Instructor Prof. Subra ganesan."

Similar presentations


Ads by Google