What's the difference between TAF and FCF?
16 May 2008 by Simon Haslam (in HA)
One question I get asked quite a lot by customers is "what's the difference between Transparent Application Failover (TAF) and Fast Connection Failover (FCF) and should I be using one or the other or both"? Well, yesterday I gave a presentation at the UKOUG RAC & HA Special Interest Group on "Fast Connection Failover in Practice" and, whilst I only mentioned TAF in passing, I thought I'd expand a little on some of my comments.
So firstly let's start with the basics:
What is TAF? TAF is a database session-level connection failover mechanism: it
works via the OCI interface only so applies to applications using thick JDBC drivers and those using the OCI libraries (e.g. written in C, like OID). During failover a new session will be started on an alternative node (though it can be pre-connected ahead of the failure) and this can optionally re-open a cursor and advance it to the point it was at prior to failure (providing underlying data hasn't changed).
When can I use TAF or FCF? Stating the obvious, but only when you have a database that can failover: this typically is RAC, but it could also be a Data Guard Primary-Standby site or even a single instance cold failover cluster. For both mechanisms you need to connect using database services (rather than traditional SIDs) since it's important that the service is not tied to an instance. TAF has been around since 8.1.5 whereas FCF is newer (10.1 onwards).
Now to less obvious questions:
Will I have to change my application? To get the highest levels of reliability, yes, you will need to add additional error handling to re-apply your database work. This is true for both TAF (assuming you're not just doing read-only transactions) and FCF. If you have short lived transactions and don't want (or can't) change your application, then FCF can quickly clean up stale connections in the pool and your application will only suffer failures where it has a connection checked out from the pool (e.g. is in the middle of database activity).
I have a java application that uses JDBC and a RAC database - should I use FCF? Well, the answer is probably yes, providing you're on a recent Oracle JDBC driver (e.g. 10.2.0.4.0). There's no performance penalty to using it - you just need to set it up. Even if your application doesn't take account of failures flagged by the FCF mechanism at least you will always ensure that the connection pool has live connections.
Actually I was chatting to Joel Goodman over lunch yesterday and he made a very good point: you can think of TAF as geared towards client-server connections whereas FCF is aimed at Java multi-tier architectures. Therefore TAF would be very suitable for batch jobs, long running sessions and the like, whereas FCF suits pooled connections where database transactions are very short lived (like your typical web app).
Hopefully this gives a useful outline. For more information about TAF and FCF in the java environment the best place to start is the Oracle® Database JDBC Developer's Guide and Reference, Chapters 26 (TAF) and 27 (FCF).
