Creating Replicated Tables

You can create replicated tables explicitly or by default, using CREATE TABLE statement.

GemFire XD creates a replicated table by default when you execute a CREATE TABLE statement and you do not include a PARTITIONING clause. You can also explicitly create a replicated table using the REPLICATE clause in the CREATE TABLE statement. For example:

CREATE TABLE COUNTRIES
   (
      COUNTRY VARCHAR(26) NOT NULL CONSTRAINT COUNTRIES_UNQ_NM Unique,
      COUNTRY_ISO_CODE CHAR(2) NOT NULL CONSTRAINT COUNTRIES_PK PRIMARY KEY,
      REGION VARCHAR(26),
      CONSTRAINT COUNTRIES_UC
        CHECK (country_ISO_code = upper(country_ISO_code) )
   ) REPLICATE;

Because this command omits the SERVER GROUPS clause, the example creates the 'countries' table and replicates the table's data on all members of the default server group for the schema (all peers and servers in the default server group that set the host-data property to true).