Beyond Localhost: Nothing About Your Go Code Changes
Swapping the catalog
You have already made this move once: The Lab: stand up the stack part put the pointer in a metastore instead of a file. A REST catalog is the same move one tier further out, and it costs exactly as much Go code as the last one did — none. Only the flags the JVM process was started with change:
bash — same server, a production-shaped catalog
$ ./sbin/start-connect-server.sh \
--packages org.apache.iceberg:iceberg-spark-runtime-4.1_2.13:1.11.0,org.apache.iceberg:iceberg-aws-bundle:1.11.0 \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.hms=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.hms.catalog-impl=org.apache.iceberg.rest.RESTCatalog \
--conf spark.sql.catalog.hms.uri=https://your-rest-catalog.example.com \
--conf spark.sql.catalog.hms.warehouse=s3://your-bucket/warehouse \
--conf spark.sql.catalog.hms.io-impl=org.apache.iceberg.aws.s3.S3FileIOThe catalog is still called hms there, and it is deliberately a lie now — there's no metastore behind it. It's left that way to make the point unmissable: every hms.db.orders reference in every Go snippet in this lab is still correct, because hms was only ever a name your Spark session chose to define, never something Go hardcoded an assumption about. Rename it to prod and you change one string, in the flags and in your SQL, and nothing else.
The data moved too, and that's the bigger shift: warehouse=s3://… plus S3FileIO means the find and cat commands this lab leaned on stop working, and everything you learned from them is still exactly true — the tree is the same, it's just in a bucket. Point a Trino cluster at the same REST catalog and SELECT * FROM iceberg.db.orders reads rows your Go code wrote, using none of Spark's code at all — the concrete version of the engine-interop story from the Catalogs and engine interop part, which your metastore setup was already doing on a smaller scale.
A REST catalog is also a server. So what actually changed?
Worth stopping on, because the obvious objection is correct: a REST catalog is a process you run, backed by a database, sitting on a network hop in the middle of every commit. That is a precise description of HMS too. The What the Hive Metastore actually is section's "isn't this just an extra hop?" complaint is not answered by swapping to REST — the tier does not go away. What changes is the shape of the API, and following from that, where the commit logic lives.
The shallow difference first, since it is the one you can see: HTTP/JSON against a published OpenAPI document (open-api/rest-catalog-open-api.yaml in the Iceberg repo) rather than Thrift stubs compiled into both binaries. Unknown fields are tolerated by construction, an unsupported route is a 404 a client can branch on, and there is a GET /v1/config handshake in which the server states its capabilities and pushes config defaults before the client does anything. That handshake is the thing HMS structurally cannot have — the Thrift, and why it is not a fourth component section showed that a Thrift dispatch is a name lookup with no room to ask "what version are you?", which is the entire get_table trap. Real, but on its own this would only amount to "same design, better wire."
The difference that matters is that the REST API is shaped like Iceberg, and HMS's is shaped like Hive. HMS's data model is Hive's from 2008: Table objects carrying SerDe info, input formats, column lists, partition descriptors. Iceberg uses none of it. It smuggles its entire state through a single generic key-value slot — metadata_location — and expresses a commit as swap this string if it still equals that string, with a lock row in Postgres to make the comparison safe. It is a clever abuse of a slot that was there for something else.
The REST protocol's commit is POST /v1/namespaces/{ns}/tables/{table}, and the body says something categorically different:
UpdateTableRequest — a commit, as the REST spec expresses it
{
"requirements": [
{ "type": "assert-table-uuid", "uuid": "9f2c…" },
{ "type": "assert-ref-snapshot-id", "ref": "main",
"snapshot-id": 759497885138563489 }
],
"updates": [
{ "action": "add-snapshot", "snapshot": { … } },
{ "action": "set-snapshot-ref", "ref": "main",
"snapshot-id": 1938319986946564586 }
]
}Note what is absent: a filename. The client is not saying "I wrote 00004-def.metadata.json, go point at it." It is saying "here are my preconditions, here is what I want changed." The compare-and-swap has become a first-class, declarative part of the protocol instead of a string equality check the client hand-rolled against a property slot. That inversion is the whole thing — because once the request carries intent rather than a path, the server is free to validate the requirements, apply the updates, materialise the new metadata.json itself, and hand the resulting metadata back inline. Against HMS, the Iceberg jar running inside Spark does every bit of that and the metastore is a witness that swaps a string.
| HMS + Postgres | REST catalog | |
|---|---|---|
| Who computes the commit | The Iceberg jar inside each engine | The server can |
| Commit expressed as | A new file path, swapped conditionally | Requirements + updates, declarative |
| Storage credentials | Every engine needs its own full-power keys | Vended per table, short-lived, scoped |
| Non-JVM clients | Thrift stubs + a full Iceberg implementation | An HTTP client and JSON |
| Engine version skew | Every engine's Iceberg version must agree | One implementation, server-side |
| Multi-table transactions | No | POST /v1/transactions/commit |
| Backend | One fixed schema in a relational DB | Pluggable — Postgres, DynamoDB, Nessie's branching |