orleans icon indicating copy to clipboard operation
orleans copied to clipboard

File Based Storage Provider

Open BernhardPollerspoeck opened this issue 6 months ago • 5 comments

This pull request introduces a new file-based grain storage provider for Microsoft Orleans. The changes include adding a new project for the provider, implementing its core functionality, and providing documentation and configuration examples.

New File-Based Grain Storage Provider

Project Setup:

  • Added a new project Orleans.Persistence.FileStorage to the solution with the necessary project references and metadata (Orleans.sln, src/File/Orleans.Persistence.FileStorage/Orleans.Persistence.FileStorage.csproj) [1] [2].

Core Implementation:

  • Implemented the FileGrainStorage class, which provides methods for reading, writing, and clearing grain state using a file-based approach (src/File/Orleans.Persistence.FileStorage/FileGrainStorage.cs).
  • Added a factory class FileGrainStorageFactory to create instances of FileGrainStorage (src/File/Orleans.Persistence.FileStorage/FileGrainStorageFactory.cs).
  • Created FileGrainStorageOptions to configure the root directory and serializer for the storage provider (src/File/Orleans.Persistence.FileStorage/FileGrainStorageOptions.cs).
  • Added extension methods in FileSiloBuilderExtensions to simplify the configuration of the file storage provider in Orleans silo builders (src/File/Orleans.Persistence.FileStorage/FileSiloBuilderExtensions.cs).

Documentation and Examples:

  • Added a README.md file with an introduction, setup instructions, and examples for configuring and using the file storage provider (src/File/Orleans.Persistence.FileStorage/README.md).
Microsoft Reviewers: Open in CodeFlow

BernhardPollerspoeck avatar Jun 02 '25 18:06 BernhardPollerspoeck

@dotnet-policy-service agree

BernhardPollerspoeck avatar Jun 02 '25 18:06 BernhardPollerspoeck

👍🏻

shacal avatar Jun 02 '25 19:06 shacal

I need to find the time to get more information about your suggested changes. i am not that deep into the details you mention and i dont want to submit changes i dont understand. @shacal @willg1983

BernhardPollerspoeck avatar Jun 10 '25 10:06 BernhardPollerspoeck

Hey! Interesting.

Is this meant to be used in a single silo or by having shared storage like NFS/SMB/EFS? Or do you plan on have some sort of replication/synchronization/distributed locking on the files itself?

I'm interested on what would happen when silos are scaled. Can you elaborate more on that on the PR itself and/or the README you added?

Thanks!

galvesribeiro avatar Jul 01 '25 01:07 galvesribeiro

Hey @galvesribeiro,

in the beginning it was meant to be some more single silo or on prem local smaller solution. I got a few great comments for possible improvements, but they maybe just dont match what this storage provider wants to be. Im gonna need to think and have some talks with @ReubenBond and his team on what we really should aim for. I had some really bad lack of time but i hope in the course of this week its getting easier and then i plan on getting this PR ready for review.

BernhardPollerspoeck avatar Jul 01 '25 03:07 BernhardPollerspoeck