#[v5] Changing Persistence Strategies

1 messages · Page 1 of 1 (latest)

severe timber
#

This post is less of a “help” and more of a “sanity check”.

Given the known caveats of persistence is it insane to consider swapping persistence strategies throughout the lifecycle of an actor?

MOTIVATION:

Maximize the amount of time new users can experiment with my application BEFORE requesting any kind of account creation.

PROGRESSIVE PERSISTENCE STRATEGIES:

  1. Cookie – Store things locally while user is experimenting with basic features
  2. Prompt sign-up after initial tasks are completed
  3. Redis Cache – DB storage allows users to access their state from other browsers. No risk of losing data if they clear cache locally
  4. User joins a multiplayer game
  5. PartyKit Live Actor – Once upcoming PartyKit integration is available, individual player actors can communicate with a shared machine context

Actors can persist their internal state and restore it later. Persistence refers to storing the state of an actor in persistent storage, such as localStorage or a database. Restoration refers to restoring the state of an actor from persistent storage.

inner radish
#

Hmm, this is interesting... why not use the same persistence strategy regardless?

severe timber
#

🤔 I’m all about simplicity wherever possible!

The RBAC on Redis (…mainly due to my own lack of experience) is what’s throwing me for a loop.

I might be missing a simple pattern that would allow me to tie an anonymous user to their specific actor.

USE CASE: Creating a character sheet and persisting that state across multiple sessions without forcing a user to sign-up / authenticate.