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
How to choose actors when users share data? #42
Comments
I see nothing wrong with querying multiple actors. It's just a read operation. I would consider actor types just as you have proposed. |
Using these actor choices seems less elegant than classic monolithic SQL queries to me. Perhaps I'm missing something? For example, retrieving the contents of all unread items in the RSS reader. With classic SQL, it would be approximately, With ActorDB using one actor type stores feeds and another actor type stores each user's per-feed-item read/unread status, I'd need one query to select all unread item IDs from the Using either multiple queries and an Or maybe a better approach is for each With each actor being a complete database, I'm very unclear on where classic SQL design and queries stop end and ActorDB-specific operations and design begin. |
Yes this is how I would do it. User actor stores positions of last read items for every feed, then you go to the feeds themselves to check if there is anything new.
Yes but what you described has to happen either way. You are either joining yourself or within the database. A single server database is fine with doing it as it has all that data readily available. A distributed system must join across servers for this to work. With ActorDB it is very clear what has to happen. This way you can design your system with this in mind. When you are displaying the feeds to the user, they can be loaded asynchronously. You do not have to read everything at once. You are not doing joins across large tables, you are making simple read queries. I suggest not worrying as much about what is "elegant" but what is scalable and reasonable. A lot of the time people consider one solution more elegant then the other, simply because they shifted the complexity to some other system. It's elegant to them, because they don't have to deal with the messy details.
Usually the correct design is avoiding multi actor write transactions. In this case if you have a feed, your crawler updates feeds actors, your client side code updates user actors. This keeps your write and read load distributed across your cluster. |
Are there guidelines for choosing actor types when users share data?
In the following scenarios, the actor breakdowns I come up with all require selecting data from multiple actors and manually joining it in my app, rather than relying on SQL operations inside individual actors. That sounds like it violates the intent of ActorDB. Alternatively, using extensive denormalization, which is error-prone and possibly storage-heavy.
How could these be elegantly solved in ActorDB?
The text was updated successfully, but these errors were encountered: