Hacker News new | ask | show | jobs
by rvnx 659 days ago
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

1 comments

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.