Modular monolith

모듈형 모놀리스

One deployment preserves explicit business boundaries in code.

···
html
<div class="scene"><div class="title">MODULE BOUNDARY</div><div class="row"><div class="tile">ORDERS</div><div class="track"><div id="packet">CALL →</div><div id="routeLabel">public port</div></div><div class="boundary"><div class="tile on">PORT</div><div class="tile">PAYMENT CORE</div></div></div><div id="verdict" class="muted">public call accepted</div></div>
css
.scene{width:min(94vw,760px);height:min(86vh,320px);padding:clamp(10px,2.5vmin,18px);border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--fg);font:500 clamp(11px,1.3vw,16px)/1.25 "Pretendard Variable",Pretendard,-apple-system,sans-serif;display:flex;flex-direction:column;gap:clamp(7px,1.6vmin,12px);overflow:hidden}.scene *{box-sizing:border-box}.title{font-weight:750;color:var(--accent)}.muted{color:var(--muted)}.mono{font-family:ui-monospace,monospace}.row{display:flex;align-items:center;justify-content:center;gap:clamp(5px,1.4vmin,12px);flex:1;min-height:0}.tile{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(6px,1.6vmin,12px);text-align:center;min-width:0}.on{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 12%,var(--surface))!important}.pulse{animation:pulse 1.6s infinite alternate}@keyframes pulse{to{border-color:var(--accent);transform:translateY(-3px)}}.row>.tile:first-child{flex:0 0 20%;padding:6px 1px}.track{flex:1;text-align:center;min-width:54px}.track #packet{color:var(--accent);transition:transform .5s}.boundary{border:2px dashed var(--accent);border-radius:10px;padding:4px;display:flex;gap:4px;align-items:center;flex:0 0 52%;min-width:0}.boundary .tile{padding:.4em .2em;flex:1}
js
let bad=false;function tick(){bad=!bad;document.getElementById('routeLabel').textContent=bad?'direct internal call':'public port';document.getElementById('packet').style.transform=bad?'translateY(13px)':'translateY(-5px)';document.getElementById('verdict').textContent=bad?'BLOCKED: bypassed port':'PASS: public call accepted';document.getElementById('verdict').style.color=bad?'var(--accent-3)':'var(--accent)'}tick();setInterval(tick,1300)

A modular monolith separates public interfaces from implementation for capabilities such as orders and payments within one process. Other modules call only the public interface.

The demo rejects a shortcut into internals while a call through the public port succeeds. Table ownership also needs rules or the code boundary erodes.

When to use

Use it when independent releases are unnecessary but coupling between features needs control.

Open as page ↗