Search code examples
.netazureeventsstreamingazure-eventhub

Storing application events in Azure Event hub


In our application we create events for any side effects and willing to sync them to a storage for analytics.

I was thinking of using Azure event hub but when i look at the sample code and SDK there is only support for batch sending. I might use batch producing but in many cases I need to send one event at a time. Which makes me wonder if this is the right service to use.

For those who are interested in the code find below.

    public class CustomerCreatedEvent : EventRecord<Customer, Guid>
    {
        public CustomerCreatedEvent(Customer entity)
            : base(entity)
        {
        }

        public Customer Entity => _member;
    }

I have events for every side effect in the app. Essentially, these events will sync to an event source which will feed the azure data lake storage and snyapse for BI and analytics.

is Azure Event Hub the correct choice for this purpose?Aside from the fact that, it uses avro format which can be captured to datalake storage gen2, but needs to be converted to parquet so snaype can query. That part, I will be doing which an azure data factory service.

Can you please elaborate?

Thanks.


Solution

  • The sample code you provided is using the latest Eventhub package: Azure.Messaging.EventHubs. It does not offer a means to send a single event(unless sending one as a list) in order to improve performance and throughput.

    You can refer to the similar issue for more details.

    By the way, the old package(Microsoft.Azure.EventHubs) supports it, but we don't recommend to use it.