Skip to content

ASP.net Cluster Raft question to configure full in memory mode #199

Closed

Description

@guillaume-chervet

Hi again, and still thank you for this awesome library.

I think it is my latest question for SlimFaas:
https://github.com/AxaFrance/SlimFaas

I would like for security reason for some scenario to be able to set up raft cluster in full memory mode instead of hard disk usage. I would like to be able to set à mode whithout any disk write (like we can do with redis)

May you indicate to me the procedure to follow? Class to overload, ect. Or may be it is already possible to do by using MemoryBased implementation and configuration?

Regards,

Activity

  1. sakno commented on Oct 31, 2023

    @sakno
    Collaborator

    MemoryBasedStateMachine abstract class is for building in-memory current view of the data, but Write-Ahead Log is still persistent. It means that the in-memory state can be recovered from the persisted log entries.
    DiskBasedStateMachine is for building complex DB engines such as SQL or document-oriented databases. The difference is fully explained here.

    For security reasons, you can use MemoryBasedStateMachine and encrypt log entries stored on the disk. However, it can be done by Linux infrastructure (partition with enabled fs-level encryption) rather than by code. The same true if you want to place a whole WAL to the memory. Just mount ram-fs on your Linux machine and specify a path to that mount point as a storage for WAL. Everything will be in the memory in that case.

    However, I strongly discourage from doing that. Persistence is a major characteristics of Raft. Let's imagine you have 7 nodes. Due to failure, 4 of them are down. Due to lack of persistence, they lost any state. On restart, they have a conflict with other 3 nodes because their WALs not empty. The cluster will not be able to reach the majority without human intrusion.

  2. locked and limited conversation to collaborators on Oct 31, 2023
  3. converted this issue into a discussion #200 on Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions