Compiling Mappings to Bridge Applications and Databases
90 likes | 229 Vues
Compiling Mappings to Bridge Applications and Databases. Melnik, Adya and Bernstein @Microsoft Research. Introduction. Application Model VS Database Model Reasons Approaches Client side mapping layer Providing updatable views on DB ADO.NET Entity Framework Declarative mappings
Compiling Mappings to Bridge Applications and Databases
E N D
Presentation Transcript
Compiling Mappings to Bridge Applications and Databases Melnik, Adya and Bernstein @Microsoft Research
Introduction • Application Model VS Database Model • Reasons • Approaches • Client side mapping layer • Providing updatable views on DB • ADO.NET Entity Framework • Declarative mappings • Bidirectional views • Query view : app = view(DB) • Update view: DB = view(app)
Mapping Approach • Mapping Specification • Entity SQL + XML • Mapping fragment: • Mapping Compilation • Bidirectional views • Query views + Update Views • Properties • Entities = QueryViews(Tables) • Tables = UpdateViews(Entities) • Entities = QueryViews(UpdateViews(Entities)) - Roundtripping criterion • Execution • ▲Tables = ▲ UpdateViews(Entities, ▲ Entities) • ▲ Tables = ▲ UpdateViews(QueryViews(Tables), ▲ Entities) • Merge Views : SupdX Sold→ Snew
Mapping Compiling Problems • Data roundtrips • map o map-1 = Id(C) • u subset map subset q-1 • Merge Views • SupdX Sold→ Snew • Biparite Mappings • map = f o g-1 • f : C → V • g : S → V
View Generation • Overview • Query view • q = f’ o g, where f’ : V → C • Update View • Schema partition • Merging view • An example
View Generation • Partitioning Schema • Mapping language dependent • Goals: Allowing expressing each fragment query in map as a union query over the partitions
View Generation • Reconstructing partitions • Injectivity holds only if the partitions can be reconstructed from the views
Conclusion • A new mechanism supporting updatable views • Formulating mapping compilation problems and algs. • Implemented in Commercial Product