Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
For simple business processes you probably can get away with direct database access. This is especially true of "read-only" kinds of processes. For your more complex procedures I'd look into implementing a message queuing system. Clients would simply add their requests to a queue that gets processed either periodically or on demand by other servers/threads/agents.

The advantages of this approach are:

  • It's a simple architecture. You don't have to write robust, long running daemons.
  • You can take down part of the request processing system for updates or maintenance without losing the ability to submit new requests.
  • It is easy to accommodate procedures that must be handled serially as well as those that can be handled in parallel - just decide on how many worker threads can handle each type of request.
  • The queue can also serve as a log of the changes made to the system which can be helpful.
  • This is especially beneficial when the request can take a long time. In this case the client gets an immediate confirmation that the request has been queued up and can check back periodically to see if it's been acted on.
There are disadvantages to this approach too, such as not getting an immediate response to your request. But it's a trade-off. In return you get more control over how your processes are executed, and you can always poll to see what the result of your request is.

In reply to Re: Multi-client approaches by pc88mxer
in thread Multi-client approaches by Tanktalus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-18 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found