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
Extract CassandraSession and related classes to a separate library #390
Comments
I agree that CassandraSession would be useful standalone, and that’s why it’s public api in Lagom. Perhaps it could live in Alpakka Cassandra connector (merging with what is already there)? |
Would that mean that Akka Persistence Cassandra would depend on the Alpakka Cassandra connector, or that there would be two separate I think we'd want to retain the |
It would be ok to depend on Alpakka Cassandra here, but that would require that there is no performance loss or other drawbacks in the Alpakka implementation. |
Let me explain what I am looking for here, if that helps. When I am working with Lagom Read Models, I have access to a Cassandra Session. However, sometimes I want to access a Cassandra Session outside of a read model (eg. consuming from a Kafka topic). In that case I want to be able to use the same Cassandra Session. I want to avoid having to switch between different implementations. I want one implementation everywhere. However, I don't want that implementation to require me to implement Akka Cluster features or Lagom Persistent Entity features. Cassandra shouldn't require those things. Right now that isn't possible. I guess at the end of the day what I want is a fairly minimal CassandraSession that provides me with things like non-blocking APIs, simple configuration etc, and can be used consistently across our products. |
It's clear, I agree. |
@ennru and @2m could you comment on whether you think this should be merged into the Alpakka Cassandra connector? It makes some sense, because it implements queries using a custom graph stage. On the other hand, it also offers non-streaming convenience APIs for queries and updates that are also very commonly used, so that makes me think that Alpakka might not be appropriate. |
Put this at the bottom of the Todo list as not to complicate the dev process until we're sure it won't change |
On the other hand I think @ennru might be eager to use this in Alpakka for building other things for the Cassandra connector there. |
We can start working on it in this repository so that it doesn't disturb the development of APC* things, but get's closer to what we want to offer in Alpakka. |
sounds good |
Fixed with #736 |
@WadeWaldron suggested that
CassandraSession
would be useful in Akka/Lagom services that don't use Akka Persistence. For example, something that consumes events from a Kafka topic and updates a Cassandra table. It offers a better, more consistent API than using the underlying DataStax Java driver directly.This would require adding a new "session" module, and moving classes to it that don't depend on any Akka Persistence APIs.
The text was updated successfully, but these errors were encountered: