Documentation — Concepts
A table can be stored in one, two or three copies, called replicates. You decide before the deployment:
alter table orders set replicates 2;
The default is one copy. You cannot change it once the table is deployed.
A row is written to every copy of its partition. If a write fails on one copy while it works on another, the failed segment is marked out of date and the row is kept on the others. The statement succeeds; the answer reports the problem.
A select reads a partition from a sane segment only, because an out-of-date segment may miss rows. If the data broker that serves a copy fails, SynSQL tries the next copy of the partition. With one copy, a data broker that stops makes its partitions unavailable, and statements on the table are refused with One partition of this table is unavailable.
When a table has two or three copies, SynSQL puts each copy in a different rack of the datacenter (see Datacenters and racks). The rack with the most data brokers receives the first copy.
repair table T;. Lock the table first. SynSQL exports the data from a sane segment of the same partition and imports it into the out-of-date one.alter table T set segments up; declares its segments sane again.One copy is the cheapest and fastest. Choose two or three if the table must stay available when a data broker or a rack fails. Note that every copy costs the same disk space.