-
Notifications
You must be signed in to change notification settings - Fork 496
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
Is Redis actually transactional? #2071
Comments
I am fine with no supporting ACID transaction. Most likely we don't really use Redis for that kind of job, but it would be great if we can clarify that in the doc. |
From Redis document https://redis.io/docs/manual/transactions
|
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions. |
Quoting from https://redis.io/docs/manual/transactions
Redis is not transactional. It only offers a guaranteed to be sequential batch of operations where it simply will skip commands that fail. If commands are syntactically wrong the batch will never run - but syntactically yet logically incorrect commands resulting in failures - or any other form of failures - will simply be skipped. With that in mind I think we would do our users a disservice to allow it to be used as an actor state store. I recommend we deprecate the transaction support and remove it. Thoughts @artursouza @yaron2 @ItalyPaleAle? If the reason to keep Redis around is the local developer experience (we can discuss that in another issue) note that sqlite supports transactions. We should make sqlite the default for state store I think. We can keep Redis for PubSub, configuration store etc |
Or you can keep Redis but with limited support. e.g., report an error if developers try to use the transactional batch interface. |
We would do exactly that for a period of 1 or 2 releases while we deprecate the support I think! We'd keep Redis locally for PubSub and other things - just not as state store and use SQLite for that instead. We should remove transaction support (and hence actor state store support) for Redis. [one of the maintainers] |
Removing transaction support for Redis will leave a great many actor users without a suitable alternative. Before we go to such an extreme I suggest we:
|
For (1) that would be a runtime issue however not Redis specific. If actors can work without transaction support, then no problem here at all! For (2) we do have other OSS components and offerings that are offered by each cloud provider as managed services (Postgres, MySQL for example). And there are more proprietary services too - so we should be good there. |
As discussed with @yaron2 we are adding a warning to the Redis state store not to use Redis as actor state store in production at this time. We will continue to investigate whether we can implement transaction guarantees (not likely) or will officially deprecate the transaction and hence actor state store support. |
We are now quite invested in using Redis state store with Dapr, and when we started prototyping with Dapr more than half a year ago Redis was the default recommended actor state store (I think still is in the docs) and it also fits our needs perfectly since it is light-weight and offers great performance for our needs. We are not using any of the transaction APIs available, would you still advice against using Redis as actor state store? Would could be a suitable alternative in this case? Supported state stores don't seem to offer any other alternative that would have the characteristics of Redis that our application requires. Of course, if Dapr needs full transactional support to guarantee correctness of the actor runtime, we have to switch. From the previous comments:
Do you have any more insight on this? I would really appreciate any input here, since we are moving towards going live with the system we have built with Dapr soon and so far are quite happy with how things work 🙂 |
Using Actors does use the transactional capabilities under the hood, especially for things like reminders. Given the discussion above, I would not recommend this for production. It's ok for development, but due to the lack of automatic rollbacks there could be risks with using it in production for actor state store. Where is your application running and what are your requirements (also in terms of performance)? |
Anything with the characteristics of Redis is probably not suitable as an actor state store - specifically due to lack of transaction support which is required to support the fundamental promises and concepts of actors. I advise using any other stable component that has support for actors. |
Thank you for your input!
We are running in k8s and we have a lot of external sources connected to the Dapr system constantly creating new actors and updating the existing ones with reminders in place also triggering state updates very frequently. We have in total maybe around 20 000 actors (created, deleted and updated continuously) and fetching actor state on user requests (we expect to be able to handle over 100 000 users making frequent requests to the system). The updates should propagate through several layers of actors relatively quick to get almost real-time updates. I realize these requirements are pretty vague and don't include any exact numbers on how fast we want the requests to be, but the choice of going with redis was pretty obvious from the start, especially as it is the recommended choice. Would it be possible to update the docs to make it clear redis is not recommended for state store?
What would be a stable component that has support for actors? Since the docs might outdated, would you recommend |
Tried with Azure CosmosDB which supports actors, but could not get it to work with workflows. Somehow workflow inputs are not stored when GETing a workflow. I assume the actor numbering via EDIT: It seems to work with CosmosDB, even though the resources cannot be modified or viewed on cosmos.azure.com due to the invalid characters mentioned above. I could not get workflows running on kubernetes with the dotnet SDK initially. Created an issue on that as dapr/dotnet-sdk#1070 EDIT2: one workflow can be run on CosmosDB, but after that, it gets ugly... errors start showing up after the first completed workflow
|
Tried with postgresql and mysql. Getting error
Looking at the source code, it looks like neither oracledatabase nor sqlite work: @berndverst Now I wonder, which stable components do support workflows at this point? |
We are still transitioning and thinking about going with unmanaged |
@mPyKen thanks for sharing these. Ill open some issues and we’ll get them fixed. |
@mPyKen for this issue, do you know the name of the key that triggered the error? Can you share a few more logs before and after? CC: @cgillum |
sorry I already moved on to mongodb which seems to be working. I don't think any keys were logged for that issue... |
We are facing some issues using actor with a cosmosDB state store. This issue might be related to dapr/dapr#6339. We are moving the setup to use Redis instead of CosmosDB as our state store. This matches our current longhaul setup. While this might seem in contradiction with dapr/components-contrib#2071 and dapr/cli#1328, unblocking this issue will allow for easier and predictable reproductions of our longhaul setup. We might revisit the use of CosmosDB as a state store in the future. Signed-off-by: Tiago Alves Macambira <[email protected]>
We are facing some issues using actor with a cosmosDB state store. This issue might be related to dapr/dapr#6339. We are moving the setup to use Redis instead of CosmosDB as our state store. This matches our current longhaul setup. While this might seem in contradiction with dapr/components-contrib#2071 and dapr/cli#1328, unblocking this issue will allow for easier and predictable reproductions of our longhaul setup. We might revisit the use of CosmosDB as a state store in the future. Signed-off-by: Tiago Alves Macambira <[email protected]>
Our docs report Redis state store as "Transactional" because it allows to send multiple Update/Delete operations at once and to be executed "together". But does it actually have ACID guarantees?
https://docs.dapr.io/reference/components-reference/supported-state-stores/
redis/go-redis#1602
The text was updated successfully, but these errors were encountered: