SOA and the N + 1 Selects Problem
Continue Reading February 17th, 2009 Ben Northrop
Service Oriented Architectures add a new twist to an old problem. Imagine this simple scenario:
You are an architect of an online retailer. Your business owners have laid down the gauntlet. Well, not really…they’ve just added a new requirement: they’d like to see a list of all orders for customers matching some specific criteria (e.g. city, name, registration date, etc.). For example, show me all orders for customers named ‘Holmes’ from ‘Pittsburgh, PA’. Further, this isn’t for a static report, but rather a dynamic screen in their admin UI.
Sounds simple, right? In the old days of integrated applications, it would be – just join the customer and order tables and apply said criteria. Voila!
Ahh…but it’s a brave new world of SOA, and some old tricks no longer apply. In your architecture, instead of one integrated application, you have two loosely coupled services, Customer and Order. Both services are deployed independently and have their own data – i.e. the Customer service has a Customer data store and the Order service an Order store.
The question stands then – how can you answer a business question about customers and orders, given that this data spans across multiple services?