This is a continuation of a series of articles on
crowdsourcing application and including the most recent article.
The original problem statement is included again for context.
Social engineering applications provide a wealth of
information to the end-user, but the questions and answers received on it are
always limited to just that – social circle. Advice solicited for personal
circumstances is never appropriate for forums which can remain in public view.
It is also difficult to find the right forums or audience where the responses
can be obtained in a short time. When we want more opinions in a discrete
manner without the knowledge of those who surround us, the options become fewer
and fewer. In addition, crowd-sourcing the opinions for a personal topic is not
easily available via applications. This document tries to envision an
application to meet this requirement.
The previous article continued the elaboration on the usage
of the public cloud services for provisioning queue, document store and
compute. It talked a bit about the messaging platform required to support this
social-engineering application. The problems encountered with social
engineering are well-defined and have precedence in various commercial
applications. They are primarily about the feed for each user and the
propagation of solicitations to the crowd. The previous article described
selective fan out. When the clients wake up, they can request their state to be
refreshed. This perfects the write update because the data does not need to be
sent out. If the queue sends messages back to the clients, it is a fan-out
process. The devices can choose to check-in at selective times and the server
can be selective about which clients to update. Both methods work well in
certain situations. The fan-out happens in both writing as well as loading. It
can be made selective as well. The fan-out can be limited during both pull and
push. Disabling the writes to all devices can significantly reduce the cost.
Other devices can load these updates only when reading. It is also helpful to
keep track of which clients are active over a period so that only those clients
get preference.
In this section, we talk about synchronous I/O. When there
are many background threads that can starve other threads as they enter a wait
state and do not perform any work while holding up critical resources, it
hampers the crowdsourced application which must stay up-to-date despite the
volume of traffic matching the levels of other social engineering applications.
Some common examples of I/O include, retrieving or persisting data to a
database, sending a request to a web service, posting a message or retrieving a
message from a queue, and writing or reading from a file in a blocking manner.
There is a lot of advantages to running calls synchronously especially from
debugging and troubleshooting purposes because the call sequences are
pre-established. But the overuse of this feature can hurt performance due to
the tasks consuming resources on a spinning wait can starve other threads. It
appears notably when there are components or I/O requiring synchronous I/O. The
application uses library that only uses synchronous methods or I/O. The base
tier may have finite capacity to scale up. Compute resources are better
suitable for scale out rather than scale up and one of the primary advantages
of a clean separation of layers with asynchronous processing is that they can
be hosted even independently. Container orchestration frameworks facilitate
this very well. As an example, the frontend can issue a request and wait for a
response without having to delay the user experience. It can use the model-view-controller
paradigms so that they are not only fast but can also be hosted on separate
containers that can scale out.
It can be fixed in one of several ways. First the processing can
be moved out of the application tier into an Azure Function or some background
api layer. If the application frontend is confined to data input and output
display operations using only the capabilities that the frontend is optimized
for, then it will not manifest this antipattern. APIs and Queries can
articulate the business layer interactions. Many libraries and components
provide both synchronous and asynchronous interfaces. These can then be used
judiciously with the asynchronous pattern working for most API calls.
No comments:
Post a Comment