https://github.com/omnistrate-oss/serverless-proxy
Lightweight serverless proxy forwarding traffic
https://github.com/omnistrate-oss/serverless-proxy
saas saas-boilerplate serverless
Last synced: 2 months ago
JSON representation
Lightweight serverless proxy forwarding traffic
- Host: GitHub
- URL: https://github.com/omnistrate-oss/serverless-proxy
- Owner: omnistrate-oss
- License: apache-2.0
- Created: 2023-08-09T17:15:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-02T17:11:03.000Z (3 months ago)
- Last Synced: 2026-01-09T03:19:18.265Z (3 months ago)
- Topics: saas, saas-boilerplate, serverless
- Language: Go
- Homepage: https://omnistrate.com/
- Size: 155 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Omnistrate Postgres Proxy Example
This is a simple example to show how to leverage postgres proxy with Omnistrate platform to build serverless product.
## Build Example Proxy Docker Image
- Generic proxy example
```
make docker-build-generic
```
- MySQL proxy example
```
make docker-build-generic
```
- Postgres proxy example
```
make docker-build-generic
```
## Setup Simple Postgres Serverless With Omnistrate
Pre-requisite:
Please follow https://github.com/omnistrate-oss/account-setup to setup AWS bootstrap account/role
**Step 1: Import Service Definition From Docker Compose**
Sample docker compose file exist in /dockercompose/postgres_demo.yaml folder
You can import the docker image using the UI using the **Import docker compose** option

The docker compose example uses two images:
- docker.io/njnjyyh/pg-proxy-demo:1 <- postgres image with prometheus metrics exporter (https://github.com/prometheus-community/postgres_exporter)
- docker.io/njnjyyh/pg-proxy-demo:2.0 <- proxy image built from this repo
Setup Service Name to **Postgres Serverless**. Using this name is important as the following commands will reference the service with this name.
**Step 2: Setup Postgres Instance**
In Omnistrate console access page, provision a Postgres instance
**Step 3: Access Postgres instance**
Once Postgres instance is up and running, check the connectivity from access page and get the endpoint/port for connection. Note that the endpoint shown in the page is pointing to the proxy and not directly to the provisioned instance.
Note that if the instance is not used for some time it will be stopped automatically.
```
psql -U postgres -W -h postgres -p
```
The default password for the demo is **postgres**
Once we attempt to start the connection the instance will be automatically started, it will take a few minutes for the server to start and then you can operate on the open connection.
While the connection is open the instance will be Running and after the connection is close the instance will be Stopped automatically. Auto stop in this example relies on prometheus metrics pg_stat_database_num_backends. If you want to use other metrics, please update docker compose.