What Is Tungsten SQL Router?
Tungsten SQL Router is a JDBC wrapper designed to solve an important problem in database clusters--making a group of database replicas spread across a set of hosts appear to the application as a single database. The SQL router handles the following capabilities:
- Failover - Switch to a new database when an existing database is no longer available or needs to go down for maintenance.
- Load balancing - Spread connections across one of several identical copies
- Partitioning - Select the correct database server from several alternatives
Applications using SQL Router connect to a service which is a collection of data sources, or individual databases. Databases may be masters or slaves--the SQL Router is well-adapted to support both master/slave as well as master/master clustering models. Data sources may be up or down; slaves may also have differing latency.
The routing approach uses a notion of "quality of service," which allows allows users to trade off availability versus consistency when making database connections. This capability is based on the CAP theorem, an important theoretical result that shows that it is impossible to keep database copies spread over multiple hosts simultaneously consistent, available, and tolerant of partitions. The SQL Router offers three main quality of service levels:
- RW_STRICT -- Users see all changes immediately (fully consistent) but may lose availability if the master goes down.
- RW_SESSION -- Users see their own changes immediately but may not see changes by other users until later on. Users can benefit from replicas when it is save to do so and only lose availability on writes if the master fails.
- RO_RELAXED -- Users are content to use an older read-only copy of data. Availability is highest for this setting but the users should not write data.
The SQL Router also includes a number of practical features such as allowing applications to specify maximum allowed latency on reads plus management through a simple command line tool as well as JMX APIs. In addition, the SQL Router has extension points to allow uses to load different plug-ins for data source status notifications, load balancing algorithms, and notifiers to clients.
|