Skip to main content

Architectural evolution of background processing

The architecture of background processing in enterprise applications has changed significantly during the past three decades. As transaction volumes, integration requirements, and user expectations increased, organizations adopted new architectural models to address the scalability limitations of earlier approaches. 

Understanding this evolution helps Lead System Architects make informed design decisions when they build enterprise-scale applications on Pega Infinity™.

Generation 1: Database-centric background processing

Early enterprise systems commonly used relational databases as both systems of record and mechanisms for coordinating background work. 

A typical implementation used the following process: 

  • An application transaction inserts a record into a queue table. 
  • A background process periodically polls the table. 
  • The background process identifies unprocessed records. 
  • The background process runs business logic. 
  • The process updates the status in the database. 

Architectural characteristics 

Database-centric background processing has the following characteristics: 

  • The database acts as both the storage layer and the messaging layer. 
  • Processing relies on continuous polling. 
  • Queue state persists in relational tables. 
  • Timestamps or sequence numbers maintain processing order. 

The following figure shows a database-centric background-processing workflow:

database centric background processing workflow

Limitations of database-centric processing 

As transaction volumes increase, database-centric processing exposes several architectural limitations. Background agents continuously poll the database and consume resources even when no work is available. 

User transactions and background processing also compete for the same database resources, including processor capacity, memory, disk input and output, and locking mechanisms. This competition can create contention under heavy load. Scaling might require larger database servers, additional indexes, and ongoing performance tuning, which increase operational complexity and cost. 

Background agents can process work items only after the next polling cycle begins. This delay increases latency and limits responsiveness. At enterprise scale, the database can become both the messaging layer and the processing bottleneck, which constrains system throughput. 

Generation 2: Broker-based enterprise messaging

To reduce their dependency on databases for messaging workloads, organizations adopted message-oriented middleware (MOM). 

Common messaging products included the following technologies: 

  • IBM MQ, formerly known as MQSeries and WebSphere MQ 
  • TIBCO Enterprise Message Service 
  • Aurea SonicMQ 
  • Apache ActiveMQ 

Java Message Service (JMS) first appeared in 1998. JMS 1.1, released in 2002 as part of the Java 2 Platform, Enterprise Edition ecosystem, provided a unified application programming interface for point-to-point and publish-and-subscribe messaging. 

JMS does not define a messaging product. Instead, JMS defines a standard application programming interface that Java applications use to communicate with different messaging systems. 

With broker-based messaging, applications no longer need to poll database tables directly. The messaging workflow uses the following process: 

  1. Producers send messages to a broker. 
  2. The broker stores and routes the messages. 
  3. Consumers receive and process the messages asynchronously. 

The following figure shows a typical JMS-based messaging workflow: 

JMS based messaging workflow

Benefits of JMS-based messaging 

JMS replaces application-managed database queue polling with broker-mediated messaging. Consumers can receive messages synchronously or through asynchronous message listeners. 

This model promotes loose coupling because producers and consumers can change independently without direct knowledge of each other. JMS providers can also support persistent delivery, acknowledgments, redelivery, and transactional sessions. 

These capabilities improve delivery reliability. However, applications still need appropriate transaction boundaries, retry behavior, and duplicate-handling logic. JMS became a common enterprise integration pattern during the 2000s and supported many service-oriented architectures (SOA) before large-scale distributed-streaming platforms became widely adopted.

Limitations of JMS for modern enterprises

Although JMS solved many database-polling limitations, new challenges emerged as organizations entered the era of cloud computing, real-time analytics, mobile applications, and digital engagement.  The challenges include the following limitations: 

Broker-centric architecture  

Traditional JMS implementations rely on a messaging broker to receive, store, and distribute messages between producers and consumers. As message volumes increase, all messaging traffic passes through this central component. 

Clustering and failover mechanisms improve availability, but the broker can become a scalability and operational bottleneck in high-throughput environments. Scalability, clustering, retention, and parallel-consumption capabilities also vary among providers. 

Limited horizontal scalability 

JMS platforms primarily support reliable enterprise messaging rather than internet-scale event processing. Scaling can require additional broker infrastructure, complex clustering configurations, and careful workload distribution. Messaging infrastructure becomes more difficult to manage as organizations expand across cloud regions and distributed environments. 

Consumer throughput constraints  

JMS queues support reliable message delivery, but they do not inherently support extensive parallel event consumption. High-volume workloads can create backlogs during peak periods and require additional infrastructure and performance tuning to maintain acceptable processing rates. 

Short-term message lifecycle 

In many JMS implementations, the system removes a message from the queue after successful consumption. This model supports transactional processing but provides limited support for event replay, historical analysis, and reprocessing. 

Recovering from downstream processing failures might require persistence mechanisms outside the messaging platform. 

Real-time analytics and event streaming limitations: Enterprises increasingly need to process and analyze continuous event streams rather than deliver only individual messages. The design of traditional JMS platforms does not support the retention and continuous processing of large event streams. 

This requirement created a need for distributed-streaming platforms that support event replay, parallel processing, and large-scale event retention.

Generation 3: Distributed event streaming

As enterprises began processing millions of events across cloud-native and real-time systems, traditional broker-based messaging systems encountered scalability and operational challenges. Distributed-streaming platforms, including Apache Kafka, popularized a retention-based distributed-log model. 

Events remain in partitioned logs according to a retention policy, and consumers track their own positions in those logs. This model supports event replay, and consumers can process the same events independently. 

Distributed streaming platforms divide topics into partitions for parallel processing. Platforms replicate the partitions across nodes for resiliency and retain events for replay and recovery. This architecture supports horizontal scaling, fault tolerance, event replay, real-time analytics, and continuous processing at enterprise scale. 

The following figure shows a typical interaction between Pega Infinity and a Kafka-based Stream service:

kafka based stream service

The transition from agent-based processing to queue processors, Data Flows, and the Stream Service in Pega Infinity aligns with this broader architectural evolution. A distributed-streaming architecture supports high-volume asynchronous processing, reduces dependency on database polling, improves fault tolerance, and distributes background workloads across multiple nodes. 

Comparing the processing models 

The industry did not move from databases to Kafka only to improve performance. Each architectural generation addresses a different processing objective, as summarized in the following table:

Era Primary thinking
Database polling Find and claim work
Broker-based messaging Deliver commands or messages reliably
Distributed event streaming Retain, distribute, and process continuous event streams

The appropriate pattern depends on the workload. Architects evaluate delivery guarantees, replay requirements, ordering, transaction boundaries, throughput, latency, failure recovery, and operational complexity before selecting an approach. 

The evolution from database queues to JMS and distributed streaming is not a sequence in which each technology replaces the previous technology. All three approaches remain relevant for specific architectural requirements.

A Lead System Architect evaluates the following factors before selecting a processing model: 

  • Delivery model 
  • Event-retention and replay requirements 
  • Ordering guarantees 
  • Parallel-processing requirements 
  • Transaction boundaries 
  • Failure-recovery strategies 
  • Expected throughput and latency 
  • Operational complexity 

In Pega Infinity, database-backed processing, integration through messaging platforms, and stream-based capabilities can coexist in one enterprise architecture. Each model serves a different purpose. 

The architectural question is not, "Which technology is newest?" Instead, ask, "Which processing model best aligns with the business, operational, and scalability requirements of the solution?" 

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice