Tag: Microservices

  • ArchiMate  Is  Not  a  Diagram Contest

    ArchiMate Is Not a Diagram Contest

    Model migration so every squad sees the same map — a live gaming platform example

    ArchiMate gets dismissed the same way TOGAF sometimes does: too theoretical, too many boxes, nobody reads it.

    That is fair — when ArchiMate is used as wallpaper.

    It becomes valuable when you are in the middle of a migration and six squads are drawing six different pictures of the monolith we are leaving and “the platform we are building.” Lobby thinks matchmaking is already separate. Transactions thinks money moved last quarter. Platform thinks RabbitMQ is “temporary.” Product thinks the cutover is next sprint.

    At that moment, ArchiMate is not ceremony. It is a shared language for baseline, target, gaps, and plateaus – the same story ADM Phase F asks for, but visible to engineers, product, and the architecture board.

    This article shows how to model a real migration on a live gaming platform: monolith → modular services (lobby, game, transactions) with a message broker on the money path and strangler increments — not every ArchiMate element, only the ones that stop migration arguments.

    Why migration is the right ArchiMate proving ground

    Migrations fail in predictable ways:

    Invisible dependencies — “we extracted transactions” but the monolith still writes wallet state

    Fake target states — microservices on a slide, monolith in production

    Big-bang fantasy — no plateaus, no coexistence rules

    Squad-local truth — each team’s diagram stops at its repo boundary

    ArchiMate does not fix those by itself. It fixes them when you model what exists, what must exist, what changes between plateaus, and who delivers each slice.

    If ArchiMate only works on greenfield data-center refresh decks, it is not Enterprise Architecture. Strangler migration on a live game platform is the stress test.

    ArchiMate in one sentence (before we draw anything)

    ArchiMate is a standard notation for describing enterprise architecture across business, application, and technology — and for showing how you move from today to tomorrow without pretending tomorrow arrives in one weekend.

    You do not need every viewpoint. You need the right viewpoint for the decision in the room.

    ViewpointUse it when…
    LayeredExplaining structure — what serves what
    Implementation & MigrationPlanning strangler moves, plateaus, work packages
    MotivationLinking business drivers to migration scope (optional but powerful in Phase A)

    ADM tells you to plan migration (Phase F). ArchiMate shows what you are migrating in which order.

    The example: baseline monolith on a gaming platform

    Baseline (Plateau 0): one application component does too much.

    ArchiMate elementExample on the platform
    Business capabilityLive gameplay, Player monetization
    Business processJoin table → play hand → settle wallet
    Application componentMonolith Game Server
    Application serviceSocket session, Table state, Wallet mutation (all in one deployable)
    Data objectPlayer profile, Table state, Wallet ledger
    Technology nodeSingle JVM / process fleet behind a load balancer
    Artifactgame-server.jar (one binary, many responsibilities)

    The pain in EA language: gameplay hot path and money path share process, deployment, and failure domain. A spike in lobby traffic or a stuck wallet call can drag down live tables.

    This is not a drawing exercise. It is the baseline plateau every squad must agree on before “we already migrated” conversations start.

    Target: separate capabilities into application components with clear serving relationships — clients and other apps call services, not “the server.”

    Application componentOwnsApplication services (examples)
    Lobby ServiceMatchmaking, presenceFind table, Seat player
    Game ServiceLive session, table statePlay event, Broadcast state
    Transaction ServiceWallets, buy-in, payoutAuthorize buy-in, Settle hand
    Message Broker (infra)Async handoffPayment command queue

    Client pattern (from the real journey):

    REST (or HTTP API) to Lobby — door: find and join a table

    WebSocket to Game — room live play

    Broker between Game and Transactions — money off the gameplay hot path

    ArchiMate relationships to model explicitly:

    RelationshipMeaning in the migration
    ServingLobby Service serves Find table to the mobile client
    FlowGame events move between client and Game Service
    TriggeringBuy-in requested triggers a payment command
    AccessGame Service accesses table state; Transaction Service accesses ledger
    RealizationGame Service realizes Live gameplay capability

    The part people skip: plateaus and gaps

    Migration is not binary. ArchiMate’s Implementation & Migration viewpoint exists because Plateau 1 is where production actually lives.

    Plateau 0 — Monolith (baseline)

    Everything in one component. Money and play in one failure domain.

    Plateau 1 — Strangler: transactions extracted, monolith still plays

    Work package: Extract transaction module; route wallet commands via broker.

    What changesArchiMate modeling note
    New Transaction Service component appearsTarget element in Plateau 1
    Monolith loses wallet mutationGap: retire in-process wallet behavior
    RabbitMQ (or similar) as Technology serviceNew Flow between Game and Transactions
    Coexistence ruleMonolith still owns lobby + game; transactions own ledger writes

    Gap (Plateau 0 → 1):

    Duplicate wallet path — monolith code path must be decommissioned, not left “just in case”

    Data ownership — one writer to ledger (record in model + ADR)

    Operational owner ship — who runs the broker, queues, and DLQ

    This is the increment ADM + Agile articles describe transactions module first, live tables keep running.

    Plateau 2 — Lobby and game separated

    Work package: Split lobby matchmaking from game session; REST door + WebSocket room.

    GapWhy it matters
    Session handoffLobby assigns table; Game owns socket room
    Identity / session tokenModel Flow of “seat confirmed → connect to game shard”
    Scale independenceLobby scales on browse traffic; game scales on seated players

    Plateau 3 — Shard game fleet, containerize (optional further plateau)

    Aligns with the 200K concurrent journey: stateless game engines, externalized state, autoscale – another plateau, not a surprise Phase F slide.

    EA rule:Model every plateau you will actually run in production — not only baseline and dream target.

    What to put on the diagram (and what to leave off)

    Model these for migration

    Application components you will deploy separately

    Application services other teams call

    Flows that cross team boundaries (especially money)

    Plateaus with dates or release trains

    Gaps with named work packages and owners

    Principles as constraints (one writer per ledger, money off hot path)

    Do not model these (yet)

    Every class or microservice repo

    Every MQ topic name

    Full cloud networking on day one

    A perfect enterprise map that updates never

    ArchiMate should be just detailed enough that a squad can answer: Does my sprint fit the current plateau?

    Migration roadmap (Archi view 4)

    The implementation & Migration viewpoint is where ArchiMate earns its keep: Plateaus, Gaps, and Work Packages on one diagram — not a second poster that ignores today.

    ElementIn this model
    Plateau 0Monolith baseline
    Gap P0→P1Extract transactions; one ledger writer
    Work Package 1Broker + Transaction Service; retire in-process wallet
    Plateau 1Monolith (lobby+game) + Transaction Service
    Gap P1→P2REST lobby + WebSocket game handoff
    Work Package 2Split Lobby and Game services
    Plateau 2Lobby + Game + Transactions (target modular)

    In Archi (or BiZZdesign, Sparx), attach deliverables, stakeholders, and ADR links to each work package. The notation is standard the discipline is yours.

    ArchiMate × ADM × Agile (one line each)

    MethodRole in migration
    ADM Phase FNames migration planning as a first-class outcome
    ArchiMateMakes baseline / target / plateaus / gaps visible and debatable
    AgileDelivers one work package per increment with a demonstrable plateau

    Without ArchiMate (or an equivalent shared model), Agile ships features; with it, Agile ships plateau transitions the board can recognize.
    Anti-patterns ArchiMate should kill in migration reviews

    Target-state-only diagram — pretty future, lying about today

    Component per developer — boxes follow org chart, not behavior

    Missing broker — money path drawn as synchronous REST because it is easier to draw

    No gap — “we’ll switch over Friday” with no coexistence rules

    Plateau without owner — work package on a slide, nobody on-call

    ArchiMate as PDF export — model not connected to backlog or ADRs

    Rewriting the whole model every sprint — model plateaus, refine incrementally

    Migration modeling checklist (use in architecture reviews)

    1. Is baseline agreed? One monolith box is not enough — name services, data writers, and hot paths.

    2. Is target a plateau or a fantasy? Target without Plateau 1 is a poster.

    3. What is the next work package? One strangler slice — who owns it?

    4. What gap closes when it ships? Name behavior you stop doing in the old component.

    5. Where does money flow? If it is not on the diagram, it is still in the monolith.

    6. What is coexistence? Two paths may run briefly — model duration and decommission rule.

    7. Which capabilities are realized where? Gameplay vs monetization separation is strategic — show it.

    8. Does the squad’s sprint map to a plateau element? If not, why are we building it?

    If you can not answer these from the model, you are not ready to migrate. You are ready to argue in stand-up.

    Wrapping up

    ArchiMate is not a diagram contest. It is how Enterprise Architecture makes migration legible: baseline monolith, target modular platform, plateaus in between, gaps that close with real work packages.

    On a live gaming platform, that looked like:

    Plateau 0 — socket monolith: play, lobby, money in one place

    Plateau 1 — transactions strangler via broker; one writer to the ledger

    Plateau 2 — REST lobby + WebSocket game; money still off the hot path

    Later plateaus — shard, containerize, autoscale — same model, new gaps

    Use ArchiMate to stop six squads from drawing six truths. Use ADM to justify why migration is phased. Use Agile to land each plateau while players are still at the table.

    That is EA doing its job: map over slogans, plateaus over big-bang, shared model over private diagrams.

  • REST, gRPC, GraphQL, WebSocket — When to Choose Which

    REST, gRPC, GraphQL, WebSocket — When to Choose Which

    What we keep missing in the Architecture Review Board — and the drawbacks of each pattern


    When a new requirement lands, we open the Architecture Review Board (ARB).

    The room fills quickly. Mid-level engineers come prepared — and passionate. Someone says: “We’ll do gRPC.” Someone else: “GraphQL is better for the UI.” Another: “Just expose a REST API — everyone knows it.”Occasionally WebSockets enter the chat because “we need real-time.”

    I understand the concern. Everyone is trying to move fast and pick a modern, credible tool.

    But sometimes we miss the fundamentals between all of them.

    gRPC, GraphQL, REST, and WebSocket are not competing logos. They are different communication patterns. They answer different questions about how long the conversation lasts, who is calling, how much of the data the client needs, and what fails when the network gets ugly.

    In this article I explain when to choose which communication pattern, and — just as important — what the drawbacks of each are. The examples come from high-scale gaming and payments platforms we built: matchmaking, live tables, real-time query APIs, and service-to-service paths behind the client.

    Same ARB energy. Clearer criteria.

    What the ARB should ask before naming a protocol

    Before anyone says “gRPC” or “GraphQL,” force these questions:

    1. Is this a short request/response, or a living session?

    2. Is the caller a browser/app, a partner, or an internal service we control?

    3. Does the client need a fixed contract, a flexible read shape, or a stream of events?

    4. Are we optimizing for universality and debuggability, binary efficiency, or push latency?

    5. Who owns versioning when the contract changes?

    If you cannot answer those, you are not choosing a pattern. You are choosing a buzzword.

    REST — when to choose it

    Choose REST when the interaction is “ask and get an answer”: short-lived, resource- or command-oriented, and best served by ordinary HTTP (methods, status codes, gateways, caches).

    Matchmaking was a scalable REST service. The client called it first. The service read live tables/seats from cache, applied rules, and returned game table info (later including a sticky cookie). Only then did the client know where to play.

    The Dynamic Real-Time Query Engine exposed REST APIs so CRM, ML, and targeting could send a behavioral query and get a decision. Request/response. Wide consumer set. Spring Boot + HTTP was the interoperable door.

    Why ARB likes REST (for good reasons)

    Every platform can call it

    API gateways already know how to auth, rate-limit, and route it

    Easy to debug (`curl`, logs, status codes)

    Natural for onboarding, config, “place me,” “get segment,” partner integrations

    Drawbacks / backdrops

    Chatty UIs — one screen may need many round trips

    Over-fetching / under-fetching — one DTO rarely fits every client

    Poor fit as the primary game loop — polling REST for table state is a smell

    Versioning sprawl — `/v1` `/v2` and bloated payloads if governance is weak.

    ARB line: If the conversation ends when the response returns, REST is the default until proven otherwise.

    WebSocket — when to choose it

    Choose WebSocket when you need a persistent, bidirectional channel: server push, client push, session as long as the user is inside an experience.

    Where it fit for us

    Gameplay was never REST polls. Early on, clients held a persistent socket for the life of the session — input in, broadcast out.

    Later we moved to WebSockets behind an API gateway (auth, security, rate limits, routing).

    Flow:

    1. REST matchmaking → table info + sticky cookie

    2. WebSocket through the gateway → live game path

    3. Stay connected for the session; server fans out state

    Historically we also separated lobby vs game connections so browsing spikes did not punish a live table.

    Why ARB likes WebSocket

    True real-time without fake polling

    Efficient for many small messages after handshake

    Matches how games, live ops, and collaborative UIs actually work

    Drawbacks / backdrops

    Operational hardness — sticky sessions, reconnect storms, heartbeats, backpressure

    Gateway and LB behavior become architecture — not an afterthought

    Horizontal scale is non-trivial — affinity, failover, “who owns this gameId?”

    Abuse risk — open sockets are a DoS surface if rate limits and auth are weak

    Wrong tool for one-shot CRUD — login and “get config” do not need a socket

    ARB line: Use REST (or similar) to enter the room. Use WebSocket to live in the room.

    gRPC — when to choose it

    Choose gRPC when callers are services inside your trust boundary, you want a strict contract (Protobuf), and you care about efficiency, deadlines, and codegen. Where it fits in stacks like ours

    Client-facing traffic stayed REST + WebSocket. gRPC earns its keep service-to-service:

    High-QPS internal lookups (profile, features, decision helpers)

    Strong typing across languages

    Unary or streaming RPCs without inventing a private framing protocol

    A fraud Decision API or internal RTQE neighbor might speak gRPC internally while broader consumers still see REST.

    Why ARB likes gRPC

    Compact binary payloads; strong performance story

    Contract-first with breaking-change discipline

    Deadlines, status codes, streaming built in

    Excellent for polyglot microservices you own

    Drawbacks / backdrops

    Browsers are awkward — need grpc-web or a proxy; not “just fetch”

    Ops complexity — HTTP/2 load balancing, observability, and client libraries must be mature

    Less human-debuggable than JSON REST in a pinch

    Overkill for simple public or partner APIs

    False comfort — a `.proto` does not replace product thinking about failure modes

    ARB line: gRPC for internal contracts. Do not force it to the client because it feels advanced.

    GraphQL — when to choose it

    Choose GraphQL when many clients need different shapes of the same domain, and REST over/under-fetching is slowing product teams — and you are willing to govern a schema.

    Where it fits

    BFF / app / admin / CRM consoles: screens that would otherwise need five REST calls or one monstrous DTO.

    Where I push back hard

    Hot game loops — use WebSocket state sync, not GraphQL as the table protocol

    Simple commands — REST is clearer

    Blind “GraphQL everywhere” — schema sprawl is an enterprise debt

    Why ARB likes GraphQL

    Clients ask for exactly the fields they need

    One endpoint can serve many UI variants

    Strong story for mobile and parallel frontends

    Drawbacks / backdrops

    N+1 and resolver cost — easy to create accidental database storms

    Caching is harder than REST resource URLs

    Authz must be field-aware — coarse gateway auth is not enough

    Schema governance — without owners, GraphQL becomes a junk drawer

    Subscriptions ≠ free real-time architecture — still need backplane thinking

    ARB line: Choose GraphQL for read-shape flexibility. Do not choose it to avoid designing APIs.

    Side-by-side: pattern vs backdrop

    PatternChoose whenMain drawbacks
    RESTShort request/response; broad clients; gatewaysChatty UIs; over/under-fetch; weak as live game pipe
    WebSocketLong-lived bidirectional session; server pushSticky/reconnect complexity; harder to scale; easy to misuse for CRUD
    gRPCInternal service RPC; strict contracts; efficiencyBrowser friction; ops maturity required; overkill for public CRUD
    GraphQLMany clients, many read shapesN+1; cache/authz hardness; schema sprawl

    How we composed them (what “good” looked like)

    ConversationPattern
    Matchmaking / “where do I sit?”REST
    Live gameplay / presenceWebSocket
    CRM / ML segment queryREST (+ JSON body)
    Service-to-service, high QPS, strictgRPC (internal)
    Diverse admin / app readsGraphQL (when UI diversity demands it)
    Durable async side effects (e.g. money path)Message broker — different layer, not a fifth “API style”

    What I say in the ARB when the suggestions fly

    When someone says “we’ll do gRPC / GraphQL / REST,” I translate:

    REST — “We need a door everyone can knock on.”

    WebSocket — “We need a room that stays open and pushes.”

    gRPC — “Two services we own need a tight, fast contract.”

    GraphQL — “Many UIs need many shapes of one graph — and we will govern the schema.”

    If the sentence is only “it’s modern,” that is not an architecture decision.

    Wrapping-Up

    In the ARB, mid-level energy is valuable. Protocol fashion is not.

    Sometimes we miss the funda: REST, gRPC, GraphQL, and WebSocket solve different communication problems, and each brings drawbacks you must budget for — chattiness, connection ops, browser proxies, schema and resolver risk.

    When a new requirement opens the board, don’t start with the acronym. Start with the conversation type. Then choose the pattern. Then name the backdrops out loud so nobody is surprised in production.

    Enter with REST when you need a door.

    Stay with WebSocket when you need a room.

    Speak gRPC when services need a tight contract.

    Offer GraphQL when many UIs need many shapes — and you will own the schema.