Lazy Type Chages i Object-orieted Database Sha Mig Woo ad Barbara Liskov MIT Lab. for Computer Sciece December 1999
Backgroud wbehavior of OODB apps compose of behavior of persistet obj wbehavior of objects govered their types wtype chageseeded to update OODB apps whow to execute type chage?
Requiremets w A type chage may affect er types oth w A upgradecosists of a set ed of re type chages w Upgrades are ordered w Executio of a upgrade have to b atomic w.r.t. app trasacti os to prevet type errors
Na ve Executio w Step 1: shut dow the database w Step 2: trasform objects w Step 3: restart the database w Drawback: database availability fers su w Not suitable for large-scal e databases ad missio-critical databases w Solutio: lazy type chages
Lazy Type Chages w Objects trasformed y, lazil i.e. just before use w Database availability t affected o w Workload of a upgrade: 1. Spread effectively ver time o 2. Distributed amog fairly apps w Suitable for all databases cludigi large-scale ad missio-cri tical oes
Theory w Type chage: C T =<T, T, f T > Pre-type Post-type w Upgrade: U=<, {C}> i Trasform fuctio Serial # Set of type chages
Theory (cot.) w Trasform fuctios: Act o oe object at a time Preserve object idetiti es, i.e. object refereces survive chages type Should ot modify ay data w Upgrades have to complete, be i.e. should ot affect her ot types
Implemetatio Desig (1) w Based o Thor [ECOOP99] Distributed cliet/server OODBMS Optimistic cocurrecy cotrol Servers store objects, validate trasactios Cliets cache objects, operate o cached objects o behalf of apps Object idetity partly locatio depedet Objects i cliet cache idexed by a residet object table (ROT) Each ROT etry stores a dispatch vector poiter ad a field poiter for object Poiters i empty a etry are ull Poiters i fulletry a are up-to-date
Implemetatio Desig (2) w Sigle Server Upgrades stored at the server ad pushed to cliets Objects trasformed by cliets before used by apps Objects trasformatios are regarded as modificatios Ivariat: All full ROT etries represet up-to date objects. At receipt of ew upgrade, cliet w aborts ruig trasactio if it used affected objects to guaratee atomicity w scas ROT ad emptie s affected etries to preserve ivariat
Implemetatio Desig (3) w Sigle server cotiued Special cliet cooperate with garbage collector to trasform rarely used objects Upgrades complete i order: whe all objects affected by the oldest upgrade has bee trasformed, it is discarded Problem: objects chage sizes across trasformatios Size decreases--- overwrite origial obje Size icreases---fid space o the same serve page: w If succeed, update page offset table w Otherwise, write to aother page ad replace origia l object with surrogate Referece through surrogate is shortcut whe the referrig obje is modified
Implemetatio Desig (4) w Multiple servers A master server stores the master copy of all upgrades Upgrades pushed from master server to other servers Each server seds upgrades to its cliets ad each cliet processes upgrades as i the sigle server implemetatio Problem: eed to maitai cosistecy whe a cliet talks to multiple servers---a upgrade may arrive at oe server before aother Cliet acts as relay to restore cosistecy: ea commit request is tagge with serial umber of ewest upgrade at clie
Coclusio w Lazy type chages preserve database availability ad ca be tly efficie implemeted--- essetial for large-scale missio-critical databases Future work w Project focused rsistet o pe objects: how avoid recompilig icatios? appl Uiversal applicatio framework? w How to exted o-database to eviromet