Bharat
Bharat

Reputation: 6095

How to efficiently implement auditing for high-throughput background service in .NET 8?

I have a .NET 8 background service responsible for two primary tasks:

1. Push JSON data packets to message brokers (ActiveMQ, RabbitMQ, or JMS queues):

2. Manage multiple services using this push mechanism:

New Requirement:

I now need to implement auditing for every data packet pushed to the broker. Specifically, I need to log each record in a SQL database with a timestamp indicating when it was sent.

Challenges:
Approaches I've considered so far:
  1. Implementing a simple fire-and-forget service using C#'s asynchronous capabilities to log the data to SQL. However, I am unsure if this can handle the load effectively.
  2. Using a background job processing library like Hangfire to offload the auditing to a separate worker process.

My question is: How can I ensure scalability and reliability while keeping the SQL database from becoming a bottleneck?

I haven't finalized an approach yet and am open to other ideas or improvements. Any suggestions or insights would be greatly appreciated. Thanks!

Upvotes: 2

Views: 64

Answers (0)

Related Questions