Hacker News new | ask | show | jobs
by nullorempty 660 days ago
How do you support local development?
2 comments

Conceptually Fortress (if I understood it right) is like if you have a variable postgres_hosts looking like this:

    postgres_hosts['local'] = {host: localhost, user: 'abcd', password: DECRYPT_AES('defh'), dbname: 'base'}
    postgres_hosts['customer1'] = {host: prod1, user: 'saas_panel', password: DECRYPT_AES('pwdpanel'), dbname: 'base'}
    postgres_hosts['customer2'] = {host: prod2, user: 'saas_panel', password: DECRYPT_AES('pwdpanel'), dbname: 'base'}

    postgres_connection = connect(postgres_hosts[customer_id])

What Fortress does is maintaining that list of hosts for you:

    postgres_hosts = fetch('http://api.fortress.../{api_key}/postgres_hosts')
When you want to create a new customer in your system, you call fortress.create_tenant, and from their backend they will use your GCP/AWS credentials to create a new host and add it to the list (correct me if I'm wrong)

So in theory you could have only 'local' as a host in your .env.development file, and enable Fortress for production mode

Exactly! That is a high level of what is happening in the background, but in the foreground, all you have to do is reference the tenant's ID. We also manage key rotations and other nitty gritties to secure your databases.
We don't currently support local database development, but we are working on making that possible!