YAPC::NA 2006 — Scott Smith

UR - Universal Relational Software Framework

Creative Commons Attribution + Share Alike 2.5
2006-06-27 8:30 AM CST
36 Minutes, 24 Seconds

Recently, OO-RDBMS development frameworks have come into popular usage. Projects such as Class::DBI, Ruby on Rails, Rose::DB, and others provide a reusable solution to a common problem and save a lot of development effort. The UR suite re-frames the standard object-relational problem. It is resolved by giving the developer a powerful general class definition system, which can leverage knowledge about an underlying database, but does not require one to exist at all, managing non-persistent objects, and giving them a similar feature set. The net result for the developer is a software architecture which cleanly separates "business logic" from data management, while actually maximizing efficiency in the later instead of sacrificing it.

Often, many of the issues addressed in database design are in fact general class design problems. These solutions are even applicable when the classes in question will not have any external persistence. The UR suite allows developers to write more powerful classes by providing/enabling simple/easy entity identity, pointerless references, named relationships, "normalization", transactions, and meta-data. Even for applications that are not concerned with complex interactions with external data storage, managing object states and relationships is still key to good software architecture. For applications which do interact with external data sources, especially large relational databases, this management is critical for scalablilty, stability, and an agile development cycle.

The UR suite provides a base class for objects and provides classes for object/class meta-data. A class definition at the top of a Perl module enables a host of features, including optional, automatic RDBMS mapping and pluggable mapping to other persistence systems. The entire state of the application is managed by centrally tracking all changes to these objects, including creation, changes, and deletion. Synchronizing the changes made in an application with the objects' persistent storage is a single operation, independent of the implementation of the methods which effected that change in the object layer. The methods implementing an object class, in turn, are written in a context-independent way, uncluttered with data management. Classes provide a query interface, which is simple and powerful and which is orthogonal to the external database access which may or may not coincide with it. Object requests return data reflecting all of the unsaved application changes, which are transparently overlayed on the state of the external database(s).

Other features include: support for multi-table inheritance, a viewer base class for GUIs with full MVC support, a base class for logical object sets, application-level "undo", database data caching, structurally defined queries, dynamic class loading, and dynamic class generation. Because UR classes have extended definitions, it is possible to componentize these and many other features in efficient ways, besides mapping to external persistent storage.

This software is the core of an internally developed suite of applications used in a production environment at the Washington University Genome Sequencing Center. It provides access to over 10TB of data, in over 400 tables, with the largest table having over a billion rows. Three multi-server instances of Oracle deliver data to several hundred users and a several hundred node compute cluster.


More YAPC::NA 2006 presentations