The server around the schema
Every DBA has met the server that’s almost like the others. Same version, same build script, and a max degree of parallelism somebody changed during an incident two years ago. A database still in FULL recovery on a box with no log backups. Nothing breaks, so nobody notices, until the one query that only misbehaves on that server.
Your packages already make the schema the same on every server in the fleet. From 2026.12.0 they can do it for the configuration around the schema too. (Until that release is out, the lab runs on a CLI built from main.) And not every package has to be a product. A DBA package carries what a class of server should look like, whatever products run on it.
Report before you fix
Section titled “Report before you fix”ServerSettings.json sits beside Product.json. DatabaseSettings.json sits in a template folder and covers every database that template reaches. Each setting names its catalog (Kind), its name and value, and two things SchemaSmith never assumes for you:
{ "Kind": "Configuration", "Name": "cost threshold for parallelism", "Value": "50", "Fix": false, "OnDrift": "Warn" }Fix says whether a difference gets changed or only reported. OnDrift grades whatever’s still wrong after the deploy: Warn, Error, or Ignore. Start with Fix: false everywhere and deploy. Nothing changes, and every difference gets a line:
WARNING: Server setting Configuration 'cost threshold for parallelism' is 5, declared 50 (not fixed)That’s the safe first move on a fleet you inherited: find out how far it’s drifted before you touch any of it. The deployment summary counts it per scope in settingOutcomes, so a pipeline can tell “the fleet’s in line” from “three servers need attention” without reading a log. A setting you didn’t list is never read and never changed.
Three answers to “this server is different”
Section titled “Three answers to “this server is different””Flip Fix to true and the line becomes the change: 'cost threshold for parallelism': 5 -> 50. Deploy again and it’s silent, because it matches. Then the two cases that make this more than a settings script:
A setting that waits for a restart is set, and the log says it isn’t in effect yet: 'user connections' set to 500; takes effect after a restart (running value 0). PostgreSQL reports it from pending_restart, and MySQL persists it with SET PERSIST_ONLY. MariaDB can’t persist a read-only variable at all, so it tells you to put it in the option file. And MariaDB’s ordinary fixes come with the value reverts at the next restart, because SET GLOBAL is all it has. The next deploy after a restart fixes it again.
A server you won’t deploy to is Fix: false with OnDrift: Error. When it has drifted, the deploy stops before it changes any setting:
ERROR: FAILED: Server settings stopped the deploy on localhost,11437: Server setting Configuration 'optimize for ad hoc workloads' is 0, declared 1 (not fixed)No half-configured server. You find out at deploy time, from the deploy, and the server’s exactly as it was.
One package, several classes
Section titled “One package, several classes”An OLTP box and a warehouse want different parallelism. Declare the setting twice, each variant gated on the class:
{ "Kind": "Configuration", "Name": "max degree of parallelism", "Value": "8", "Fix": true, "OnDrift": "Warn", "ShouldApplyExpression": "SELECT CASE WHEN @@SERVERNAME LIKE 'OLTP%' THEN 1 ELSE 0 END", "VariantName": "OLTP class" }In production the gate usually reads the server’s name. The lab has one server per engine, so it gates on a ServerClass script token, declared in Product.json with OLTP as the default and overridden by the warehouse pipeline (an override can only change a token the package declares, never add one), and deploys twice: 0 -> 8 as OLTP, 8 -> 0 as the warehouse. A server no variant matches leaves the setting alone. A server two variants match stops the step and names both, so an overlapping gate is caught the first time it matters, not resolved quietly one way or the other.
Capture the server you trust
Section titled “Capture the server you trust”You won’t write these files from a blank page. Point SchemaTongs at the reference server with ShouldCast:ServerSettings and ShouldCast:DatabaseSettings, and it writes both. They hold only what differs from the engine’s defaults, and nothing that names the machine itself: no paths, ports or locale. SettingsDefaultPolicy: Report makes every captured setting report-only to start. Commit it, review it like any other change, and the next capture shows you, as a diff, every setting that moved.
On SQL Server, ShouldCast:ServerObjects goes further: Agent jobs, operators, alerts, server triggers, audits and Extended Events sessions, scripted into product folders that run on every server. The lab captures a job, “fixes” it by hand on a server, and deploys: the job’s back as captured, updated in place, history intact. Then it changes the job the way you will. The captured script lists the job’s steps and schedules as values at the top, so you edit a step’s command in the package and deploy. Same job, same history, new command, on every server the product reaches. The deploy after that leaves it alone. Audits and Extended Events sessions are the exception: their scripts carry a fingerprint of the object as captured, so change those on the reference server and capture again. Credentials, proxies and linked servers are never scripted.
Check yourself: You inherit forty SQL Servers. You want MAXDOP enforced on the OLTP ones, a deploy to refuse any server still running optimize for ad hoc workloads off, and a report of cost threshold everywhere without changing it. What does each setting declare?
MAXDOP: two gated variants, each Fix: true. The OLTP variant’s gate matches the OLTP servers, and the other classes get their own variant or none (a server no variant matches is left alone). optimize for ad hoc workloads: Fix: false, OnDrift: Error, so a drifted server stops the deploy before any setting changes. cost threshold for parallelism: Fix: false, OnDrift: Warn, so every deploy reports it and changes nothing. Start by capturing a reference server with SettingsDefaultPolicy: Report, then promote the settings you mean to enforce one at a time.
A smith’s shop isn’t just the work on the anvil. It’s the forge’s heat, the quench tank, the tools on the rack, and the next piece only comes out right if those are where they should be. The schema was always the work. The server’s settings are the shop. Declare the shop too, check it before every job, and refuse to strike when it isn’t right.
Got a fleet where every server’s a little bit different and nobody knows why? Email me at forgebarrett@schemasmith.com. I read every one.
Until then, may every server in your fleet run hot at the same temperature.
— Forge