📡
Soketi
1.x
1.x
  • 📡soketi
  • 🏆Benchmarks
  • 🎉Support
  • 🤝Contributing
  • 📼Video Courses
  • 😢Known Limitations
  • Getting started
    • ⬆️Upgrading from 0.x
    • 🚀Installation
      • CLI Installation
      • Docker
      • Helm Charts
      • Laravel Sail (Docker)
    • 💿Configuring the server
    • 🔐SSL Configuration
    • 🎨Client Configuration
      • Pusher SDK
      • Laravel Echo
    • 💻Backend Configuration
      • Pusher SDK
      • Laravel Broadcasting
      • Nginx Configuration
    • 🧠Redis Configuration
  • App Management
    • 🎟️Introduction
    • 🧬Array Driver
    • 🛢️SQL Drivers
      • 🐬MySQL
      • 🐘PostgreSQL
      • ⛲Database Pooling
    • 👾DynamoDB
  • Rate Limiting & Limits
    • ⛔Broadcast Rate Limiting
    • 👥Events & Channels Limits
  • Advanced Usage
    • ↔️Horizontal Scaling
      • 🤖Running Modes
      • 🧠Redis Configuration
      • 🧙‍♂️🧙♂ 🧙♂ 🧙♂ NATS Configuration
      • 🗃️Private Network Configuration
      • 😑Ok, what to choose?
    • 🛑Graceful Shutdowns & Real-time monitoring
    • 📈Prometheus Metrics
    • 🔗HTTP Webhooks
      • 📐AWS Lambda trigger
    • 🕛Queues
      • ⛓️AWS SQS FIFO
      • 🧠Redis
    • 📝Caching
    • ⚛️User Authentication
    • 🤾Enhancing Performance
      • 🔀New traffic redirection
  • Network Watcher
    • 🚀Installation
    • 💿Environment Variables
Powered by GitBook
On this page
  • Environment Variables
  • Limits on an app-by-app basis

Was this helpful?

Edit on GitHub
  1. App Management
  2. SQL Drivers

PostgreSQL

PreviousMySQLNextDatabase Pooling

Last updated 2 years ago

Was this helpful?

When using the PostgreSQL app driver, first configure your PostgreSQL connection credentials using :

Name
Default
Possible values
Description

SOKETI_DB_POSTGRES_HOST

127.0.0.1

Any string

The PostgreSQL host.

SOKETI_DB_POSTGRES_PORT

3306

Any integer

The PostgreSQL port.

SOKETI_DB_POSTGRES_USERNAME

root

Any string

The PostgreSQL username.

SOKETI_DB_POSTGRES_PASSWORD

password

Any string

The PostgreSQL password.

SOKETI_DB_POSTGRES_DATABASE

main

Any string

The PostgreSQL database.

This database supports .

Once you have configured your PostgreSQL database credentials, you should create a table with the following structure:

CREATE TABLE IF NOT EXISTS apps (
    id varchar(255) PRIMARY KEY,
    "key" varchar(255) NOT NULL,
    secret varchar(255) NOT NULL,
    max_connections integer NOT NULL,
    enable_client_messages smallint NOT NULL,
    "enabled" smallint NOT NULL,
    max_backend_events_per_sec integer NOT NULL,
    max_client_events_per_sec integer NOT NULL,
    max_read_req_per_sec integer NOT NULL,
    max_presence_members_per_channel integer DEFAULT NULL,
    max_presence_member_size_in_kb integer DEFAULT NULL,
    max_channel_name_length integer DEFAULT NULL,
    max_event_channels_at_once integer DEFAULT NULL,
    max_event_name_length integer DEFAULT NULL,
    max_event_payload_in_kb integer DEFAULT NULL,
    max_event_batch_size integer DEFAULT NULL,
    webhooks json,
    enable_user_authentication smallint NOT NULL
);

Environment Variables

The following environment variables are used to define the behavior of the PostgreSQL app driver:

Name
Default
Possible values
Description

SOKETI_APP_MANAGER_POSTGRES_TABLE

apps

Any string

The table to pull the app data from.

SOKETI_APP_MANAGER_POSTGRES_VERSION

13.3

Any string

The PostgreSQL version (utilized by the underlying Knex database abstraction layer).

Limits on an app-by-app basis

To enforce app-level limits in PostgreSQL, there are multiple fields:

max_presence_members_per_channel integer DEFAULT NULL,
max_presence_member_size_in_kb integer DEFAULT NULL,
max_channel_name_length integer DEFAULT NULL,
max_event_channels_at_once integer DEFAULT NULL,
max_event_name_length integer DEFAULT NULL,
max_event_payload_in_kb integer DEFAULT NULL,
max_event_batch_size integer DEFAULT NULL

Setting any of them to null or '' will ignore the setting, and use the limits associated .

🛢️
🐘
environment variables
database connection pooling
with the server-level declared defaults