Ktor structuring

  • Ktor = REST services.
  • Goal = write maintainable code that solves business problems effectively, not to create complex architectural masterpieces (which is mostly subjective anyway).

Generally speaking, don't overcomplicate things if you don't have to.

Tiered Architecture

N-tiered architecture is the most common approach for REST microservices.

  • Controller: Put HTTP related stuff (handling of parameters, content type, JSON (de-) serialization here)
  • Service: Business logic
  • Data layer (optionally interchangeable): Data access