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

RDoc-2923 RavenDB plugin for Akka.NET Persistence #1889

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

{NOTE: }

* Akka.Persistence provides two primary methods to persist actor state: **Event sourcing** and **Snapshots**.
Event sourcing stores state changes as a sequence of events, while snapshots capture the actor's state at specific points for quicker recovery.
Copy link

Choose a reason for hiding this comment

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

Maybe rephrase this a bit and more at length? Took me a few tries to understand which word was the verb here :)

Copy link
Member Author

Choose a reason for hiding this comment

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

done


* This collection is designated by the RavenDB plugin for Akka's stored events.
Although it is technically possible to store documents from other sources in this collection,
it is recommended to reserve the Events collection exclusively for Akka storage.
Copy link

Choose a reason for hiding this comment

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

It is forbidden to store other documents in this collection. It is recommended that this collection (and snapshots) is in another designated database alltoghther.

Copy link
Member Author

Choose a reason for hiding this comment

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

done
added 'storing guidelines' section

* Each snapshot is stored as a document in the `Snapshots` collection in append-only mode.

* Similar to the Events collection, this collection is designated by the RavenDB plugin for Akka's snapshots,
and it is recommended to reserve the Snapshots collection exclusively for Akka storage.
Copy link

Choose a reason for hiding this comment

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

Same here

* Replaying snapshots significantly accelerates recovery, reduces network transmission,
and lowers both actor event replay time and CPU usage.

* After the snapshot is retrieved, events can be deleted from the events journal to free up space.
Copy link

Choose a reason for hiding this comment

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

The events can be deleted after we create the snapshot successfuly (not replay it) because that guarantees we have all the previous events data in persistence. With the SaveSnapshotSuccess command, like in your example code

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* RavenDB is a distributed database, allowing writes, reads, and queries to target different nodes across the cluster.

* To prioritize consistency over availability, the RavenDB plugin uses a [cluster-wide transaction](../../server/clustering/cluster-transactions) for storing events and snapshot documents.
This ensures that persisted data is consistently applied across all database instances in the cluster, fulfilling Akka's global consistency requirement.
Copy link

Choose a reason for hiding this comment

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

Maybe clarify that this fullfils Akka's demand for no gap between events at any point in time, across all nodes?

Copy link
Member Author

Choose a reason for hiding this comment

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

done


{INFO: }
When configuring the plugin using both Hosting and HOCON, if the same parameters are specified in both,
the configuration provided via Hosting take precedence and will override the corresponding HOCON settings.
Copy link

Choose a reason for hiding this comment

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

takes*

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* Akka.Persistence.Query comes with several stream-based query interfaces for querying persisted data.
This interface abstracts the underlying database, allowing your application to switch persistence providers without requiring changes to the query code.

* The RavenDB persistence plugin fully supports all Akka's query interfaces.
Copy link

Choose a reason for hiding this comment

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

all of*?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* The RavenDB persistence plugin fully supports all Akka's query interfaces.
Just include `Akka.Persistence.RavenDb.Query` in your application.

* view queries in traffic watch under 'streams' todo..
Copy link

Choose a reason for hiding this comment

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

todo?

Copy link
Member Author

@Danielle9897 Danielle9897 Aug 19, 2024

Choose a reason for hiding this comment

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

right - I'm on it now......
added this info within a new section: "Inner implementation details"

@Danielle9897 Danielle9897 marked this pull request as draft August 19, 2024 09:36
@Danielle9897 Danielle9897 marked this pull request as ready for review August 19, 2024 13:26
@ppekrol ppekrol merged commit 182e233 into ravendb:master Aug 21, 2024
1 of 2 checks passed
@Danielle9897
Copy link
Member Author

Danielle9897 commented Sep 3, 2024

@karmeli87
This has been merged, but we still need your review/approval for this PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants