Download presentation
Presentation is loading. Please wait.
Published byKristina Blankenship Modified over 9 years ago
1
OpenACS: Porting Oracle Applications to PostgreSQL Ben Adida ben@openforce.net
2
Using an Enterprise-Ready Open-Source RDBMS Ben Adida ben@openforce.net
3
Context Building a multi-user, networked application Open-Source hackers have ignored the RDBMS for too long! The Next Open-Source Challenge Can PostgreSQL replace Oracle?
4
Outline Open-Source and RDBMSs Oracle & PostgreSQL comparison –SQL support –Maintenance –Advanced Features Building a DB-independent App OpenACS
5
Data in Networked Apps Multiple users accessing data –Read & Write –Contention! Multiple means of access –Web server –Command line –Automated batch scripts
6
Data Abstraction Assurances made to application Understanding Failure: –Sometimes, you must fail –If you fail, admit it and fail gracefully Understanding Relevancy: –Sometimes certain data is irrelevant
7
ACID Abstraction for reliable data storage: Atomicity Consistency Isolation Durability
8
Atomicity All or nothing Much more than locking!
9
Consistency Invariants - Consistent States Complex Data Invariants –Audit Tables –Aggregate Checks Logic in the DB Logic triggered within transactional control
10
Isolation Partial work invisible to others Levels of Isolation –Dirty Reads –Read Committed –Read Repeatable –Serializable
11
Durability Once committed, a transaction is permanent -- no more rollbacks! Point-In-Time Recovery Impact on Backups
12
ACID in the DB locking, rollback in the application layer? Abstraction! Guarantees must be made no matter how data is accessed Isolation mandates implementation at low-level
13
ACID is not Enough! Naïve Implementation –single-threaded –global lock –full write to disk before commit. Get Fired Optimistic behavior
14
Does this Work? begin transaction; v_balance:= select balance from accounts where account_id=1; update accounts set balance= v_balance+20 where account_id=1; commit transaction;
15
This Does! begin transaction; v_balance:= select balance from accounts where account_id=1 for update; update accounts set balance= v_balance+20 where account_id=1; commit transaction;
16
Oracle - an Overview ACID-compliant Highly optimized for OLTP Highly configurable Very complex administration OPS: the Promised Land
17
PostgreSQL - an Overview ACId-compliant Highly optimized for OLTP Not so configurable Very simple administration Replication in the works
18
SQL support SQL92 - the “standard” No specifications for stored procedures or triggers! Ambiguities Oracle’isms –Connect By –Dates –SQL92 alternatives
19
SQL support Aggregates Joins, outer joins Subselects Views On-the-fly views
20
Stored Procedures Oracle PL/SQL, Java Triggers (statement and rowlevel) PostgreSQL PL/pgSQL, PL/Perl, PL/Tcl, PL/C Triggers (rowlevel only)
21
Transaction Engine Oracle Overwrite Rollback Segment Transaction Log (Redo Log) Row-Level Locking Optimistic PostgreSQL No-overwrite Versioning Transaction Log (as of v7.1) Row-Level Locking Optimistic
22
Backup & Recovery Oracle Logical Dump (not consistent!) Incremental dumps using physical backup Point-in-time recovery PostgreSQL Logical Dump (consistent) No incremental dumps No point-in-time recovery yet
23
Oracle Architecture Tablespace Rollback Segments
24
PostgreSQL Architecture …… Field: price Val: 120 Version # 1659 Field: price Val: 110 Version # 1660 Field: name Val: “Tim” Version # 1660 Field: price Val: 120 Version # 1661
25
Parallelism Oracle OPS Very few users However, a huge advantage in large installations PostgreSQL Asynchronous replication Synchronous in the works No complete solution yet
26
SQL Applications Interface via ODBC/JDBC, DBI, etc.. SQL statements –Many static, w/ bind variables Select * from users where user_id = :user_id –Some dynamic Select * from users where $date_predicate
27
Summary PostgreSQL can do 90% of what Oracle can do You probably need 70% of what Oracle can do PostgreSQL is ready for many enterprise systems.
28
OpenACS - History 1995 - AOLserver/Tcl/Illustra 1997 - AOLserver/Tcl/Oracle 1999 - AOLserver/Tcl/PostgreSQL 2001 - v4.x, multi-DB capable, modular
29
OpenACS 4.x Architecture PostgreSQL data model and stored procedures Queries stored in XML Templates AOLserver/Tcl logic
30
OpenACS Stack O/S RDBMS App Server Presentation OpenACS Custom Code All Free Software
31
OpenACS 4.x Features A common user table - collaboration Registration/Login/Permissions Discussion Forums Ecommerce Calendaring Education! (MIT Sloan)
32
OpenACS 4.x Demo
33
References http://postgresql.org http://openacs.org http://openacs.org/doc/openacs/? ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.