File Based Storage Provider
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.FileStorageto 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
FileGrainStorageclass, 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
FileGrainStorageFactoryto create instances ofFileGrainStorage(src/File/Orleans.Persistence.FileStorage/FileGrainStorageFactory.cs). - Created
FileGrainStorageOptionsto configure the root directory and serializer for the storage provider (src/File/Orleans.Persistence.FileStorage/FileGrainStorageOptions.cs). - Added extension methods in
FileSiloBuilderExtensionsto 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.mdfile 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
@dotnet-policy-service agree
👍🏻
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
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!
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.