Need some hosting advice

I'm working on a project which has it's front-end and backend hosted on CF Pages / Workers, and I also use the CF KV out of convenience.

Sadly I can't use D1 for my project, so I'm forced to host some external postgres DB on a VPS and communicate to it from workers.

What would be the most secure and reliable way to communicate between my CF Workers and my postgres DB?

Using a simple username + password connection string seems simple, but that opens possibility for brute-force attacks. And I'm not sure what types of firewall rule's I'd need to apply because CloudFlare would probably request the database from several different IP addresses.
Was this page helpful?