akka-persistence-dynamodb icon indicating copy to clipboard operation
akka-persistence-dynamodb copied to clipboard

Implement akka persistence query

Open joost-de-vries opened this issue 3 years ago • 1 comments

Implements #50
A 6 yr old issue 😄

Implements currentEventsByPersistenceId and currentPersistenceIds queries.

There are two implementations of currentPersistenceIds. One does a dynamodb scan, the other a query using an extra GSI. The latter seems to be much faster: 10 seconds vs hours for an event log of 460.000 dynamodb items / 76.000 persistence ids.

joost-de-vries avatar Aug 04 '22 07:08 joost-de-vries

oof. last time I use the web UI to edit.

Trying to fix that transient test error. My fix was definitely not correct. Hm. I still think the hypothesis is correct tho: the test has to confirm one WriteMessagesSuccessful per WriteMessages.

coreyoconnor avatar Aug 30 '22 17:08 coreyoconnor

I fixed that CurrentPersistenceIdsSpec. So ready to merge as far as I'm concerned.

(Can you do a "squash and merge" when you merge it? Then we get a nice single commit in master.)

joost-de-vries avatar Sep 02 '22 15:09 joost-de-vries

Agreed: Looks good to merge. I'll merge once I get back to a computer. Exciting! Very nice to have. Thanks again!

I'll figure out how to release (with a proper version number) after this is merged :)

On Fri, Sep 2, 2022, 08:06 Joost de Vries @.***> wrote:

@.**** commented on this pull request.

In src/main/scala/akka/persistence/dynamodb/journal/DynamoDBJournalConfig.scala https://github.com/akka/akka-persistence-dynamodb/pull/111#discussion_r961780121 :

@@ -48,3 +48,7 @@ class DynamoDBJournalConfig(c: Config) extends DynamoDBConfig { ",client.config:" + client + ")" }

Aha. I thought you were talking about DynamoDBJournalConfig. But you meant JournalSettingsProvider. I left it here because it's specific for akka.persistence.dynamodb.journal and is meant to support DynamoDBJournalConfig. So that's why the akka.persistence.dynamodb.journal.DynamoDBJournalConfig seemed a natural place.

— Reply to this email directly, view it on GitHub https://github.com/akka/akka-persistence-dynamodb/pull/111#discussion_r961780121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIMDNDXTHMUAWFFLQVJBTV4IJXXANCNFSM55RQW4OQ . You are receiving this because you commented.Message ID: @.***>

coreyoconnor avatar Sep 02 '22 21:09 coreyoconnor

Tx for reviewing Corey.

joost-de-vries avatar Sep 03 '22 05:09 joost-de-vries

One more thing: I looked into implementing PersistenceIdsQuery. I don't think it's possible. (Unless you keep all values in memory that is. Which defies the point of streaming imo.) I did implement an alphabetically sorted query though. Which allows at least for a resumable query. If new persistence ids are created alphabetically that is.

joost-de-vries avatar Sep 03 '22 06:09 joost-de-vries