Replica support for PostgreSQL
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Overview
One of the biggest challanges in distributed systems is nodes failover and restarts. In my own experience, it is not very trivial and can be hard for begginers to setup replicated Postgres locally to test failover scenarios (for example, if Master node is down). Being able to debug those scenarious locally can be extremely helpful in many situations
This issue is related to https://github.com/dotnet/aspire/issues/992, but I think replicas should be defined granulary for each unique resource type (for Postgres or Kafka for example)
## API
For Postgres specifically, I we should provide two distinct methods for configuring `async` and `sync` replicas. This will look something like this:
```cs
builder.AddPostgres("database")
.WithImage("postgres:14.3")
.WithAsyncReplicas(2)
.WithSyncReplicas(1)
.WithPgAdmin();
```
## Risks
I'm new to Aspire, so I'm unaware if this proposal will somehow interfere with cloud/k8s support
Contributor guide
Assessment
This issue has not been assessed yet.