Skip to content

Microservices init flow #29

@mathieusouflis

Description

@mathieusouflis

Problem statement

A microservices project in dot consists of a gateway and one or more services, each auto-linked to the gateway. We need to decide how a developer initializes this structure before building the microservices generator.

Proposed solution

Option A — Incremental (recommended)
dot init with type: microservices generates the gateway only. dot add service <name> adds each service and links it to the gateway.

Pros: Maps to how real microservices projects grow — you don't know all services upfront. Each dot add service run is atomic and reversible. Easier to implement first.
Cons: Requires dot add service to patch the gateway config without breaking it. Depends on v0.3 conflict detection infrastructure being available.

Option B — Upfront declaration
dot init asks for gateway type and all service names/languages upfront. Generates everything in one shot.

Pros: Simpler to implement. No patching needed.
Cons: Forces the developer to know all services at project creation time. Inflexible. Doesn't scale to real workflows.

Alternatives considered

A hybrid: dot init generates the gateway and one initial service. Additional services via dot add service. Similar to Option A but with an initial service included.

Area

Core

Additional context

Blocks the microservices gateway generator and dot add service command.
See docs/developer-guide/roadmap/open-decisions.md #5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpreviewquestionFurther information is requested

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions