Migrating Heroku Database Apps to Fly
The text discusses the process of migrating an application from Heroku to Fly while handling database connections. It explains how to access a Heroku database from outside Heroku using the DATABASE_URL, which contains all necessary credentials for connecting to the Postgres database. To connect to Heroku Postgres from outside Heroku, SSL must be enabled and the sslmode set to require with rejectUnauthorized set to false. The text also provides sample code demonstrating how to handle these connections in a Node.js application using Massivejs and pg-connection-string packages. Finally, it explains how to push the app to Fly after migrating from Heroku and highlights some performance considerations when working with databases across different regions.
Company
Fly.io
Date published
Sept. 25, 2020
Author(s)
Dj Walker-Morgan
Word count
988
Hacker News points
None found.
Language
English