O'Reilly logo

Java EE 8 High Performance by Romain Manni-Bucau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fallback handling – caching, an alternative solution

In the previous subsection, we saw how to handle a fallback using another strategy, which can be a hardcoded default value, or can be an alternative way to compute the service, including how to contact another service from another provider potentially. This is the straightforward implementation of a failover.

However, if you step back and think about why you set up some failover mechanisms, you'll realize that it was to ensure your service can run even if an external system is down. Therefore, there is another solution, which is not a failover, strictly speaking, but fulfills the same goal, that is, caching. We saw in a previous section how JCache can help your application go faster, enabling ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required