views:

167

answers:

3

Suppose you have a web site consisting of:

  • A web server serving your various users requests
  • A DB for persistence
  • A separate server asynchronously doing background stuff - preparing the data on the DB, updating it according to changes, etc. - regardless of what's going on in the main server.

You can easily translate this into another world and talk about threads for example - i.e. having one thread preparing the data asynchronously for a main thread which is running.

Is there a name for this pattern, if it is a pattern at all?

Are there any pros/cons for this method of processing data in terms of performance?


Let me just clarify that I'm asking specifically about the second web server doing background processing, and not the whole architecture.

+2  A: 

I don't have a pattern name for you (not to say there isn't one), but what you have here is an optimization to keep your main thread from responding slowly to requests. It doesn't have to calculate data, it just has to provide it.

This is similar to UI coding. You don't do any work on your UI thread, you just draw. Other threads should be responsible for figuring everything else out, so your UI is responsive.

Eric Anderson
+3  A: 

Everything has patterns. If you've seen it more than twice, there's a pattern.

You've got three examples of Client-Server.

You've got Browser-Web Server.

You've got web server in the role of DB Client talking to DB Server.

You've got web server in the role of App server client talking to an App Server.

Sometimes folks like to call this N-Tier since there are at three tiers of Browser-Web Server-DB Server, plus an additional application server tier.

Some folks expand this into the Services Bus concept. Your web server uses DB server and application server.

The Asynchronous Back-End and Back-end Server are names I've heard to describe your application server architecture.

S.Lott
A: 

I don't know if it's officially a pattern name but this looks almost like batch processing from the mainframe days.

Jeff Hornby