DEV Community

Josua Schmid
Josua Schmid

Posted on

2

8KB limit of Postgres NOTIFY

You can setup Rails ActionCable to use Postgres instead of Redis by adjusting the adapter configuration:

# config/cable.yml

production:
  adapter: postgresql
  url: <%= ENV["DATABASE_URL"] %>
  channel_prefix: myapp_production
Enter fullscreen mode Exit fullscreen mode

This uses the Postgres LISTEN and NOTIFY commands.

As of writing, the NOTIFY payload is limited to 8000 bytes per default. If you're using Hotwire this may not always be enough and you will see error messages like this

PG::InvalidParameterValue (ERROR:  payload string too long)
Enter fullscreen mode Exit fullscreen mode

The solutions available to you are the following:

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more