Pub/Sub Design Pattern in .NET Distributed Cache

By Nandkishor

The publish-Subscribe pattern also known as Pub/Sub is an indispensable tool for building enterprise-grade .NET applications. Just to refresh your memory, Pub/Sub is a messaging paradigm where the senders of messages (publisher) do not have any knowledge about the intended recipients (subscribers). Moreover, the publisher and subscriber applications do not interact with each other directly but instead depend on a common medium known as a topic. Hence, it's a loosely coupled messaging model.

Now, assume that you have multiple applications of different roles deployed within the same architecture and they need a mechanism to inform/notify each other about certain events. These events could either be transient (due to changes made on the run time) or database events (due to changes in the database). That's exactly where the publish-subscribe design pattern will help you to enable distributed events.

Read full Article

Enabling Distributed Events

To design a distributed event-driven architecture, developers traditionally turn towards using either of the following methods below.

Data Notifications provided by RDBMS

If the datastore is limited to a relational database, using the database notification feature seems to be the best available option. It allows you to register your interest with the database server and notifies your applications when there is any change in the database result set due to update, add, or delete.

However, RDBMS are intrinsically unscalable and easily become a performance bottleneck in applications. You do not want to put an unnecessary load on your databases. Besides, the database notifications feature itself is inherently slow and doesn't support runtime data sharing as well.

Read full Article

Signup for monthly email newsletter to get latest updates.

© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.