Multi-pool

A Relational Multi-Schema
Data Model and Query Language
for Full Support
of Schema Versioning
Fabio Grandi
Alma Mater Studiorum – Università di Bologna
SEBD 2002
1
Introduction

Schema Evolution


Automatic recovery of extant data
after schema changes
Schema Versioning
Maintenance of past schemas
(e.g. for legacy application support)
 Two design options for the
implementation of data repositories

SEBD 2002
2
Design Options for Extant Data

Single-pool solution
Roddick, Roddick & Snodgrass [TSQL2 ’95]


All schema versions associated with
a unique shared data repository
Multi-pool solution
De Castro, Grandi & Scalas [TDB ’95, IS ’97]

Each schema version associated with
a different private data repository
SEBD 2002
3
Single-pool - Example
create schema SV1
create table R(A int, B int)
A
B
123
create schema SV2
alter table R add column C int
A
B
C
125
SV1: R(A,B)
SV1: R(A,B)
SV2: R(A,B,C)
SEBD 2002
4
Single-pool - Example (2)
create schema SV3
alter table R drop column B
A
B
C
125
SV1: R(A,B)
SV2: R(A,B,C)
SV3: R(A,C)
create schema SV4
alter table R alter column A char
A’
125
B
C
A’’
xy
SV1: R(A,B) <= R(A’,B)
SV2: R(A,B,C) <= R(A’,B,C)
SV3: R(A,C) <= R(A’,C)
SV4: R(A,C) <= R(A’’,C)
SEBD 2002
5
Multi-pool - Example
A
DP1:
B
A
DP2:
123
SV1: R(A,B)
DP3:
A
C
125
55
B
C
125
33
SV2: R(A,B,C)
DP4:
SV3: R(A,C)
A
C
xy
44
SV4: R(A,C)
SEBD 2002
6
Single-pool vs Multi-pool

Single-pool:
Simple to implement with the
completed schema solution
 Reduces to a quite “trivial” view mechanism


Multi-pool:
More flexible and complex
 Thus, potentially more useful, but…

 Is
it feasible ?
 And what’s for ?
SEBD 2002
7
Multi-pool – what’s for?

From a conceptual perspective
different schema versions
correspond to different points of view
SV1
SV4
SV2
SV3
SEBD 2002
Application
Domain
8
Schema Versions as Viewpoints
US Market

EU Market
IT Market
Different viewpoints on the same data involve


different structures at intensional level (schema)
different values at extensional level (data)
SEBD 2002
9
A Concrete Example

The “Lark 2.5” car model in the global market
( diff. viewpoints involve diff. marketing strategies )
US Market
EU Market
IT Market
Lark 2.5
26 K$
Lark 2.5
32 K€
Euro4
Lark GT
31 K€
Euro3
SEBD 2002
10
A Multi-schema Query Language


Full potentialities of a multi-pool
schema versioning approach
can be exploited only by means of
a query language which allows
users/developers to express
Multi-schema Queries
that is involving data belonging to
different data pools
MSQL - Multi-schema SQL extension
SEBD 2002
11
The MSQL Query Language




MSQL basic construct:
contextualization of names and
data references to schema versions
[SV: X] denotes the conceptual entity
named “X” in schema version “SV”
SV: X denotes the extension wrt schema
version “SV” of the conceptual entity “X”
the two mechanisms can be combined
(e.g. as in SVi: [SVj: X] )
SEBD 2002
12
The MSQL Query Language (2)

Examples:

select * from [SVj: R]
retrieve the table called R in SVj
select * from SVi: R
retrieve the contents wrt SVi of R
select * from SVi: [SVj: R]
retrieve the contents wrt SVi
of the table called R in SVj


SEBD 2002
13
The MSQL Query Language (3)

Examples:

select [SVj: A] from R
retrieve the column called A in SVj of R
select SVi: A from R
retrieve the contents wrt SVi of R.A
select SVi: [SVj: A] from R
retrieve the contents wrt SVi
of the column called A in SVj of R


SEBD 2002
14
The MSQL Query Language (4)

Example:

select SVi: [SVj: A] from SVk: [SVl: R]
retrieve the values wrt SVi
of the column called A in SVj
in the tuples belonging wrt SVk
to the table called R in SVl
SEBD 2002
15
The MSQL Query Language (5)

Example:
set schema USMKT;
select NAME
from EUMKT:CAR as EC, ITMKT:CAR as IC
where IC.PRICE < EC.PRICE
retrieve the American names
of all the cars also sold in Europe
such that the Italian price
is lower than the price applied
in the rest of Europe
SEBD 2002
16
The Logical Storage Model



Provides a simple implementation scheme
for a Multi-pool schema versioning database
(on top of a traditional relational DBMS)
Is used to formally define the semantics
of the MSQL language
Representation of the SVi data pool:
RNamei(RID,Name)
ANamei(AID,Name)
RSchemai(RID,AID)
RExti(RID,TID)
AExti(TID,AID,Value)
SEBD 2002
17
Conclusions




Defense of the Multi-pool approach
(from a conceptual design standpoint)
Introduction of the
Multi-schema Query Language (MSQL)
Introduction of the
Logical Storage Model
Future Work
 development of implementation strategies
 study of formal properties
(e.g. correctness of a schema evolution process
under the multi-pool approach)
SEBD 2002
18