Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The phrase <em>beats every time</em> totally depends on what your requirements were to begin with. Certainly its not going to beat every time for everyone.</p> <p>If you are building a single system which is already using a database, you don't have very high performance throughput requirements and you don't have to communicate with any other teams or systems then you're probably right.</p> <p>For simple, low thoughput, mostly single threaded stuff, database are a totally fine alternative to message queues.</p> <p>Where a message queue shines is when</p> <ul> <li>you want a high performance, highly concurrent and scalable load balancer so you can process tens of thousands of messages per second concurrently across many servers/processes (using a database table you'd be lucky to process a few hundred a second and processing with multiple threads is pretty hard as one process will tend to lock the message queue table)</li> <li>you need to communicate between different systems using different databases (so don't have to hand out write access to your systems database to other folks in different teams etc)</li> </ul> <p>For simple systems with a single database, team and fairly modest performance requirements - sure use a database. Use the right tool for the job etc.</p> <p>However where message queues shine is in large organisations where there are lots of systems that need to communicate with each other (and so you don't want a business database to be a central point of failure or place of version hell) or when you have high performance requirements.</p> <p>In terms of performance a message queue will always beat a database table - as message queues are specifically designed for the job and don't rely on pessimistic table locks (which are required for a database implementation of a queue - to do the load balancing) and <a href="http://activemq.apache.org/what-is-the-prefetch-limit-for.html" rel="noreferrer">good message queues will perform eager loading of messages to queues to avoid the network overhead of a database</a>.</p> <p>Similarly - you'd never use a database to do load balancing of HTTP requests across your web servers - as it'd be too slow - if you have high performance requirements for your load balancer you'd not use a database either.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload