Softwr

Databases · head to head

PgBouncer vs PubNub

PgBouncer logo

PgBouncer

Databases

Lightweight open-source connection pooler for PostgreSQL

From
Free
Free plan
Yes
PubNub logo

PubNub

APIs

Realtime communication platform for chat, IoT, and live data apps

From
Free
Free plan
Yes

The short version

  • PgBouncer is an open-source connection pooler.
  • PgBouncer is free; PubNub starts at $98/mo.
  • Only PgBouncer lists session pooling; only PubNub lists pub/sub messaging.
  • Where PgBouncer falls short: works with PostgreSQL only; it cannot pool connections for other database engines.
  • Where PubNub falls short: free plan storage history is limited to 7 days, which is short for apps needing longer message retention.

How do PgBouncer and PubNub differ?

PgBouncer and PubNub differ on pricing model (Open-source against Freemium), platforms and category (Databases against APIs). Only the attributes on which PgBouncer and PubNub actually diverge.

Attributes where PgBouncer and PubNub differ
AttributePgBouncerPubNub
Pricing modelOpen-sourceFreemium
PlatformsLinux, macOS, WindowsWeb, iOS, Android, API
CategoryDatabasesAPIs

Identical on both: starting price (Free), free tier (Yes).

Not yet recorded: founded for PgBouncer.

Which features does each one have?

They share no listed features; 9 appear only for PgBouncer and 6 only for PubNub. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in PgBouncer

  • Session pooling
  • Transaction pooling
  • Statement pooling
  • Low memory use per connection
  • Online reconfiguration of most settings
  • Online restart and upgrade without dropping clients
  • Backends on different hosts
  • TLS support via OpenSSL

Only in PubNub

  • Pub/sub messaging
  • Presence tracking
  • Message persistence
  • Serverless Functions
  • File sharing
  • Encryption and access controls

What is each one used for?

PgBouncer is most often brought in for reducing open connections to a busy PostgreSQL server; PubNub for building realtime chat applications. The jobs each tool is most often brought in to do.

PgBouncer

  • Reducing open connections to a busy PostgreSQL servernot PubNub
  • Pooling connections from serverless or short-lived application processesnot PubNub
  • Fronting databases spread across several hostsnot PubNub
  • Rolling upgrades without dropping client connectionsnot PubNub

PubNub

  • Building realtime chat applicationsnot PgBouncer
  • Streaming live IoT sensor datanot PgBouncer
  • Adding presence indicators to collaborative appsnot PgBouncer
  • Running edge logic with serverless Functions on realtime eventsnot PgBouncer

Where do PgBouncer and PubNub fall short?

PgBouncer's most cited limit: works with PostgreSQL only; it cannot pool connections for other database engines. PubNub's: free plan storage history is limited to 7 days, which is short for apps needing longer message retention. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

PgBouncer

  • Works with PostgreSQL only; it cannot pool connections for other database engines
  • Transaction pooling disables session features such as LISTEN, SET/RESET and session-level advisory locks
  • Windows support is limited to MinGW builds; Cygwin and Visual toolchains are not supported
  • Configured through files and an admin console, with no built-in graphical interface
  • Does not provide failover, replication management or read-replica load balancing

PubNub

  • Free plan storage history is limited to 7 days, which is short for apps needing longer message retention
  • MAU-based pricing means costs scale directly with user growth, which can be less predictable than flat message-based pricing
  • Pro-tier custom pricing above 50,000 MAU requires contacting sales rather than self-serve checkout

How much do PgBouncer and PubNub cost?

PgBouncer is free to use; PubNub has a free plan, with paid plans from $98/mo. Plan by plan below, from each vendor's own pricing page.

PgBouncer

Free

No published plan breakdown. See the PgBouncer review.

PubNub

Free
  • FreeFree
    • Up to 200 MAU or 1M transactions
    • 1GB data storage (7 days)
    • 5 test Serverless Functions
  • Starter$98/mo
    • 1,000 MAU included
    • User management
    • Insights
  • ProOn request
    • Custom MAU packages
    • Volume discounts
    • Enterprise-scale configurations

Which should you pick?

Choose PgBouncer if

  • You need session pooling.
  • You want to start without paying.
  • You work on Linux, macOS, Windows.
  • You also want transaction pooling.

Choose PubNub if

  • You need pub/sub messaging.
  • You want to start without paying.
  • You work on Web, iOS, Android, API.
  • You also want presence tracking.

Questions people ask

Is PgBouncer or PubNub better?
It depends on the job. PgBouncer fits reducing open connections to a busy PostgreSQL server; PubNub fits building realtime chat applications. PgBouncer starts at Free and PubNub at Free.
Which is cheaper, PgBouncer or PubNub?
PgBouncer starts at Free and PubNub at Free.
Does PgBouncer or PubNub run on more platforms?
PgBouncer runs on Linux, macOS, Windows. PubNub runs on Web, iOS, Android, API.
Can I use PgBouncer for free?
Both have a free tier, so you can try either at no cost before committing.
What is PgBouncer best used for?
PgBouncer is most often used for reducing open connections to a busy postgresql server, pooling connections from serverless or short-lived application processes, fronting databases spread across several hosts, rolling upgrades without dropping client connections. Of those, reducing open connections to a busy postgresql server and pooling connections from serverless or short-lived application processes are not what PubNub is typically brought in for.
What can PgBouncer do that PubNub cannot?
PgBouncer covers Session pooling, Transaction pooling, Statement pooling, Low memory use per connection. PubNub covers Pub/sub messaging, Presence tracking, Message persistence, Serverless Functions.

Answered from the vendors’ own pages

PgBouncer: What is PgBouncer used for?

PgBouncer is a lightweight connection pooler for PostgreSQL. It lets many client connections share fewer server connections, which lowers the load of holding many connections open.

Source
PubNub: What does PubNub cost?

PubNub offers a free plan for up to 200 MAU or 1 million transactions, a Starter plan at $98/month for 1,000 MAU, and custom Pro pricing for larger volumes, e.g. around $550/month for 10,000 MAU.

Source
PgBouncer: What pooling modes does PgBouncer support?

It supports session, transaction and statement pooling. Session pooling supports all PostgreSQL features, while transaction and statement pooling restrict some session-based features.

Source
PubNub: Is there a free plan, and what are its limits?

Yes, the free plan supports up to 200 monthly active users or 1 million transactions, includes 1GB of data storage retained for 7 days, and requires no credit card.

Source
PgBouncer: Does PgBouncer run on Windows?

The project's build instructions support Windows only through MinGW. It states that Cygwin and Visual toolchains are not supported, and that LDAP is not supported on Windows.

Source
PubNub: How is usage metered?

PubNub bills primarily by Monthly Active Users, defined as a unique user who connects at least once in a billing cycle; messages are bundled into MAU pricing with no separate per-message fees, and overage is billed proportionally.

Source
PgBouncer: What do I need to build PgBouncer from source?

The README lists a C11-capable compiler, Libevent 2.0 or newer, pkg-config and, for TLS, OpenSSL 1.0.1 or newer. Optional components include c-ares, LDAP libraries and PAM libraries.

Source
Share

Related pages

Other head to heads