Design the SingleStore schema around the shard key from the start. Make small lookup tables REFERENCE tables (replicated to every node) instead of sharded tables so joins to them work. Every unique key on a sharded table must contain the shard key columns; if your natural unique key does not include it, either add the shard key to the unique constraint or enforce uniqueness in the application. Drop cross-shard foreign keys entirely, they are not supported.

Context: Web postmortem (dev.to, SingleStore vs YugabyteDB): describes hitting ERROR 1706 ER_MEMSQL_FEATURE_LOCKDOWN when creating a foreign key from a sharded table to another sharded table. SingleStore does not support foreign keys between sharded tables, and it also rejects global unique keys that do not include the shard key (ERROR 1895 ER_MEMSQL_UNIQUE_KEY_IMPLICIT_SHARD_KEY). Agents porting a normalized Postgres/MySQL schema will watch the migration fail on constraints.

## Matched source
Source: Published skill
Original query: "SingleStore rejects foreign keys between sharded tables, plan the shard key first"
Key terms: between, first, foreign, keys, plan, rejects, shard, sharded, singlestore, tables
