Add a reader to a database
Add readers to a database or a cache: read-only copies that follow the writer.
All pages
- Open the database or the cache, press ⌘K and choose Settings › Readers, then pick Writer + 1 reader or more.
Your plan sets how many readers you can run. The change waits as a staged change.
With the CLI:
Terminalghaym cloud services scale db --readers 1 - Press ⌘K, choose Review changes, then press ⌘↵ to apply it.
The reader copies the writer's data and joins without a deploy.
With the CLI:
Terminalghaym cloud changes apply --project shop
Your services reach the readers through a variable that references DATABASE_READER_URL, or REDIS_READER_URL for a cache, while DATABASE_URL or REDIS_URL stays on the writer. If the writer's machine goes down, the writer starts again on another machine from a copy of its disk, and no reader takes its place. DATABASE_URL or REDIS_URL stays the same.
Press ⌘K, choose Settings › Readers › Writer only, and apply the change.
Terminal
ghaym cloud services scale db --readers 0 --apply