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

Orleans JournaledGrain sample #7029

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

egil
Copy link
Contributor

@egil egil commented Mar 14, 2025

This sample aims to showcase different ways to use JournaledGrains.

Features:

  • Uses Aspire with a mix of persistent storage and session storage. Grain state is persistent across runs, clustering is not.
  • Uses Blazor Interactive Server for frontend bits
  • Uses JournaledGrain with Log storage
  • Uses grain observers to auto update Blazor UI
  • Allow users to see previous versions of todo lists
  • Use state-based storage for todo list registry grain to showcase that

Todo:

  • JournaledGrain with Custom storage

@egil
Copy link
Contributor Author

egil commented Mar 14, 2025

@ReubenBond here is a draft of the sample. Still things I want to add, but would like to get input on how things are looking before I wonder off in a wrong direction.

Comment on lines +7 to +13
builder.AddKeyedAzureTableClient("clustering");
builder.AddKeyedAzureBlobClient("grain-state");
builder.UseOrleans(siloBuilder =>
{
siloBuilder.AddLogStorageBasedLogConsistencyProviderAsDefault();
siloBuilder.AddStateStorageBasedLogConsistencyProvider(name: Constants.StateStorageProviderName);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this set up, the log consistency providers are using the grain state as storage, in this case, blob storage. When the log-based providers save state, does it just save the added/raised event(s), or does it save all in one go? That is, if there are 1000 events, will they all be serialized and save to blob storage or just the new events?

@egil egil marked this pull request as ready for review March 17, 2025 18:00
@egil egil requested a review from a team as a code owner March 17, 2025 18:00
@ReubenBond ReubenBond self-assigned this Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants