Answer
For most teams, the XSD validation that comes with XML changelogs does reduce runtime failures compared to YAML, but the advantage shrinks once the changelog exceeds a few hundred changesets or becomes heavily custom‑tagged. XML’s strictness catches structural mistakes early, while YAML’s concise syntax keeps the history readable but relies on runtime parsing for errors.
Why XML’s Validation Helps
- Liquibase ships an XSD that enforces required attributes (e.g.,
name on <column>) and correct nesting before any SQL is generated.
- Many CI runs report fewer "invalid changeset" errors when XML is used, especially for complex refactorings.
- Validation is performed by
liquibase validate without touching the database, providing a quick pre‑flight check.
Why YAML Can Be More Readable
- YAML removes repetitive tags and attributes, making change history easier to skim.
- Peer reviews often finish faster because the syntax is less verbose.
- YAML errors surface only when the parser reads the file, usually just before execution.
When Verbosity Outweighs Validation
In projects with under 50 changesets or simple create/drop statements, XML’s boilerplate adds little overhead and the validation benefit is clear. Once you reach hundreds of changesets, many <include> files, or heavy use of custom change tags, the XML’s verbosity can slow merge reviews and increase conflict frequency. At that scale, YAML’s readability often outweighs the marginal gain from XSD checks.
Practical Steps to Evaluate Your Own Project
XML Validation
- Run
liquibase validate in your CI pipeline.
- Introduce a deliberate error (e.g., remove the
name attribute on a <column>) and confirm that validation fails before a database connection is attempted.
YAML Validation
- Run
liquibase validate on the YAML file.
- Introduce the same structural error (e.g., mis‑indent a key) and observe that the failure appears during parsing, often with a generic message.
Measure Impact
Track failed builds over a month, controlling for changeset count, to see if XML consistently reduces pre‑deployment errors.
Recommendation
If your team is comfortable with XML and your changelog remains relatively small or you need the strongest early‑error detection, stick with XML. For larger, evolving schemas where merge conflicts and manual review speed matter more, YAML is acceptable—especially if you add a YAML linter or JSON schema validation to your CI pipeline.
Missing Diagnostic Detail
Could you share whether your changelogs include many custom change tags or rely heavily on <include> files? That detail would help fine‑tune the recommendation.