Skip to content

Commit d0a927e

Browse files
authored
add postgresql to "selecting transports" and clarify suitability of SQL brokers (#6854)
* add postgresql to "selecting transports" and clarify suitability of SQL brokers * action todos
1 parent e6eb5e5 commit d0a927e

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

transports/selecting.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Each of the following sections describes the advantages and disadvantages of eac
2525
* [Amazon SQS](#amazon-sqs)
2626
* [RabbitMQ](#rabbitmq)
2727
* [SQL Server](#sql-server)
28+
* [PostgreSQL](#postgresql)
2829
* [MSMQ](#msmq)
2930
* [Learning Transport](#learning)
3031

@@ -109,32 +110,57 @@ Azure Storage Queues has fewer features than Azure Service Bus but can be more c
109110
- When high throughput is not required
110111
- When scale-out is not required. Scaling out requires Azure Service Bus
111112

112-
113-
114113
## SQL Server
115114

116115
The SQL Server transport implements queues using relational database tables. Each row of a queue table holds one message with an ID, headers, and body, plus additional columns for backward compatibility.
117116

118117
### Advantages
119118

120119
- SQL Server is already present in many organizations. This could result in lower licensing and training costs, as well as a reduction in operational risk, since the skills and knowledge required to run SQL Server are already present.
121-
- Mature tooling, such as [SQL Server Management Studio (SSMS)](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms)
120+
- Mature tooling, such as [SQL Server Management Studio (SSMS)](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms) and [Azure Data Studio](https://learn.microsoft.com/en-us/azure-data-studio/download-azure-data-studio)
122121
- Free to start with the [SQL Server Express or Developer editions](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)
123122
- Easy scale-out through competing consumers. Multiple instances of the same endpoint consume messages from a single queue.
124123
- Supports distributed transactions, allowing atomic message processing and data manipulation in database systems which also support distributed transactions (e.g. SQL Server), using the [Microsoft Distributed Transaction Coordinator (MSDTC)](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms684146(v=vs.85))
125124
- Can store both queues and business data in a single backup, making it easier to restore a system to a consistent state
126125

127126
### Disadvantages
128127

129-
- Adds pressure to the server due to polling for new messages
128+
- Adds pressure to the database server due to polling for new messages
130129
- Depending on throughput, can add significant load to an existing SQL Server installation
130+
- Can have significant costs in Production for high throughput systems where extra servers or cores are required to support the load
131+
- Inherently not designed as a messaging broker, which can lead to lower performance and connection limitations when utilized for a larger system with many endpoints.
131132

132133
### When to select this transport
133134

134135
- When it's not possible to introduce a native queueing technology
135-
- When the benefits of introducing a native queueing technology are outweighed by the cost of licensing, training, and ongoing maintenance compared with using an existing SQL Server infrastructure
136+
- When the benefits of introducing a native queueing technology are outweighed by the cost of licensing, training, and ongoing maintenance compared with using existing SQL Server infrastructure
136137
- For integration with a legacy application which uses SQL Server, using [database triggers](/samples/sqltransport/native-integration/)
138+
- When the system has a small number of endpoints, or a medium number of endpoints with low throughput.
139+
140+
## PostgreSQL
141+
142+
Similar to [SQL Server](#sql-server), the PostgreSQL transport implements queues using relational database tables. Each row of a queue table holds one message with an ID, headers, and body.
137143

144+
### Advantages
145+
146+
- PostgreSQL is already present in many organizations, as a relational database that doesn't have the licensing limitations of a commercial solution such as SQL Server or Oracle. This could result in lower licensing and training costs, as well as a reduction in operational risk, since the skills and knowledge required to run PostgreSQL are already present.
147+
- Mature tooling, such as [pgAdmin](https://www.pgadmin.org) and [Azure Data Studio](https://learn.microsoft.com/en-us/azure-data-studio/download-azure-data-studio)
148+
- Easy scale-out through competing consumers. Multiple instances of the same endpoint consume messages from a single queue.
149+
- Can store both queues and business data in a single backup, making it easier to restore a system to a consistent state
150+
151+
### Disadvantages
152+
153+
- Adds pressure to the database server due to polling for new messages
154+
- Depending on throughput, can add significant load to an existing PostgreSQL installation
155+
- Inherently not designed as a messaging broker, which can lead to lower performance and connection limitations when utilized for a larger system with many endpoints.
156+
- PostgreSQL opens a new process for each connection, and therefore has a [default concurrent connection limit of 100](https://postgresqlco.nf/doc/en/param/max_connections/). This limit is overridable, but will use more processes/resources. Having this relatively low connection limit can lead to connection starvation in systems with many [endpoints and/or endpoint instances](/nservicebus/endpoints/)
157+
158+
### When to select this transport
159+
160+
- When it's not possible to introduce a native queueing technology
161+
- When the benefits of introducing a native queueing technology are outweighed by the cost of licensing, training, and ongoing maintenance compared with using existing PostgreSQL infrastructure
162+
- For integration with a legacy application which uses PostgreSQL, using database triggers
163+
- When the system has a small number of endpoints.
138164

139165
## RabbitMQ
140166

0 commit comments

Comments
 (0)