Skip to content

Architecture

This section documents the internal design decisions and guarantees of grelmicro.

  • Concurrency runtime: Why grelmicro targets asyncio directly and not Trio or AnyIO.
  • Backend Registry: Shared registry pattern for swappable backends.
  • Configuration: Explicit construction paths, from_config(...), optional env resolution where it fits, and the library-not-app boundary.
  • Live reconfiguration: Atomic config swap on a live component, the Reconfigurable mixin, and reader safety.
  • Import Strategy: Why backends are imported from submodules, not re-exported.
  • Plugins: Entry-point groups that let third-party packages register Providers and Adapters.
  • Multiple apps: When two Grelmicro apps can run concurrently, and why Log, Trace, and Metrics are the exception.
  • Decorators: Which decorators take the bare @deco form, which require @deco(...), and which wrap sync functions.
  • API Conventions: Constructor and factory rules: positional name on patterns, keyword-only name on components, factory classmethods for algorithms.
  • Coordination: Worker identity, token generation, lock design, and cleanup strategy.
  • Kubernetes Backend: Lease resources, optimistic concurrency, and name sanitization.
  • SQLite Backend: WAL mode.
  • Tracing: Context stack, concurrency safety, and decoupled layering.
  • Testing: micro.override(...) block and pytest conftest recipe.