Advanced Rails - Building Industrial-Strength Web Apps in Record Time

(Tuis.) #1

124 | Chapter 4: Database


PGCluster’s replication style is synchronous; updates are propagated to all servers
before the update transaction succeeds. Thus, it should only be used in environ-
ments where all master servers are at the same location and are always connected.
Asynchronous replication, in which changes are propagated to other servers some
time after the transaction commits, is generally considered a hard problem. Asyn-
chronous replication is also application-specific, as the proper way to handle con-
flicts between two committed transactions depends on the application’s needs.


Oracle


Oracle’s clustering product is Oracle Real Application Clusters (RAC). In contrast to
the shared-nothing clustering solutions available for other DBMSs, RAC is ashared-
everythingclustering product. In RAC, multiple Oracle instances access a shared
database cluster. The shared-everything architecture depends on a common data
store such as a storage area network (SAN).


Oracle supports many flexible replication options, from simple data-only one-way
replication to distributed multimaster replication. These solutions are very powerful
but also very complicated.


Microsoft SQL Server


Like Oracle, SQL Server has extensive features supporting both replication and clus-
tering. SQL Server even supports “merge replication,” which is essentially asynchro-
nous multimaster replication. Of course, both the clustering and replication options
require large amounts of configuration.


There is no out-of-the-box load-balancing solution for SQL Server yet; once you have
a replicated database, you still must write application code so as to direct requests to
the appropriate server.


LDA P


LDAP, the Lightweight Directory Access Protocol, is a database system optimized for
user directory information. It is most often used in large organizations, integrated
with the enterprise authentication and email systems. However, it is a database in its
own right. We do not have space to cover LDA Pin detail, but there are many
resources available for working with LDAP in Rails.


ActiveLDAP


The ActiveLDA Plibrary (http://ruby-activeldap.rubyforge.org/) is an almost drop-in
replacement for ActiveRecord that uses LDA Pinstead of an RDBMS as a backend.
To use it from Rails, set up a configuration file,config/ldap.yml, as follows:

Free download pdf