32
Angela M. Carthan Advanced Database Systems CSC 8712 Georgia State University Department of Computer Science Technology 15 April 2008 Embedded Database Management Systems

Embedded Database Management Systems

Embed Size (px)

DESCRIPTION

Embedded Database Management Systems. Angela M. Carthan Advanced Database Systems CSC 8712 Georgia State University Department of Computer Science Technology 15 April 2008. Outline. What are Embedded Database Management (EDBM) Systems? Embedded Database vs. Regular Database Systems - PowerPoint PPT Presentation

Citation preview

Page 1: Embedded Database Management Systems

Angela M. CarthanAdvanced Database Systems CSC 8712

Georgia State UniversityDepartment of Computer Science

Technology15 April 2008

Embedded Database Management Systems

Page 2: Embedded Database Management Systems

OutlineWhat are Embedded Database

Management (EDBM) Systems?Embedded Database vs. Regular

Database SystemsReal Time Database for Embedded SystemsEmbedding the db4o Object-Oriented

DatabaseReducing Energy Consumption of Queries in

Memory-residentDatabase Systems Storage Elasped Time

Object Analysis Patterns for Embedded Systems

Page 3: Embedded Database Management Systems

Introduction

•Embedded DBMS vs. regular DBMS???•Handling Complex Operations•Disk Storage Space

Expectations for user have

gone up

•Size•Cost•Newer Design

Growth in Memory

Technology

•Data being shifted from memory to disk

DBMS capabilities are

improving nowadays

Page 4: Embedded Database Management Systems

What are Embedded Database Management Systems?Embedded Systems- A specialized

computer system that is part of a larger system. Housed on a single microprocessor board

with the programs stored in ROM. All appliances that have a digital interface .

watches microwaves, VCRs, cars -- utilize embedded systems

Embedded Database Systems- A database management system (DBMS) embedded into an application.Introduced in 1980’s

The first embedded databases largely 8-bit, or possibly 16-bit

Nowadays EDBMS matured and gained faster (32-bit) processors, memory, and more complexity.

Page 5: Embedded Database Management Systems

Diagram of Embedded Storage

Page 6: Embedded Database Management Systems

Real Time Database for Embedded SystemsOften assumed that fast data processing

engine, meets real-time requirements. Input data must be correlated, merged, or

compared. Data must be shared by concurrent tasks

with different functions, time requirements and degrees of importance.

Real Time systems use DBMS as a part of the architectureSimplify designStreamline developmentImprove performance.

Page 7: Embedded Database Management Systems
Page 8: Embedded Database Management Systems

Current Usage of RTDMS using Embedded SystemsMcObject’s eXtremeDB - the latest

commercial addition to family of EDB for real time-systems.Eliminate performance overhead while

providing a predictable and reliable transactional model.

Works best for pseudo-real-time and real-time systems;telecommunications equipment, factory floor

automation systems, process control, zero-latency consumer electronics devices, and medical equipment.

Page 9: Embedded Database Management Systems

Vs. Traditional Database Systems

Real-time database systems (RTDBSs) - repositories for data and provide efficient storage, retrieval and manipulation of data.

Differences lie in the requirements of the managed data, timing constraints on transactions, and performance goals.T

Conventional DBMS goal is to achieve good throughput or average response time

Real-Time DBMS provides a predictable response time to guarantee the completion of time-critical transactions.

Page 10: Embedded Database Management Systems

Embedding the db4o Object Oriented Databasedb4o -open-source, object-oriented

database from db4objects. Versions of db4o exist for Java

and .NET/Mono. It's an ideal OODBMs engine for Linux

applications written in either the Java or .NET frameworks.

Allows multiuser access- any access on the database is invisibly wrapped in a transaction and all operations adhere to ACID principles (atomicity, consistency, isolation and durability).

Page 11: Embedded Database Management Systems

Example;A Dictionary DatabaseThe application manipulates a database that

stores words and their definitions. In such an application, we might define a class to model dictionary entries as follows:

Page 12: Embedded Database Management Systems

Define Classpublic class DictEntry

{

private string theWord;

private string pronunciation;

private ArrayList definitions;

public DictEntry()

{

}

// Create a new Dictionary Entry

public DictEntry(string _theWord,

string _pronunciation)

{ theWord = _theWord;

pronunciation = _pronunciation;

definitions = new ArrayList();

}

Page 13: Embedded Database Management Systems

Develop a class describing definitionpublic class Defn

{

public static int NOUN = 1;

public static int PRONOUN = 2;

public static int VERB = 3;

public static int ADJECTIVE = 4;

public static int ADVERB = 5;

public static int CONJUNCTION = 6;

public static int PARTICIPLE = 7;

public static int GERUND = 8;

private int pos;

private string definition;

public Defn(int _pos,

string _definition)

{

pos = _pos;

definition = _definition;

}

Page 14: Embedded Database Management Systems

Individual characters within a word are stored at different node levels.

Page 15: Embedded Database Management Systems

Activation Depth-Ie; Suppose I've fetched object A into

memory from a db4o database using a db.get() call. If I then call db.activate(A,6), that tells db4o also to fetch into memory all objects referenced by A, up to a depth of 6.

db.activate() calls that are sprinkled throughout the search routines of the binary tree and the trie classes ensure that the search operation always pulls in enough of the index so that the search can proceed.

Object Memory

Db.get()

Db.activate(A.6)

Page 16: Embedded Database Management Systems

Drawbacks

Accessibility

Poor Elapsed Time Rate

Page 17: Embedded Database Management Systems

Vs. Traditional Database Systems

Unlike Traditional object-relational database systems, db4o does not require you to pass your code through an instrumentation pre- or post-compilation step.

Nor must classes whose objects are to be made persistent be derived from a special persistence-aware superclass.

db4o works with ordinary objects, and does not to be informed of an object's structure before that object is stored into a db4o database.

Page 18: Embedded Database Management Systems

Reducing Energy Consumption of Queries in Memory-resident Database SystemsMemory paradigm is different

Partitioned and more structuredBanks – each bank can be controlled individuallyLot of work done for compilers, OS and

architectureAuthor’s goal

Study the implications of banked memory environment on memory-resident databases

Reduce energy consumption of embedded systems that run such DBMS

Any interesting takes from DBMS?Cannot simply extend existing modelsHardware and DB designers can use our results

for redesigning embedded DBMS

Page 19: Embedded Database Management Systems

text Query OptimizerQuery Execution

Engine

Memory Database

Queries

Data

Results

Energy & Performance Optimizations

(Using Cost Plan)

Hardware Optimizations

Targeting DBMS

Rewrite SystemParser

System Catalog

Page 20: Embedded Database Management Systems

Banked Memory

Configuration Registers

Self-Monitoring/Prediction Hardware

Memory Controller

Bank

To/From CPU

Module

Memory Bus

Page 21: Embedded Database Management Systems

Available Operating Modes

Active (2.063 nJ)

Power Dwn(0.025 nJ)

Nap(0.035 nJ)

Standby(0.743 nJ)

Read / Write

9000 cycles1 cycle

16 cycles

Page 22: Embedded Database Management Systems

Energy Management IdeaGoal: To reduce the energy consumption of a query by

utilizing banks idleness during the query’s execution A query accesses only a small set of tables a.k.a, banksUnused memory banks can be placed into a low-power

operating mode Question is “how” and “when”?

Two approachesCorrect (automated) use of low-power modes at hardware

levelChanging a query to use minimal energy – software level

Page 23: Embedded Database Management Systems

Hardware Scheme – Static StandbyAlready exists in most memory systems

(RDRAM)It’s a per-access optimizationAfter a read/write access, the memory module that

gets accessed can be placed into the standby mode in the following cycle.

Open/close (page) policies - Static standby modeScheme may lead to frequent resynchronizationsThe rest of the schemes that we propose aim to

minimize the expensive resynchronization costs (also, static)

Page 24: Embedded Database Management Systems

Hardware Scheme – Dynamic Threshold

Full Power

Standby NapPower

Down

10

100 1000

1

16

9000

Page 25: Embedded Database Management Systems

Query plans give a detailed break up of “primitive” operations that are contained in a queryA typical query will have:

Scan (SELECT)Check for a condition (>, <, ==)Refine results (GROUP BY, JOIN)Could also be recursive (scan of scan)

SQL Example: Who’s birthday is it today?

SELECT nameFROM addressbookWHERE DOB = “today”

and CITY = “my city”

Page 26: Embedded Database Management Systems

Energy Evaluation

Software scheme is the bestBank idleness are well estimated using

access patterns

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

P1 P2 P3

No

rma

lize

d E

ne

rgy

Static Standby Dynamic Threshold On/Off Instr

Page 27: Embedded Database Management Systems

ConclusionThere is a gap between memory growth and

DB designVerified this by simple hardware and software

schemes to reduce energy consumptionHardware vs. Software schemes

Hardware is good when access patterns are totally random

Software is good when access patterns show enough inter-table access times (which is related to energy savings) – up to 68% reduction in energy

Combination of both would be ideal

Page 28: Embedded Database Management Systems

Improvement: Object Analysis Patterns for Embedded SystemsCurrently, most embedded systems uses ad

hoc development approaches that emphasize design coding over analysis. Analyze phase is often neglect in current

development practice. This causes errors during design and coding.

Propose; Object Analysis Patterns for use in the analysis phase in the development to guide construction.Meets System RequirementsLower Elapsed TimeLower Shipping Cost

Page 29: Embedded Database Management Systems

Broy Logical Interface Architecture for Embedded Systems

Page 30: Embedded Database Management Systems

Abstracted Software Development Process

Page 31: Embedded Database Management Systems

Example; User Interface

Page 32: Embedded Database Management Systems

Bibliography[Konrad04] Sascha Konrad, Betty H.C.Cheng, “Object Analysis

Patterns for Embedded Systmes," IEEE Transactions on Software Engineering (IEEE ‘04), pages 970-992.

[Pisharath04] Jayapraskash Pisharath, Alok Choudhary, Mahmut Kandemir, “Reducing Engergy Consumption of Queries in Memory-Resident Database Systems," International Conference on Compilers, Architectures and Synthesis of Embedded Systems (CASES ‘04), Washington, DC, September 24, 2004, pages 35-45.

[Cmkovic05] Ivica Cmkovix, “Component- Based Software Engineering for Embedded Systems," Internation Conference on Software Engineeing (ICSE ‘05), St.Louus, MS, May 15-21, 2005, pages 712-715

[Kraft07] Tobias Kraft, “A Cost Estimation Component for Statement Sequences,” Very Large Databases Conference,(VLDB), Vienna, Austria, September 23-28, 2007, pages 1382-1385

[Navas01] Julio Navas, Michael Wynblatt, “The Network is the Database,” Association of Computer Machinery (ACM), Santa Barbara, CA May 21-24, 2001, pages 544-551