Every physical-goods business reaches the same fork: someone starts a spreadsheet, the spreadsheet grows a second tab, and within a year there are four versions of the truth and nobody trusts any of them. The instinct is to reach for a database. Usually the better first move is a schema — a written agreement about what a record contains — even if the storage is still a CSV.
I went through this with a gemstone inventory where the same piece was described four different ways depending on who wrote the row. The fix was not tooling. It was deciding, in advance, which fields are mandatory and what each one is allowed to contain.
Start from the questions, not the fields
A schema is a promise about the questions the data can answer later. List the questions first:
- Which pieces came from the same lot?
- What was the treatment status at the time of purchase, and who assessed it?
- Which items have a lab report, and does the stated weight still match?
- What changed between two records of the same piece?
Anything that does not serve one of those questions is decoration and will be abandoned within a month.
The record
{ "id": "JJ-2026-0417", "lot": "HPK-2026-03", "description": { "material": "jadeite", "colour": {"hue": "green", "tone": "medium", "saturation": "high"}, "translucency": "high", "treatment": "A" }, "measures": {"mass_ct": 12.4, "length_mm": 18.2, "width_mm": 13.0}, "report": {"lab": "local", "number": null, "date": null}, "status": "in_stock", "updated": "2026-11-24" } Three decisions here are worth defending.
Identifiers are not row numbers. A row number changes when the file is sorted; an id that encodes year and sequence does not. If two systems ever need to reconcile, the id is what they match on.
Descriptive fields are closed vocabularies, not free text. treatment has exactly three values, and the value describes an assessment, not a fact about the universe. Recording who made the assessment belongs in a separate audit table; putting it in the same string is how you end up with A (probably).
Missing is a value. null in report.number means no report exists. An empty string means somebody did not fill it in. Those are different states and the distinction survives only if you enforce it.
Validate on write, not on read
A schema nothing checks is a suggestion. A few lines in the ingestion path will hold the line:
ALLOWED_TREATMENT = {"A", "B", "C"} def validate(rec): errors = [] if not rec.get("id", "").startswith("JJ-"): errors.append("id must use the JJ- prefix") if rec["description"]["treatment"] not in ALLOWED_TREATMENT: errors.append("treatment outside A/B/C") if rec["measures"]["mass_ct"] <= 0: errors.append("mass must be positive") return errors Rejecting a bad row at write time is cheap. Finding out two years later that 400 rows have a treatment value of A? is not.
Version the record, not the file
One row per piece, plus an append-only change log keyed by id and timestamp. That gives you the answer to "what changed" without a full audit system, and it survives the inevitable moment when somebody edits a cell by hand.
What this buys you
After the schema settled, the inventory stopped being a document and started being a queryable set: pieces by lot, pieces with no report, pieces whose measured mass no longer matches the certificate. None of that needed a server. It needed three afternoons of agreement and thirty lines of validation.
The longer write-up of how this maps onto an actual sourcing workflow — rough lots, cutting yields, and where the record has to be updated — lives at https://www.myanmarjadeite.com , which is also where the field definitions above came from. If you are building something similar, steal the questions, not the field names.
