Skip to main content
Version: 2.x

Introduction to Application Architecture in ZIO

The architecture of a ZIO application is shaped by the programming paradigms ZIO builds on, by the qualities the application must have, and by the patterns we use to structure its code and design its APIs. This section covers each of these in turn, from the paradigm level down to concrete patterns built from ZLayer, ZIOApp, and ZIO Streams.

Pages in This Sectionโ€‹

The section has four pages, ordered from the general to the specific:

  • Programming Paradigms in ZIO โ€” How ZIO combines functional programming for code maintainability with object-oriented programming for code organization, and how it relates to declarative, structured, and aspect-oriented programming through structured concurrency, Scope, ZIOAspect, and TestAspect.
  • Non-functional Requirements โ€” Correctness, testability, maintainability, low latency, high throughput, robustness, resiliency, efficiency, and developer productivity, and the ZIO features that support each one.
  • Architectural Patterns โ€” Onion architecture assembled from ZLayer values, streaming architecture with ZIO Streams, the sidecar pattern with ZIOApp#<> or ZIOApp#bootstrap, and where to draw module boundaries as an application grows.
  • Functional Design Patterns โ€” Functional data modeling with algebraic data types, and functional domain modeling with executable and declarative encodings, shown by building a small effect system from scratch.

Where to Go Nextโ€‹

The patterns in this section rely on the following parts of the documentation:

  • Writing ZIO Services โ€” How to define the services that form the layers of an onion architecture.
  • Dependency Injection in ZIO โ€” How to assemble those services into a whole application with ZLayer.
  • ZIO Streams โ€” The streaming data types behind a streaming architecture.
  • ZIO Test โ€” How to write tests as values, with test versions of the standard services such as TestClock and TestConsole.

ZIO Chat

๐ŸŒŸ Greetings from ZIO Chat! ๐ŸŒŸ Have questions about ZIO? Look no further! I'm here to be your ZIO guru. Whether you're a seasoned pro or just starting out, I've got answers tailored just for you. Fire away with your ZIO queries, and I'll hit you back with the best insights I've got. Let's dive into the world of ZIO together!