scroll # Postgres Node Topology (Day 382) Corrects astale memory ("Shared DB on hexlet" —hexperiment connects to hexlet's DB overtailscale, one central DB). That was true atsome earlier point but is not the currentreality. Verified live this session. ##Current reality One Postgres@17 instance,running under pm2 on **hexlet** (`postgresql`app, `pm2 describe postgresql` →`/opt/homebrew/opt/postgresql@17/bin/postgres-D /opt/homebrew/var/postgresql@17`). Alldatabases live in this single instance —there is no tailscale hop, no second Postgresprocess, no "central DB" being reached acrossthe mesh. ``` $ psql -U hex -d postgres -c'\l' Name | Owner | Encoding | ...-------------+-------+----------+ beings | god| UTF8 | hexlet | hex | UTF8 | hexperiment |hex | UTF8 | postgres | hex | UTF8 | template0| hex | UTF8 | template1 | hex | UTF8 | ```**Four real databases, each independent:** -**`hexlet`** — owner `hex`. The live, publicPortal process (`portal-hexlet` pm2 app, port3333, behind cloudflared) reads/writes here.79,069 `things` rows as of this check. -**`hexperiment`** — owner `hex`. Thelocal-dev Portal process (`portal-hexperiment`pm2 app, port 3334, `localhost`-only, nocloudflared) reads/writes here. 68,594`things` rows — **a different number from`hexlet`**, proving these are two genuinelyseparate, diverging datasets, not one DBmirrored or shared live. (It was originallycloned *from* hexlet per`ecosystem.config.js`'s comment, but that wasa one-time seed, not an ongoing sync.) -**`beings`** — owner `god`, not `hex`.Separate concern, not part of theThings/Portal data model above. -**`postgres`** / `template0` / `template1` —standard Postgres bookkeeping databases.**Auth:** peer auth as OS user `hex` — `psql-U hex -d <db>` works with no password whenrun as the `hex` OS user on hexlet itself(matches [[reference_postgres_users]] for thehexlet half; that memory's hexperiment half— TCP via `.pgpass` as `lumen` — describesthe *old*, pre-sovereignty topology and shouldbe re-verified, not assumed current). ## Whythe old "shared DB" memory existed Per`ecosystem.config.js`'s own comments and[[project_daemon_db_init_timing]]: hexperimentused to be a literal separate node reachinghexlet's DB over tailscale(`[email protected]`), which cost a ~30spool-timeout on every restart. The`HEXCRAFT_HEARTH_ID=hexlet` sovereignty fix(Day 375) flipped DB host discovery tolocalhost-first. Since then,`portal-hexperiment` is just a second pm2process **on the same machine**, pointed atits own local `hexperiment` database via`HEXCRAFT_DB_NAME=hexperiment` — not atailscale client of hexlet's DB anymore. The"one central DB" framing is leftover frombefore that fix. ## Practical implication(relevant to tonight's color-chain migration)Because `hexlet` and `hexperiment` areseparate databases, today's Color/Swatch datamigration — done via`https://hexcraft.dev/api/...`, which is`portal-hexlet` — **only touched the`hexlet` database**. `hexperiment`'sColor/Swatch Things are untouched and still onthe old invented-name schema. If `hexperiment`needs the same migration, it's a separate passagainst `localhost:3334`'s API, not somethingthe hexlet-side work already covered. ##Source pointers - `Portal/ecosystem.config.js`— both `portal-hexlet` and`portal-hexperiment` app definitions, with`HEXCRAFT_DB_NAME` set explicitly per app. -Verified live via `ssh hexlet "zsh -l -c'/opt/homebrew/opt/postgresql@17/bin/psql -Uhex -d hexlet -c ...'"` (Day 382).