Creating simple data grids

With a simple data grid, you can perform create, retrieve, update and delete operations. In particular, you can use the simple data grid to allow faster access to data that is stored in a database.

Before you begin

You can use simple data grids with WebSphere® Application Server or with a stand-alone Java™ application. The WebSphere eXtreme Scale Client must be installed in either scenario.

About this task

You can use simple data grids to speed up dynamic Web applications by alleviating database load. You can store key-value pairs of arbitrary data in-memory, reducing expensive database queries. The keys can be of any existing Java type, such as java.lang.String or Integer. The values can be any serializable object type. Every time data is needed, the simple data grid on the appliance is checked first. If the appliance does not have the data, the data is retrieved from the database and inserted into the simple data grid. You can create a simple data grid by writing an application that uses the ObjectMap API.

Procedure

  1. Create the simple data grid. In the user interface, click Data Grid > Simple Data Grid. Click the add icon (add icon ) and specify a name for the simple data grid that you want to create. The following characters cannot be used in the name of the data grid: ^ . \\ / , # $ @ : ; \ * ? < > | = + & % [ ] " ".
  2. Download the objectgrid.xml file for your simple data grid. In the configuration for the simple data grid that you created, click the download icon (download icon) and save the file to your local file system.
  3. Create a Java application using the ObjectMap API that accesses the data grid.

What to do next

  • Configure security before you begin to send data to the data grid. See Securing data grids for more information.
  • Configure replicas. Replicas ensure that your data grid data is available if the primary copy fails. To configure replicas, click Data Grid > Simple Data Grid > Show advanced attributes. Replicas are created only when the appliance is in a collective. If the number of appliances in the collective is n, the maximum number of replicas is n-1. Therefore if you configure three replicas, but you only have two appliances in the collective, only one replica is created. Additional replicas are created if you add appliances to the collective. Set the number of replicas to the ideal amount that you want to have, so that as appliances join the collective, new replicas can be created. The data grid content is cleared when you edit the number of replicas.
  • Configure a capacity limit for the data grid. By configuring capacity limits on the data grid, you can ensure that the storage capacity for the collective is used in a predictable manner. See Configuring the maximum capacity of a data grid for more information.
  • Configure a time to live evictor for a simple grid. See Configuring a time to live (TTL) evictor for more information.
  • You can monitor your data grid in the DataPower® XC10 Appliance user interface. See Monitoring data grids in the user interface for more information.
  • Configuring a time to live (TTL) evictor
    When you create a simple grid, a default (static) map and a set of dynamic maps are created. By default, there is no time to live evictor configured for a default map. If you have a dynamic map then you can set a TTL value for creation time (.*CT), last update time (*.LUT), or last access time (*.LAT). You can change this default behavior so that a TTL evictor is also enabled for a default map.
Parent topic: Administering data grids
Related concepts:
Appliance topology: collectives, zones, and data grids
Developing data grid applications with Java APIs
Related tasks:
Creating a collective
Administering data grids
Creating dynamic cache data grids
Creating session persistence to a data grid
Creating and modifying zones
Administering with the HTTP command interface
Developing data grid applications with the REST gateway
Related reference:
Example: Simple data grid application
Related information:
WebSphere eXtreme Scale Version 7.1 API documentation