Introduction:
A web service for the cloud must be well suited for the
business purpose its serves not only in its functionality but also in the
non-functional aspects which are recorded in the Service-Level Agreements. The
choice of architecture for a web service has a significant contribution to this
effect. We review the choices between Web-Queue architectural style and the
N-Service architectural style.
The web-queue can absorb the latencies from the events
and user actions are translated to events. It decouples the frontend and the
API layer so that they become more responsive to the users. All the actions
taken by the user can be mapped to one or other form of messages that are sent
to the message queue which is usually the service bus. The Web Queue can handle
plenty of messages and can even scale out to catch up with the items in the
queue. Each message is handled by a different handler and there is one-to-one
mapping which makes it easy to view.
Some of the benefits of this architecture include the
following: 1) It is relatively simple architecture that is easy to
understand.2) It is Easy to deploy and manage. 3) There is a clear separation
of concerns. 4) The front end is decoupled from the worker using asynchronous
messaging and 5) the front end and the worker can be scaled independently.
Some of the challenges faced with this architecture
include the following: The front end and the worker can both become arbitrarily
large, monolithic components which increase the maintenance costs. It may also
hide dependencies, if the front end and worker share data schemas or code
modules.
Some of the best practices demonstrated by this code
include It exposes a well-designed API to the client. It can auto scale to
handle changes in the load. It caches semi-static data. It uses a CDN to host
static content. It uses a polyglot persistence when appropriate. It partitions
data to improve scalability, it reduces contention, and optimizes performance.
Some of the examples with this architectural style
include applications with a relatively simple domain, those with some
long-running workflows or batch operations or when there are managed services
rather than infrastructure as a service (IaaS).
No comments:
Post a Comment