Backend Development 16 min read

Evolution, Architecture, and Features of Ctrip's Model Object Management (MOM) Contract System

The article outlines how Ctrip's ticket business evolved its contract management from offline XSD files to a cloud‑native, model‑driven system called MOM, describing its motivations, architecture, core modules, and practical features such as version control, model sharing, code generation, and change notifications.

Ctrip Technology
Ctrip Technology
Ctrip Technology
Evolution, Architecture, and Features of Ctrip's Model Object Management (MOM) Contract System

With micro‑service adoption at Ctrip, the number of APIs and their callers grew rapidly, making frequent contract changes inevitable; this prompted the ticket BU to seek a systematic way to manage evolving interface contracts.

Initially, contracts were maintained offline by developers using XSD files, which worked in monolithic settings but suffered from loss, poor visibility, conflict resolution difficulties, and inconsistent readability as services proliferated.

Third‑party tools like Swagger, Knife4j, and YAPI moved contract management online but remained API‑centric, lacked centralization, and could not fully address Ctrip's needs, leading to the decision to build an internal solution.

The internally developed MOM (Model Object Management) was designed to provide cloud‑based project and permission management, an intuitive UI with online editing, versioning with diff and merge, change notifications, import/export capabilities, and model sharing across projects.

MOM’s physical architecture uses dual clusters for disaster recovery, MySQL for structured metadata, MongoDB for raw and generated contract files, a Local Cache + Redis two‑level cache, Zookeeper for consistency, and follows an MVC pattern with an Angular front‑end and Java back‑end.

Logical modules include project management (application vs. custom projects with role‑based permissions), model management (core unit allowing nested models, custom types, and enums, supporting sharing across projects and external JARs), multi‑version management (isolated environments, rollback, diff, and automatic conflict merging inspired by Git), contract generation (supporting Java, TypeScript, GraphQL, C#, XSD, Protobuf, and direct publishing to Maven/NPM), and change notification (via internal Trippal, email, and extensible channels).

In summary, MOM differentiates itself from Swagger/Knife4j/YAPI by focusing on contract rather than API management, offering a model‑centric, extensible platform that addresses rapid business changes, contract reuse, and collaborative development within Ctrip’s micro‑service ecosystem.

BackendJavaMicroservicesContract ManagementAPI governancemodel-driven
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.