Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Cargo replication #132

Open
leon3s opened this issue Feb 21, 2023 · 0 comments
Open

RFC: Cargo replication #132

leon3s opened this issue Feb 21, 2023 · 0 comments
Labels
question Further information is requested RFC Request for comment

Comments

@leon3s
Copy link
Member

leon3s commented Feb 21, 2023

Could be nice to brainstorm about how we can define a cargo replication.

We should be able to :

  • run only one instance on all nodes
  • run only one instance on targeted nodes
  • run one instance in one node
  • run x defined instances in all node
  • run x defined instances in targeted nodes
  • run x defined instances in one node
  • autoscale on all nodes
  • autoscale on targeted nodes
  • autoscale on one node

What else we should be able to do ?
And how we define the data ?

Example of the enum that came in my mind:

/// Auto is used to automatically define that the number of replicas in the cluster
/// Number is used to manually set the number of replicas
/// Note: auto will ensure at least 1 replica exists in the cluster
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "PascalCase"))]
#[cfg_attr(feature = "dev", derive(ToSchema))]
pub enum ReplicationMode {
  /// Auto is used to automatically define that the number of replicas in the cluster
  /// This will ensure at least 1 replica exists in the cluster
  /// And automatically add more replicas in the cluster if needed for redundancy
  Auto,
  /// Unique is used to ensure that only one replica exists in the cluster
  Unique,
  /// UniqueByNode is used to ensure one replica is running on each node
  UniqueByNode,
  /// UniqueByNodeGroups is used to ensure one replica is running on each node group
  UniqueByNodeGroups { groups: Vec<String> },
  /// UniqueByNodeNames is used to ensure one replica is running on each node name
  UniqueByNodeNames { names: Vec<String> },
  /// Number is used to manually set the number of replicas in one node
  Number(i64),
  /// NumberByNodes is used to manually set the number of replicas in each node
  NumberByNodes(i64),
  /// NumberByNodeGroups is used to manually set the number of replicas in each node group
  NumberByNodeGroups { groups: Vec<String>, number: i64 },
  /// NumberByNodeNames is used to manually set the number of replicas in each node name
  NumberByNodeNames { names: Vec<String>, number: i64 },
}
@leon3s leon3s added help wanted Extra attention is needed question Further information is requested labels Feb 21, 2023
@leon3s leon3s changed the title [RFC] Cargo replication RFC: Cargo replication Apr 3, 2023
@leon3s leon3s added RFC Request for comment and removed help wanted Extra attention is needed labels Apr 22, 2023
@leon3s leon3s pinned this issue May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested RFC Request for comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant