Skip to content
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

Serialize event in separate column #91

Closed
patriknw opened this issue Sep 4, 2020 · 2 comments
Closed

Serialize event in separate column #91

patriknw opened this issue Sep 4, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@patriknw
Copy link
Contributor

patriknw commented Sep 4, 2020

I think you serialize the full PersistentRepr?
I would highly recommend to serialize the event payload in a separate column and the other meta data from PersistentRepr in separate columns. That gives better ways to inspect the user data since it's not wrapped.

This is a flaw in akka-persistence-jdbc that we intend to change, see akka/akka-persistence-jdbc#318

@mkubala mkubala self-assigned this Sep 4, 2020
@mkubala
Copy link
Collaborator

mkubala commented Sep 4, 2020

Thanks for pointing this out!

Indeed having the meta data available directly on the DB level might make life easier.
Given that you already have to perform old journal migration when start using the plugin this might be a perfect moment to introduce such a change.

@mkubala mkubala added the enhancement New feature or request label Sep 4, 2020
@mkubala mkubala added this to the v0.3.0 milestone Sep 4, 2020
@mkubala
Copy link
Collaborator

mkubala commented Sep 10, 2020

The suggested solution assumes that we will keep each meta data in a separate column.

This is probably the most generic solution, easy to implement on various different RDBMSes, although in terms of further migrations (if further version of Akka-persistence introduces additional meta information, we will have to add yet another column) we decided to leverage another PostgreSQL feature here - support for JSONB column type.

I'm going to add only one additional column which will contains all the metadata and (thanks to the built-in DB functions) still will be accessible at the DB level.

This was referenced Sep 10, 2020
mkubala added a commit that referenced this issue Sep 14, 2020
Extract snapshot metadata into the separate 'metadata' column #91 #95
mkubala added a commit that referenced this issue Oct 4, 2020
…100)

* Introduce migration tool
* Add first migration: extract metadata and unwrap event/snapshot payload
@mkubala mkubala closed this as completed Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants