DALi - A database abstraction layer

  • 783 views
Uploaded on

 …


DALi
A database abstraction layer for multi-user web applications

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
783
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. DALi A database abstraction layer for multi-user web applications Johan Brichau, Andy KellensMonday 22 August 11
  • 2. Goals of DALi ‣ Independence of specific database platform - Magma, GOODS - Gemstone (GLASS) - Image persistency ‣ Focus on “Develop in Pharo, deploy in Gemstone” - ... but don’t limit your options ‣ Tx API for handling concurrency conflicts - “Application-level” semantic concurrency conflicts - Parallel web request execution conflicts DALi - database abstraction layer 2Monday 22 August 11
  • 3. Use cases: shared data editing DALi - database abstraction layer 3Monday 22 August 11
  • 4. Transaction conflicts ‣ GOODS / Magma / ... - Keep a separate database view per web session - Concurrent web editing conflicts are database Tx conflicts WASession DB WASession WASession VM DALi - database abstraction layer 4Monday 22 August 11
  • 5. Transaction conflicts ‣ GOODS / Magma / ... - Keep a separate database view per web session - Concurrent web editing conflicts are database Tx conflicts WASession DB WASession WASession VM WASession WASession WASession VM DALi - database abstraction layer 4Monday 22 August 11
  • 6. Transaction conflicts ‣ GEMSTONE (GLASS) - Keep a database view per VM (aka gem) - Concurrent web editing conflicts are not database Tx conflicts WASession DB WASession WASession VM WASession WASession WASession VM DALi - database abstraction layer 5Monday 22 August 11
  • 7. DALi’s API: Transactions DS G OO “Native” db Magma AbstractDAO session Gems tone pe Ima rsi ge ste nc YourAppDAO y Text Text Tx code dao startTransaction: [ ... ] forObject: ... Tx commit succeeded onSuccess: [ ... ] onFailure: [ ... ] Tx aborted DALi - database abstraction layer 6Monday 22 August 11
  • 8. DALi’s API: change tracking State change DALObject tracker Is used internally to detect YourAppDomainObject semantic application-level tx conflicts setValue: aNumber Record the changed attribute myValue := aNumber. in the state change tracker self markAsChanged: #myValue DALi - database abstraction layer 7Monday 22 August 11
  • 9. Why change tracking? ‣ Essential in GLASS - Only means to detect conflicts between different Seaside sessions - Integrates with GLASS’ 1 commit per web request DALi’s Tx blocks prevent conflicts driven by the state tracker Gemstone Tx block prevent actual db conflicts Both do an abort and retry the request DALi’s retried request will execute the onFailure blocks ‣ Finer-grained tx conflicts in GOODS - Attribute-level instead of object-level conflicts DALi - database abstraction layer 8Monday 22 August 11
  • 10. Some more details ‣ Identification & change tracking - Unique ids for each DALObject - Versionstamps for each DALObject ‣ DALi-GOODS - Nesting of transactions - Manual write barrier - Tracked collections - Proper unique ids ‣ DALi-GEMSTONE - Nesting of transactions - Integrated with Seaside GLASS - Use of oops for unique ids DALi - database abstraction layer 9Monday 22 August 11
  • 11. Future ‣ Support for communicating state changes between sessions - We have change tracking already for conflict detection - We could send out notifications on db updates on commit/abort ‣ Update backends - Magma backend has not been maintained - Need to try an RDB backend DALi - database abstraction layer 10Monday 22 August 11
  • 12. Get it... Want to give it a try? http://www.squeaksource.com/DALi http://ss3.gemstone.com/DALi License: MIT DALi - database abstraction layer 11Monday 22 August 11