If you work on SI projects in Korea, there is a table pattern you see almost everywhere.
It is the Common Group Code table and the Common Detail Code table.

Usually people use these two tables together like below, and most SI projects still work this way.

TB_CMMN_GRP_CD (Common Group Code)

  • GRP_CD VARCHAR(20) (PK)
  • GRP_CD_NM VARCHAR(100)
  • USE_YN CHAR(1)
  • REG_DT DATETIME

TB_CMMN_CD (Common Detail Code) (1:N)

  • GRP_CD VARCHAR(20) (PK, FK)
  • DTL_CD VARCHAR(20) (PK)
  • DTL_CD_NM VARCHAR(100)
  • SORT_ORD INT
  • USE_YN CHAR(1)

You put things like order status or payment type into these tables, and when showing them on the screen, you join the common code table or use a subquery to get the code name.
One nice thing is that if an admin adds a new code on the admin page, it shows up in the dropdown right away without deploying code.
But while developing, it was honestly pretty inconvenient in many ways.

The biggest problem was that you cannot tell what a value means just by reading the code.

// You have to open the DB to know if "01" means pending or paid
if ("01".equals(order.getStatusCd())) {
    // ...
}

Because strings like "01" and "02" end up directly in business logic, I always had to check the DB or look up the spec document.
Also, it happened quite often that someone added a code to the dev DB and forgot to run the insert script on production DB, causing an incident.

Discovering Enum in Product Companies and Side Projects

Later, when I looked at code from product companies and side projects, I noticed they do not put status values in DB common code tables. Instead, they manage them in code using Enum.

public enum OrderStatus {
    PENDING("Pending"),
    PAID("Paid"),
    CANCELLED("Cancelled");

    private final String description;

    OrderStatus(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }
}

Trying this out, I felt it was much better because it is not tied to the DB.
First, IDE autocomplete prevents typos, and seeing OrderStatus.PAID instead of "01" makes the code way easier to read.
Also, you can put status check methods right inside the Enum, which keeps the logic much cleaner.

Finding the IDL Approach

I wondered if Enum is always the final answer, so I did some more research with AI.
It turned out that when a system grows and splits into multiple services, Enum alone is not enough.

When you only have one Java server, Java Enum works fine.
But if you also have Python or Go servers, or need to share the same constants and data formats with the frontend, you end up writing the same Enum over and over in each language.
If one side adds a new status and another service misses it, bugs happen right away.

To solve this, I found a more advanced way that does not depend on a specific backend language: using schema files like .idl or .proto.

syntax = "proto3";

package order.v1;

enum OrderStatus {
  ORDER_STATUS_UNSPECIFIED = 0;
  ORDER_STATUS_PENDING = 1;
  ORDER_STATUS_PAID = 2;
  ORDER_STATUS_CANCELLED = 3;
}

Teams using this approach keep a separate Git repo just for IDL files, apart from service code.
They define data structures and shared constants in language-neutral files, and each project uses them.

When I tested it, sharing common definitions across services felt really clean.
Especially in an MSA environment where multiple servers talk to each other, IDL seems like a great fit for keeping data formats and status codes in sync.

How Teams Actually Run IDL in Production

At first I thought, “Do developers have to pull the IDL files and run compile commands on their local machine every time?”
When I looked into how real teams use it, the workflow was much more automated.
In practice, generated code from IDL is published to an internal package registry so developers can use it just like a normal library.

The flow looks roughly like this:

  1. Someone updates a schema and opens a PR in the IDL Git repo.
  2. The CI pipeline runs tools like buf.build to lint the schema and automatically check if any change breaks backward compatibility (like deleting a field or changing its type).
  3. Once merged to main, CI automatically builds code for each language (Java, Go, TypeScript, etc.) and publishes a new version to an internal package registry like Nexus or GitHub Packages.
  4. Service developers do not need to compile IDL manually. They just bump the library version in build.gradle or package.json and import it.

With this pipeline, developers can safely use shared types and codes just like importing any regular library.

Beyond APIs: Events and Frontend Parallel Work

Digging a bit more, I found out IDL is not only used for server-to-server API calls.

When using message brokers like Kafka or RabbitMQ, teams also define event payloads in IDL.
If you pass raw JSON strings, and the producer renames a field, the consumer won’t notice until it fails at runtime. Defining it in IDL catches those issues at compile time.

Two other use cases stood out to me:

  • You can automatically generate API docs like Swagger (OpenAPI) directly from the IDL definitions.
  • Even before the backend API is implemented, frontend and backend can agree on the IDL spec first and spin up a Mock server from it. That way the frontend team does not have to wait for backend work to finish and can build in parallel.

Wrap up

Starting from DB common code tables that I took for granted in SI, I followed the path through Java Enum all the way to IDL in MSA environments.
The newest way is not always the right answer for every project, but it was interesting to see how things move from “put it in the DB and join it” toward “enforce contracts with code, types, and automation” as systems and teams grow.