Simple Serverless Postgres compatible database with easy webhooks

Viewed 10

I'm looking for a simple serverless Postgres compatible databsae with easy to configure webhooks that can get called whenever a new record is inserted into a table. The webhooks just need to call a REST API I have running as a serverless function on DigitalOcean. Give me lots of options, including easy services both inside and outside AWS, Azure, and Google Cloud.

2 Answers

When looking for a serverless Postgres-compatible database that supports easy-to-configure webhooks, especially for triggering calls to a REST API upon new record insertion, several options are available both within major cloud providers (AWS, Azure, Google Cloud) and outside of them. Here are a few recommendations, categorized by provider:

AWS (Amazon Web Services)

  1. Amazon Aurora Serverless with PostgreSQL compatibility:

    • Webhook Configuration: Use AWS Lambda triggers that respond to events in Aurora.
    • Setup:
      • Enable Aurora to stream changes to AWS Lambda.
      • Configure a Lambda function to invoke your DigitalOcean serverless function.
    • Benefits: Fully managed, scales automatically, integrates well with other AWS services.
  2. Amazon RDS for PostgreSQL:

    • Webhook-like behavior: Utilize AWS Lambda in conjunction with Amazon EventBridge.
    • Setup:
      • Set up database triggers that publish messages to an SQS queue, which then invokes a Lambda function.
      • The Lambda function can call your REST API.
    • Benefits: Fully managed PostgreSQL with serverless-like options for event-driven architecture.

Azure (Microsoft Azure)

  1. Azure Database for PostgreSQL – Flexible Server:

    • Webhook Configuration: Azure Functions or Azure Logic Apps can be used to create HTTP-triggered endpoints.
    • Setup:
      • Create PostgreSQL triggers to send data to Azure Event Grid, which can route events to an Azure Function.
      • The Azure Function makes HTTP calls to your DigitalOcean service.
    • Benefits: Strong integration with other Azure services, easy to set up event-driven architectures.
  2. Azure SQL Database with PostgreSQL compatibility (for hybrid scenarios):

    • Webhook-like behavior: Use Change Data Capture (CDC) to detect changes and Azure Functions to respond.
    • Setup:
      • Enable CDC on your database.
      • Use an Azure Function to monitor changes and trigger HTTP calls.
    • Benefits: Integrates well within the Azure ecosystem.

Google Cloud Platform (GCP)

  1. Cloud SQL for PostgreSQL:
    • Webhook Configuration: Utilize Pub/Sub and Cloud Functions.
    • Setup:
      • Create a PostgreSQL trigger that publishes messages to a Pub/Sub topic.
      • Configure a Cloud Function to respond to Pub/Sub messages, making the necessary HTTP requests.
    • Benefits: Fully managed database service with robust scaling and integration options.

Outside Major Cloud Providers

  1. Supabase:

    • Webhook Configuration: Direct support for database triggers and functions.
    • Setup:
      • Directly use PostgreSQL triggers to call Supabase Edge Functions, which can send HTTP requests.
    • Benefits: Open-source, real-time database capabilities, simple and developer-friendly.
  2. Heroku Postgres:

    • Webhook Configuration: Use Heroku Add-ons like "webhookz" or custom Lambda functions.
    • Setup:
      • Set up PostgreSQL triggers and connect them to webhook services or use Heroku platform API.
    • Benefits: Easy deployment, integrates with the Heroku ecosystem.
  3. Aiven for PostgreSQL:

    • Webhook Configuration: Use PostgreSQL’s native logical decoding along with external webhook calling services.
    • Setup:
      • Implement logical replication and stream changes to a custom service that processes and sends HTTP requests.
    • Benefits: Managed service, multi-cloud support including AWS, GCP, and Azure.
  4. Fly.io with PostgreSQL:

    • Webhook Configuration: Combine Fly.io's PostgreSQL hosting with their edge computing features.
    • Setup:
      • Use application-level listeners or dedicated webhook services to respond to insert events.
    • Benefits: Edge computing capabilities, developer-friendly platform.

Summary

Your choice will depend on your existing infrastructure, specific requirements, and preferences for cloud services. If ease of use and native support for event-driven architectures are critical, leveraging the built-in features of major cloud providers or using a developer-friendly platform like Supabase can be very effective. For those with specific preferences for multi-cloud or independent providers, services like Aiven or Fly.io offer flexible and robust options.

You're looking for a simple, serverless Postgres-compatible database with easy-to-configure webhooks that can notify your REST API running as a serverless function on DigitalOcean whenever a new record is inserted into a table. Here are some options, including services from inside and outside AWS, Azure, and Google Cloud:

1. AWS Aurora Serverless

  • Compatible with Postgres
  • Serverless, so you only pay for what you use
  • Webhooks are available for Aurora Serverless via Amazon EventBridge
  • Triggered by inserts, updates, and deletes
  • Supports API Gateway and Lambda functions for integration with your DigitalOcean API

2. Google Cloud SQL (PostgreSQL)

  • Supports Postgres 10 and 11
  • Serverless, with a free tier available
  • Webhooks are available via Cloud Pub/Sub
  • Triggered by inserts, updates, and deletes
  • Integrates with Cloud Functions and Cloud Run for API integrations

3. Microsoft Azure Database for PostgreSQL

  • Supports Postgres 11 and 12
  • Serverless, with a free tier available
  • Webhooks are available via Azure Event Grid
  • Triggered by inserts, updates, and deletes
  • Integrates with Azure Functions and Azure API Management for API integrations

4. CockroachDB

  • A cloud-native, serverless Postgres-compatible database
  • Supports Postgres 10 and 11
  • Webhooks are available via CockroachDB's built-in webhooks
  • Triggered by inserts, updates, and deletes
  • Integrates with Cloud Functions and API Gateway for API integrations

5. Heroku Postgres

  • Supports Postgres 10 and 11
  • Serverless, with a free tier available
  • Webhooks are available via Heroku's built-in webhooks
  • Triggered by inserts, updates, and deletes
  • Integrates with Heroku's serverless platform and API Gateway for API integrations

6. Enterprisetalk's PostgreSQL Serverless

  • A serverless Postgres-compatible database
  • Supports Postgres 10 and 11
  • Webhooks are available via Enterprisetalk's built-in webhooks
  • Triggered by inserts, updates, and deletes
  • Integrates with AWS Lambda and API Gateway for API integrations

7. RDS for PostgreSQL (AWS)

  • Supports Postgres 10 and 11
  • Serverless, with a free tier available
  • Webhooks are available via AWS EventBridge
  • Triggered by inserts, updates, and deletes
  • Integrates with AWS Lambda and API Gateway for API integrations ( Note: not entirely serverless, as you need to provision an RDS instance)

8. pgCloud

  • A cloud-native, serverless Postgres-compatible database
  • Supports Postgres 10 and 11
  • Webhooks are available via pgCloud's built-in webhooks
  • Triggered by inserts, updates, and deletes
  • Integrates with AWS Lambda and API Gateway for API integrations

9. Firebolt

  • A cloud-native, serverless Postgres-compatible database
  • Supports Postgres 10 and 11
  • Webhooks are available via Firebolt's built-in webhooks
  • Triggered by inserts, updates, and deletes
  • Integrates with AWS Lambda and API Gateway for API integrations

10. Azure Database Migration Service

  • Supports Postgres 10 and 11
  • Serverless, with a free tier available
  • Webhooks are available via Azure Event Grid
  • Triggered by inserts, updates, and deletes
  • Integrates with Azure Functions and Azure API Management for API integrations

All of these options should provide a simple, serverless Postgres-compatible database with easy-to-configure webhooks that can notify your REST API running on DigitalOcean whenever a new record is inserted into a table. Choose the one that best fits your needs!