Türkçe

Beyond Kubernetes: Why Stateful Infrastructure Needs a Different Architecture

Kubernetes has become the dominant platform for deploying and operating containerized applications. Its strengths are well understood: declarative workloads, automated scheduling, rolling deployments, self-healing, service discovery, and horizontal scaling.

These capabilities are particularly powerful for stateless and horizontally scalable workloads, where an instance can be terminated, recreated, or moved to another node without losing application data.

Stateful systems are different.

PostgreSQL, MongoDB, Redis, Apache Kafka, and RabbitMQ do not simply represent application processes. They manage persistent data, replication state, storage topology, consistency, recovery procedures, and failure domains.

Kubernetes can run these systems successfully, and the ecosystem provides StatefulSets, persistent volumes, CSI drivers, operators, and database-specific controllers to support them.

The architectural question is therefore not:

“Can Kubernetes run stateful services?”

It clearly can.

The more important question is:

“Should the same orchestration model used for stateless application workloads also be the primary operational model for every stateful infrastructure component?”

In many architectures, the answer does not have to be yes.

The Stateful Infrastructure Problem

Stateful infrastructure has requirements that are fundamentally different from those of ordinary application workloads.

A stateless API can usually be recreated from an image and configuration. A database cannot be recreated without its data. A Kafka broker is not simply another container; its storage layout, replication state, partition ownership, and recovery behavior matter.

This creates several areas of operational complexity.

1. Storage Topology Matters

Stateful engines are highly sensitive to storage characteristics such as:

  • fsync latency
  • sequential and random I/O throughput
  • IOPS
  • storage durability
  • filesystem behavior
  • local versus network-attached storage
  • failure and recovery characteristics

Persistent volumes and CSI provide valuable portability and abstraction, but abstraction can also introduce additional operational layers.

This does not mean that CSI or network-attached storage is inherently slow. High-performance cloud and enterprise storage systems can provide excellent performance.

The architectural point is that storage topology becomes part of the database architecture.

For workloads that benefit from direct host-attached storage or local NVMe, introducing an additional storage abstraction may not always be the optimal design.

2. Stateful Failover Is More Than Pod Rescheduling

For a stateless service, replacing a failed pod is often enough.

For a database, recovery may involve:

  • determining which replica is authoritative
  • promoting a standby
  • recovering write-ahead logs
  • re-establishing replication
  • validating data consistency
  • moving traffic
  • rebuilding the failed replica

The lifecycle of the workload and the lifecycle of its data are therefore different.

This is an important architectural distinction:

Workload recovery is not necessarily data recovery.

3. Stateful Systems Have Their Own Distributed Consensus

Modern infrastructure components already implement sophisticated distributed protocols.

PostgreSQL replication, MongoDB replica sets, Kafka's KRaft architecture, and RabbitMQ quorum queues each have their own approaches to replication, quorum, leader election, and recovery.

Putting these systems inside another distributed control plane does not remove their complexity.

Instead, an architecture may end up operating several layers simultaneously:


Application
     │
Kubernetes
     │
Operator
     │
CSI / Storage
     │
Network
     │
Stateful Engine
     │
Replication / Consensus
     │
Persistent Storage

Each layer can be useful individually.

The challenge is managing the interactions between them.

A Different Operational Model

This leads to a different architectural approach:

Use orchestration where orchestration provides the greatest value, and use infrastructure models optimized for stateful systems where persistent data is the primary concern.

This does not require abandoning Kubernetes.

Instead, it suggests separating two responsibilities:


                    APPLICATION PLATFORM
                           │
                    Kubernetes / K3s
                           │
              ┌────────────┴────────────┐
              │                         │
        Stateless APIs             Workers / Jobs
        Frontends                   Dynamic workloads
        Services                   Auto-scaling
              │
              │
              ▼
        STATEFUL INFRASTRUCTURE
              │
      ┌───────┼────────┐
      │       │        │
 PostgreSQL  Kafka    MongoDB
      │       │        │
    Redis   RabbitMQ  Storage

    

The purpose is not to declare one platform universally superior.

It is to acknowledge that stateless application orchestration and stateful infrastructure operations have different optimization targets.

TuranOrdo's Approach

TuranOrdo was designed around this distinction.

Rather than treating infrastructure as a collection of containers and Compose files, TuranOrdo maintains a persistent infrastructure model:


System
   │
   └── App
        │
        ├── Database
        ├── Redis namespace
        ├── RabbitMQ queues
        ├── Kafka topics
        ├── Storage
        ├── Network routes
        └── Runtime

    

The important concept is not Docker Compose itself.

It is explicit infrastructure ownership.

An application declares what infrastructure it requires. TuranOrdo translates those requirements into infrastructure resources, configures their relationships, applies security boundaries, initializes them deterministically, verifies them, and reconciles the resulting state.

This gives stateful resources a context that generic container orchestration does not necessarily provide.

System → App → Resource

The central model is:


    System → App → Resource

A database is not simply "a PostgreSQL container."

It is an application-owned resource with:

  • a defined owner
  • credentials
  • access policies
  • network boundaries
  • initialization state
  • dependency relationships
  • lifecycle information
  • verification requirements

The same principle applies to messaging and caching infrastructure.

A RabbitMQ queue can belong to a specific application.

A Kafka topic can belong to a specific application.

A Redis namespace can be isolated at the application level.

A database can have its own database identity and credentials.

This distinction becomes increasingly important as the number of applications and infrastructure dependencies grows.

Deterministic Initialization and Verification

Another important difference is the treatment of infrastructure initialization.

Instead of assuming that a service being "running" means that infrastructure is ready, TuranOrdo follows explicit lifecycle phases:


Pre
 │
 ▼
Start
 │
 ▼
Init
 │
 ▼
Verify
 │
 ▼
Post

    

Initialization can include:

  • database creation
  • users and permissions
  • Redis namespaces
  • RabbitMQ virtual hosts, queues, exchanges, and permissions
  • Kafka topics and access policies
  • TLS configuration
  • routing configuration
  • application runtime preparation

Verification then checks whether the expected infrastructure state actually exists.

This is particularly important for stateful systems because process health and infrastructure correctness are not the same thing.

Stateful Infrastructure Is Also About Ownership

One of the limitations of treating infrastructure primarily as workloads is that infrastructure resources can become disconnected from the applications that depend on them.

Consider a platform with:


20 Applications
      │
      ├── 20 databases
      ├── 40 Redis namespaces
      ├── 80 RabbitMQ queues
      ├── 100 Kafka topics
      └── Multiple storage resources

    

At that scale, knowing that everything is "running" is not enough.

The platform also needs to know:

  • Who owns each resource?
  • Which application depends on it?
  • Which credentials provide access?
  • Which network routes expose it?
  • What happens when the application is removed?
  • Which resources are orphaned?
  • Which resources need to be recreated?
  • Which resources belong to the same system?

That is why TuranOrdo treats the infrastructure registry as a persistent control-plane metadata layer.

The registry provides the information required for deterministic provisioning and reconciliation.

HA and DR Should Be Separate Problems

Another important architectural distinction is between High Availability (HA) and Disaster Recovery (DR).

They solve different failure scenarios.

Intra-Region HA

HA is primarily concerned with failures inside the normal operating environment:


Primary
   │
   │ Native replication
   ▼
Secondary

    

The exact replication mechanism should be selected according to the stateful engine.

For example:

  • PostgreSQL → native streaming replication / Patroni-based architectures
  • Kafka → Kafka's native replication and KRaft architecture
  • RabbitMQ → quorum-based replication
  • MongoDB → replica sets

The infrastructure platform should provide the surrounding operational foundation rather than attempting to replace the database's native replication mechanism.

Inter-Region DR

DR addresses a fundamentally different failure domain:


    PRIMARY REGION
          │
          │ asynchronous replication
          ▼
   SECONDARY REGION

    

The objective is to prevent a regional failure from becoming a permanent data-loss event.

Cross-region replication should generally remain asynchronous because geographic latency and network partitions should not unnecessarily block the primary region's normal transaction path.

This leads to a useful architectural principle:

Optimize local replication for availability and remote replication for recoverability.

The Future Direction: Hybrid Infrastructure

This architecture naturally leads toward a hybrid model.


                     ┌─────────────────────┐
                     │     Edge / Proxy    │
                     └──────────┬──────────┘
                                │
               ┌────────────────┴────────────────┐
               │                                 │
               ▼                                 ▼
    ┌────────────────────┐             ┌────────────────────┐
    │ Kubernetes / K3s   │             │ Stateful           │
    │                    │             │ Infrastructure     │
    ├────────────────────┤             ├────────────────────┤
    │ Stateless APIs     │             │ PostgreSQL         │
    │ Frontends          │             │ Kafka              │
    │ Workers            │             │ MongoDB            │
    │ Microservices      │             │ Redis              │
    │ Auto-scaling       │             │ RabbitMQ           │
    └────────────────────┘             └────────────────────┘
               │                                 │
               └────────── Private Network ──────┘

    

In this model:

Kubernetes / K3s handles what it does particularly well:

  • stateless services
  • horizontal scaling
  • rolling deployments
  • workload scheduling
  • dynamic application environments

The dedicated infrastructure layer handles:

  • persistent databases
  • messaging systems
  • caching infrastructure
  • storage
  • replication
  • stateful recovery procedures

This does not mean that Kubernetes must never host a database.

For many organizations, Kubernetes plus database operators is an excellent solution.

The point is that Kubernetes should be a choice rather than an architectural assumption.

Where TuranOrdo Fits

TuranOrdo's current architecture is built on Docker Compose and Linux rather than Kubernetes.

Its primary contribution is not a claim of universally faster storage or universally shorter failover times.

Its contribution is a different infrastructure abstraction:

Infrastructure is modeled as an owned, persistent, verifiable, and reconcilable system of resources.

Today, TuranOrdo provides the foundation for:

  • PostgreSQL, MySQL, and MongoDB infrastructure
  • Redis
  • RabbitMQ
  • Apache Kafka
  • shared networking
  • TLS
  • Traefik routing
  • shared Nginx
  • containerized application runtimes
  • PHP runtimes
  • static applications
  • infrastructure secrets
  • health and dependency verification
  • deterministic initialization
  • registry-driven reconciliation

The architecture also creates a foundation for future stateful capabilities such as:

  • application-aware backup and restore
  • restore verification
  • intra-region HA
  • cross-region asynchronous replication
  • automated failover
  • dedicated stateful nodes
  • disaster recovery orchestration

These are evolution paths, not assumptions about the current platform.

The Bigger Architectural Lesson

The debate should not be:

Kubernetes vs. TuranOrdo

It should be:

What operational model is appropriate for each class of workload?

Kubernetes transformed application deployment by providing a powerful general-purpose orchestration platform.

But stateful infrastructure has another set of priorities:

data durability, storage topology, replication, consistency, ownership, recovery, and failure-domain management.

Those concerns deserve to be modeled explicitly.

A modern architecture can therefore combine multiple infrastructure models:


          APPLICATION LAYER
                   │
          Kubernetes / K3s
                   │
          Stateless workloads
                   │
                   ▼
          STATEFUL INFRASTRUCTURE
                   │
    ┌──────────────┼──────────────┐
    ▼              ▼              ▼
Databases      Messaging        Storage

    

The objective is not to make every component conform to one orchestration system.

The objective is to choose the architecture that matches the operational characteristics of the component.

That is the architectural direction behind TuranOrdo.

Not replacing Kubernetes.

Not declaring Kubernetes unsuitable for stateful workloads.

But recognizing that stateful infrastructure deserves an operational model designed around persistence, ownership, deterministic initialization, verification, replication, and recovery.

And in larger distributed systems, that separation can be more valuable than forcing every workload into the same orchestration paradigm.

When This Architecture Makes Sense

A dedicated stateful infrastructure layer is not necessary for every organization or every application.

For a small application with a single database, managed PostgreSQL or a Kubernetes operator may be the simplest and most appropriate choice. Introducing another infrastructure layer would add complexity without providing enough benefit.

The model becomes more interesting as infrastructure requirements grow.

A dedicated stateful architecture can be particularly valuable when an organization has:

  • multiple applications sharing common infrastructure
  • databases and messaging systems that are critical to application availability
  • strict resource ownership and isolation requirements
  • infrastructure that must run consistently across development, VPS, private, and cloud environments
  • workloads that benefit from predictable storage and network characteristics
  • explicit backup, recovery, replication, and failure-domain requirements
  • a desire to avoid making one orchestration platform responsible for every infrastructure component

The important principle is therefore not to introduce another platform simply for the sake of doing so.

It is to introduce architectural separation when the operational characteristics of the workloads justify it.

Kubernetes Is Still the Right Tool for Many Workloads

None of this makes Kubernetes obsolete.

Kubernetes remains an extremely powerful platform for stateless applications, dynamically scheduled workloads, rolling deployments, service discovery, and horizontal scaling. It can also operate stateful workloads successfully through StatefulSets, persistent storage, operators, and database-specific tooling.

The argument is not that Kubernetes cannot manage databases.

It is that organizations should not automatically assume that every infrastructure component benefits from the same orchestration model.

For some teams, running PostgreSQL inside Kubernetes is exactly the right decision.

For others, keeping critical databases and messaging systems on dedicated infrastructure while Kubernetes manages the stateless application tier may provide a clearer operational boundary.

The correct architecture depends on factors such as:

  • workload characteristics
  • team expertise
  • storage architecture
  • availability requirements
  • recovery objectives
  • operational complexity
  • infrastructure scale
  • cost and portability requirements

Kubernetes should therefore be a strategic choice, not an architectural assumption.

The Future: A Composable Infrastructure Platform

This distinction points toward a broader infrastructure model.

Instead of attempting to make one platform responsible for every workload, infrastructure can be composed from specialized layers:


         APPLICATIONS
              │
              ▼
    ┌──────────────────┐
    │ Kubernetes / K3s │
    │                  │
    │ Stateless APIs   │
    │ Frontends        │
    │ Workers          │
    │ Dynamic Services │
    └────────┬─────────┘
             │
       Private Network
             │
             ▼
    ┌──────────────────┐
    │   TuranOrdo      │
    │                  │
    │ Stateful Infra   │
    │ Databases        │
    │ Messaging        │
    │ Caching          │
    │ Storage          │
    └──────────────────┘

    

In such an architecture, Kubernetes and TuranOrdo are not necessarily competitors.

They solve different parts of the infrastructure problem.

TuranOrdo's longer-term direction is to provide a consistent infrastructure foundation on which these specialized layers can coexist, while maintaining explicit ownership, security boundaries, deterministic initialization, verification, and reconciliation.

Future extensions can build on this foundation with capabilities such as application-aware backup and restore, stateful high availability, cross-region disaster recovery, and more advanced orchestration.

The objective is not to create another monolithic platform.

It is to create a composable infrastructure operating model in which each layer has a clear responsibility.

Conclusion

The important question is not whether Kubernetes can run stateful services.

It can.

The more useful question is whether the operational model used for stateless application workloads is always the best model for persistent infrastructure.

Stateful systems introduce concerns that deserve explicit architectural treatment: storage topology, data ownership, replication, consistency, recovery, failure domains, and lifecycle management.

TuranOrdo explores an alternative approach by treating infrastructure as a persistent, owned, verifiable, and reconcilable system of resources rather than simply a collection of containers.

Its System → App → Resource model provides the foundation for connecting infrastructure resources to the applications that depend on them, while deterministic initialization, verification, security boundaries, and reconciliation provide the operational layer around those resources.

This does not require replacing Kubernetes.

It suggests something more flexible:

Use the orchestration model that best matches the workload.

Kubernetes can orchestrate dynamic application workloads.

A dedicated infrastructure layer can manage persistent state.

And together, these specialized systems can form a more composable, predictable, and maintainable architecture for modern distributed applications.

The future of infrastructure may not be one orchestrator for everything, but specialized operational models working together.