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

Use UUID as primary key instead of autoincrement integer #1

Open
micha opened this issue Mar 1, 2019 · 0 comments
Open

Use UUID as primary key instead of autoincrement integer #1

micha opened this issue Mar 1, 2019 · 0 comments

Comments

@micha
Copy link
Contributor

micha commented Mar 1, 2019

Currently there is a daily cron job to reset the serial for the primary key to 1 to prevent overflow, but the correct solution is probably to use a UUID, instead.

Note that the worst case situation with the cron job hack in place is when there is already a PK of 1 in the database (extremely unlikely given the volume of records we're writing to Kinesis). In this case when a new file is ingested the unique constraint on the primary key column will be violated and the file will fail to be ingested. This is only a temporary issue as files are ingested transactionally (ie. this won't result in duplicated writes to Kinesis) and ingestion will proceed on another worker instance or when the records in the database with conflicting primary keys have all been processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant