Connect to a Database
To start simple, create a PostgreSQL database and several tables there. You can also use you existing database:
To access that database, create an instance of Cluster:
Terminology:
Cluster consists of Islands. Each Island is identified by an integer number (there can be many islands for horizontal scaling of the cluster).
Island consists of master + replica nodes (in the above example, we only define one master node and no replicas).
Island also hosts Microshards (in the example above, we will have no microshards, aka just one global shard). Microshards may travel from island to island during shards rebalancing process; the engine tracks this automatically ("shards discovery").
Notice that we define the layout of the cluster using a callback. Ent Framework will call it from time to time to refresh the view of the cluster, so in this callback, you can read the data from some centralized configuration database (new nodes may be added, or empty nodes may be removed with no downtime). This is called "dynamic real-time reconfiguration".
As of prewarm()
call, it's explained in Advanced section.
Last updated
Was this helpful?