November 2009 Entries

Saga for DSL with NServiceBus

When dealing with processes that can potentially span hours, days and even months going with full ACID transactions is unpractical, because of internal locks. To model such interactions saga pattern is used. Saga breaks the interaction with the system into a series of small transactions and manages the consistency through timeouts and compensations. Saga relaxes Atomicity and Isolation requirements to achieve greater scalability. Service bus frameworks (such as NServiceBus) have saga support out of the box. Most of the frameworks (NServiceBus, MassTransit and Rhino Service Bus) infer which messages saga orchestrates by static analysis of saga types. For example the following is...

posted @ Monday, November 16, 2009 8:38 PM | Feedback (0)

Don’t: open session in view

I’m starting a series of posts “Don’t” about patterns and design decisions I consider bad. Some of them are learned the hard way, through bad judgment and painful experience. While at certain circumstances some of the patterns described can be useful, they are mostly don’t work well in a general case. Open session in view “Open session in view” (OSV) is a web-oriented (anti)pattern that opens ORM session at the beginning of the request and close it when view rendering is done (session is maintained by a servlet filter (Java) or http module (ASP.NET)). Why one might...

posted @ Sunday, November 15, 2009 3:20 AM | Feedback (0)

Going One-way Asynchronous

The alternative way to going Request/Response communication style is one-way asynchronous messaging. While at first this seems much harder, it is much more connected to the way you think of the processes than to technical issues. Once you get used to modeling processes in asynchronous way you will discover that much of the processes happening in the enterprise or around you are naturally asynchronous. Example Let’s analyze something that is easy to touch – project development process itself (well simplified). Let’s model the process of releasing a build for testing in both ways (sync and async). ...

posted @ Tuesday, November 03, 2009 10:23 PM | Feedback (2)