Batch Pattern

Problem

When you create an application function that updates several artifacts and possibly in multiple systems or data sources, how do you group the changes, in order to: monitor, rollback, audit?

Context

Building custom apps, that involve multiple "order" like elements to be updated at the same time. Usually, this would require integration with other systems and putting data into legacy data sources.

Forces

Solution

Use batch as a linking element. The batch usually includes unique code, date/time of a change, user that initiated the change. Optionally, batch will include information about source and target systems, user notes, attributes such as: [support transactions], [batch type], [fail on single error], [attribute 1], [attribute 2] etc

Resulting Context

Rationale

Batches considered old technology and think about attribute of a legacy system. In many cases, we do not need to use batches, since we have technologies like BizTalk and other BPEL bases systems. However, when your process is not close to real-time, there is a need to persist a transaction and what is better way than use batch approach.

Known Uses

ETL solutions would be perfect example of the batches. Another example, is batch processing systems; usually legacy systems that would process data nightly and send error report once a day. Batch admins work on batch level.

Related Patterns

Sketch


Author(s): Dima Semenskyy Date: 02/01/2005


'''References


Keywords: batch


Example

Order processing system

Let's say there is a legacy ERP system and there is a need to create e-commerce solution that will be a front-end of an e-store. During the day orders are collected in the front-end system and pushed into the legacy system during night time.

Let's say the store sells books - paper and electronic downloads.

Business wants to work with paper books and downloads in two different fashions: paper books require to involve shipping department, downloads do not. So, every night front-end will create two types batches: one will contain paper book orders and another one electronic. Single batch will include all orders for a single customer.

ETL system that is responsible for moving orders from front-end web site to legacy ERP system will use batches as following:


EditText of this page (last edited February 2, 2005) or FindPage with title or text search