Book Image

Infinispan Data Grid Platform

By : Francesco Marchioni, Manik Surtani
Book Image

Infinispan Data Grid Platform

By: Francesco Marchioni, Manik Surtani

Overview of this book

<p>In today's competitive business world, Enterprise systems must be able to deliver highly available, high transaction volumes with an increasing number of users. Infinispan enables you to do this as well as share and distribute data among servers in the most efficient way possible so that you achieve faster response times, while trying to avoid single points of failure.<br /><br />Infinispan Data Grid Platform will teach you the most important concepts for building Enterprise applications. Using Infinispan will give you a decisive competitive advantage over the standard clustered applications that are typical in the enterprise today. This, the only book to cover Infinispan, offers detailed instructions for installing, configuring, and effectively using the Infinispan platform. You will learn how to utilize and make the most out of every feature of its API.<br /><br />Progress from examples of adding, removing, and evicting data from a cache, to more complex scenarios such as clustering and distributing data more efficiently in the grid. Throughout the book, you will follow a simple example of an API using a ticket booking system, which will help you to learn how to set up robust and scalable Infinispan configurations. You will also see a complete demonstration of integrating the Infinispan data grid platform with JBoss AS 7.</p>
Table of Contents (13 chapters)
Infinispan Data Grid Platform
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Learning the Infinispan API


Having introduced some basic concepts of the Infinispan platform, we will now learn how to use the core API to store, retrieve, and remove data in it.

The core interface of Infinispan is org.infinispan.Cache, which extends the java.util.concurrent.ConcurrentMap, providing a highly concurrent and optionally distributed data structure. Compared with the ConcurrentMap interface, the Infinispan Cache has a lot of additional features, such as:

  • Eviction and expiration support to prevent OutOfMemoryErrors

  • JTA transaction compatibility

  • Event notification via the Listeners

  • Persistence of entries to a cache store, to maintain copies that would withstand server failure or restarts

For the purpose of exploring the APIs, we will now construct a simple example that creates a cache to store in-memory data for a ticket booking system.

Creating your first project

In order to run your first example, you can launch your favorite IDE and create a new Java project:

  1. 1. Set up your project...