2 ms·
Hi HN! We wrote this CLI to explore migrating from Firebase to Postgres as easily as possible. We use Hasura[1] to generate the realtime GraphQL API on Postgre
by tango12 8y ago
Hi HN!
We wrote this CLI to explore migrating from Firebase to Postgres as easily as possible.
We use Hasura[1] to generate the realtime GraphQL API on Postgres automatically. The CLI tool's work then mostly boils down to 2 things, which we do in phases:
1. Phase I: We migrate firebase data nodes to Postgres tables in a fairly naive way. We setup automatic IDs and parent-child tables and set up relationships between the tables. This gives you a write-many type GraphQL API on postgres. Realtime GraphQL with subscriptions and live-queries replaces firebase realtime
2. Phase II: As an optional next step, we try to normalise data by detecting overlapping data between tables. We delete "subset" tables and set up relationships to the superset table.
I've written up a blogpost with more details here: https://blog.hasura.io/firebase2graphql-moving-from-firebase-to-realtime-graphql-on-postgres-4d36cb7f4eaf https://blog.hasura.io/firebase2graphql-moving-from-firebase...
[1] https://github.com/hasura/graphql-engine https://github.com/hasura/graphql-engine , https://hasura.io https://hasura.io