rembrembdocs

Realtime Concepts


Concepts#

There are several concepts and terminology that is useful to understand how Realtime works.

Channels#

Channels are the foundation of Realtime. Think of them as rooms where clients can communicate and listen to events. Channels are identified by a topic name and if they are public or private.

For private channels, you need to use Realtime Authorization to control access to the channel and if they are able to send messages. For public channels, any user can subscribe to the channel, send and receive messages.

You can set your project to use only private channels or both private and public channels in the Realtime Settings.

If you have a private channel and a public channel with the same topic name, Realtime sees them as unique channels and won't send messages between them.

Database resources#

Database connections#

Realtime uses several database connections to perform various operations. You can configure some of these connections through Realtime Settings.

The connections include:

The number of connections varies based on your compute add-on size and configuration. The following table shows the default connection pool sizes for different compute add-on variants:

Compute Add-on

Broadcast from database

Authorization Pool Size

Subscription management

Subscription cleanup

WAL pull

Nano

1

2

2

2

2

Micro

1

2

2

2

2

Small

1

5

4

4

4

Medium

1

5

4

4

4

Large

1

5

4

4

4

XL

1

10

7

7

7

2XL

1

10

7

7

7

4XL

1

10

7

7

7

8XL

1

15

9

9

9

12XL

1

15

9

9

9

16XL

1

15

9

9

9

>16XL

1

15

9

9

9

You can customize Authorization Pool Size through the Database connection pool size parameter in your Realtime configuration. If not specified, the default values shown in the table will be used.

Replication slots#

Realtime also uses, at maximum, 2 replication slots.

Schema and tables#

The realtime schema creates the following tables:

Realtime has a cleanup process that will delete tables older than 3 days.

Functions#

Realtime creates two functions on your database: