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

Migrate DB to Postgres #388

Closed
9 of 13 tasks
dchoi27 opened this issue Aug 23, 2021 · 5 comments
Closed
9 of 13 tasks

Migrate DB to Postgres #388

dchoi27 opened this issue Aug 23, 2021 · 5 comments
Labels
Epic kind/enhancement A net-new feature or improvement to an existing feature P0 Critical: Tackled by core team ASAP reliability-performance-sprint

Comments

@dchoi27
Copy link
Contributor

dchoi27 commented Aug 23, 2021

We're already getting a consistent number of operational problems from using FaunaDB for Web3.Stoarge, which doesn't bode well at the current scale. This issue tracks the things we need to do to migrate to Postgres, which we (and most others) engineers know better and will likely be more reliable.

Plan

@dchoi27 dchoi27 added kind/enhancement A net-new feature or improvement to an existing feature P0 Critical: Tackled by core team ASAP Epic reliability-performance-sprint labels Aug 23, 2021
@Gozala
Copy link
Contributor

Gozala commented Sep 2, 2021

@olizilla
Copy link
Contributor

olizilla commented Sep 7, 2021

To add some more nuance here, I see the migration going like this:

  • Define the database schema in SQL #439
  • Rewire API endpoints to use Postgres #441
  • Add a read-only mode to the api and visualise it in the website (unfortunate, but is a useful thing to have for now and any future major maintenance). Existing users can query for existing uploads, and requests go to Fauna. Add a read-only mode for maintenance #452
  • Sync fauna data to postgres from a known point in time in the background (we need to investigate how long that takes, and what errors we could hit) this is captured in Migrate data from fauna to Postgres #440, but we need to add more detail.
  • Enable read-only mode and sync the diff between what we have in postgres and that moment.
  • Verify (need to define how) that the data in postgres is complete and accurate, and then flip the switches so reads and writes go to postgres, and disable read-only mode.
  • Celebrate?!

@vasco-santos
Copy link
Contributor

vasco-santos commented Oct 20, 2021

Testing Plan for DB migration validation:

  1. Website
  • Register -> logout -> login Flow with email
  • Register -> logout -> login Flow with github
  • Login with user previously registered
  • Create two auth keys
  • Delete an auth key previously created and see if deleted is set
  • Upload a small file and confirm used storage increase
  • Re-upload the same file twice and confirm used storage does not increase
  • Rename upload
  • Confirm upload list has expected content
  • Upload a large file (partials) and confirm used storage increase
  • Delete a file and confirm it does not appear in file listing
  • Upload file previously deleted
  1. W3
  • Fail to upload CAR with a deleted auth key
  • Fail to upload file with a deleted auth key
  • Upload CAR with a valid auth key
  • Upload file with a valid auth key
  • Upload CAR/file with a custom name
  • List uploaded files
  • Get status for uploaded files and confirm content expectations
  1. Test Deals

@rafaelramalho19
Copy link
Contributor

rafaelramalho19 commented Oct 25, 2021

Staging sucessfully tested:

  • Fail to upload CAR with a deleted auth key
  • Fail to upload file with a deleted auth key
  • Fail to list uploaded files with a deleted auth key
  • Upload CAR with a valid auth key
  • Upload file with a valid auth key
  • Upload CAR/file with a custom name
  • List uploaded files
  • Get status for uploaded files and confirm content expectations

(Listing with deleted auth key could have a better error)

@atopal
Copy link
Contributor

atopal commented Nov 24, 2021

Looks like we can close this :)

@atopal atopal closed this as completed Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic kind/enhancement A net-new feature or improvement to an existing feature P0 Critical: Tackled by core team ASAP reliability-performance-sprint
Projects
None yet
Development

No branches or pull requests

6 participants