Persisting Table Data to a Disk Store

You configure the persistence settings for a partitioned or replicated table when you create the table with the CREATE TABLE DDL statement. GemFire XD automatically recovers data from disk for persistent tables when you restart GemFire XD members.

Procedure
  1. Ensure that the data dictionary is persisted in your GemFire XD cluster. GemFire XD persists the data dictionary by default for all data stores, but you can explicitly enable or disable data dictionary persistence using the persist-dd boot property.
    Note: All GemFire XD data stores in the same cluster must use a consistent persist-dd value. Accessors cannot persist data, and you cannot set persist-dd to true for an accessor.
  2. Create the disk store that you want to use for persisting the table's data, or use the default disk store. See Creating a Disk Store or Using the Default.
  3. Specify table persistence and the named disk store in the CREATE TABLE statement. For example:
    CREATE TABLE Orders(OrderId INT NOT NULL,ItemId INT ) 
         persistent 'OrdersDiskStore' asynchronous

    This example uses asynchronous writes to persist table data to the "OrdersDiskStore."

    Note: Persistent tables must be associated with a disk store. If you do not specify a named disk store in the CREATE TABLE statement, GemFire XD persists the table to the default disk store. For example, the following statement persists the new table to the default disk store:
    CREATE TABLE Orders(OrderId INT NOT NULL,ItemId INT ) 
         persistent asynchronous
    Note: When you specify asynchronous persistence, asynchronous writes to the disk store use certain disk store attributes. See Disk Store Persistence Attributes.
Related Topics
CREATE DISKSTORE
CREATE TABLE
Evicting Table Data from Memory