Files
dance-lessons-coach/adr/0002-chi-router.md
Gabriel Radureau 52065c9cf3
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Failing after 13s
refactor: convert all DanceLessonsCoach mentions to kebab-case
2026-04-07 19:11:39 +02:00

2.1 KiB

Use Chi router for HTTP routing

  • Status: Accepted
  • Deciders: Gabriel Radureau, AI Agent
  • Date: 2026-04-02

Context and Problem Statement

We needed to choose an HTTP router for the dance-lessons-coach web service that provides:

  • Good performance characteristics
  • Flexible routing capabilities
  • Middleware support
  • Active maintenance and community support
  • Compatibility with our interface-based design

Decision Drivers

  • Need for performant HTTP routing
  • Desire for clean, idiomatic Go API
  • Requirement for middleware support
  • Long-term maintainability
  • Good documentation and examples

Considered Options

  • Chi router - Lightweight, fast router with good middleware support
  • Gorilla Mux - Well-established but heavier
  • Gin - High performance but more opinionated
  • Standard library - Simple but limited features

Decision Outcome

Chosen option: "Chi router" because it provides excellent performance, clean API, good middleware support, and active maintenance while remaining lightweight and unopinionated.

Pros and Cons of the Options

Chi router

  • Good, because lightweight and fast
  • Good, because excellent middleware support
  • Good, because clean, idiomatic Go API
  • Good, because actively maintained
  • Good, because good documentation and examples
  • Bad, because slightly less feature-rich than some alternatives

Gorilla Mux

  • Good, because very mature and stable
  • Good, because feature-rich
  • Bad, because heavier and more complex
  • Bad, because less performant than Chi

Gin

  • Good, because extremely high performance
  • Good, because good ecosystem
  • Bad, because more opinionated framework
  • Bad, because different from standard library patterns

Standard library

  • Good, because no external dependencies
  • Good, because simple and familiar
  • Bad, because limited routing capabilities
  • Bad, because no built-in middleware support