Event Hub Namespace, Tiers and Configuration

An Event Hub Namespace is the management container that holds one or more Event Hubs. It acts as the top-level resource in Azure for Event Hub and controls access keys, network settings, tier selection, and throughput capacity. All Event Hubs inside a namespace share the namespace's configuration settings.

Event Hub Namespace Structure

+──────────────────────────────────────────────────────────────+
|               EVENT HUB NAMESPACE: "prod-events-ns"         |
|                                                              |
|  Tier:           Standard                                    |
|  Throughput Units: 4                                         |
|  Location:       East US                                     |
|                                                              |
|  +───────────────────────────+  +────────────────────────+   |
|  | Event Hub: "telemetry"    |  | Event Hub: "orders"    |   |
|  | Partitions: 8             |  | Partitions: 4          |   |
|  | Retention:  7 days        |  | Retention:  3 days     |   |
|  | Consumer Groups:          |  | Consumer Groups:       |   |
|  |   $Default, analytics,    |  |   $Default, billing    |   |
|  |   archive, alerts         |  +────────────────────────+   |
|  +───────────────────────────+                               |
+──────────────────────────────────────────────────────────────+

Multiple Event Hubs inside a namespace share the namespace's throughput units and access policies. The namespace provides a single network endpoint. All Event Hubs inside are addressed as: {namespace}.servicebus.windows.net/{eventhub-name}.

Event Hub Tiers in Detail

Basic Tier

The Basic tier is the entry-level option. It supports low-volume, development, and testing scenarios. Key limitations include only one consumer group per Event Hub and a maximum retention of 1 day.

PropertyBasic Tier Value
Consumer groups per Event Hub1 ($Default only)
Message retention1 day
Throughput units1 to 20
Kafka compatibilityNot available
Schema RegistryNot available
Event Hub CaptureNot available
Use caseDevelopment and simple test scenarios

Standard Tier

The Standard tier is the most widely used tier for production workloads. It supports up to 20 consumer groups per Event Hub, 7-day retention, Kafka compatibility, and optional Capture.

PropertyStandard Tier Value
Consumer groups per Event Hub20
Message retention1 to 7 days
Throughput units1 to 40 (auto-inflate up to 40)
Kafka compatibilityAvailable
Schema RegistryAvailable
Event Hub CaptureAvailable (additional cost)
Use caseMost production workloads

Premium Tier

The Premium tier runs on single-tenant infrastructure (processing units instead of throughput units). It provides better isolation, predictable performance, and extended retention up to 90 days. It is designed for high-throughput, latency-sensitive workloads.

PropertyPremium Tier Value
Consumer groups per Event Hub100
Message retention1 to 90 days
Capacity unitProcessing Units (PUs): 1, 2, 4, 8, 16
IsolationSingle-tenant (dedicated compute and storage)
Event Hub CaptureIncluded at no extra cost
Dynamic partition scalingSupported
Use caseHigh-throughput, compliance-sensitive production

Dedicated Tier

The Dedicated tier provides an entire Event Hub cluster to a single organization. It is fully isolated and suitable for the most demanding enterprise scenarios with strict compliance requirements.

PropertyDedicated Tier Value
Consumer groups per Event HubUnlimited
Message retentionUp to 90 days
Capacity unitCapacity Units (CUs): 1 to 20+
IsolationFully dedicated hardware cluster
Billing modelFixed monthly cost per cluster capacity unit
Use caseEnterprise, government, high-compliance requirements

Creating an Event Hub Namespace – Step-by-Step

  1. Open the Azure Portal and search for Event Hubs
  2. Click + Create
  3. Select Subscription and Resource Group
  4. Enter a Namespace Name (globally unique within Azure)
  5. Select a Location (region)
  6. Choose a Pricing Tier (Basic, Standard, Premium, or Dedicated)
  7. For Standard tier: set the initial Throughput Units (1–20)
  8. Optionally enable Auto-Inflate with a maximum throughput unit limit
  9. Click Review + Create, then Create

Creating an Event Hub Inside a Namespace

  1. Open the newly created Event Hub Namespace
  2. Click + Event Hub
  3. Enter a name for the Event Hub
  4. Set Partition Count (2 to 32 for Standard; up to 2,000 for Premium/Dedicated)
  5. Set Message Retention in days (within the tier limit)
  6. Optionally configure Capture (Standard/Premium)
  7. Click Create

Event Retention Configuration

Event retention defines how long events remain available in Event Hub partitions. Consumers can read any event within the retention window, regardless of whether it was already processed by other consumers.

Example: 7-day retention

Day 1: Events E1, E2, E3 arrive
Day 3: Consumer A processes E1, E2, E3 (marks as processed in its consumer group)
Day 5: A new Consumer B is added. It starts reading from the beginning.
        Consumer B can read E1, E2, E3 — they are still retained.

Day 8: E1, E2, E3 are automatically deleted (past 7-day retention window).
        Consumer B can no longer access E1, E2, E3.

Auto-Inflate (Standard Tier)

Auto-Inflate automatically increases throughput units when the namespace approaches its current limit. This prevents throttling during unexpected traffic spikes without manual intervention.

Auto-Inflate Configuration:
  Current TUs: 4
  Auto-Inflate: Enabled
  Maximum TUs: 15

Normal day: 4 TUs sufficient
Traffic spike: Event Hub auto-scales to 6 TUs, then 8 TUs as needed
Spike ends: TUs remain at 8 (Auto-Inflate does not scale down automatically)

Note: Scaling down TUs must be done manually.

Shared Access Policies (Connection Strings)

Access to the Event Hub Namespace uses Shared Access Policies. Each policy grants specific rights: Listen (consume events), Send (publish events), or Manage (full administration). Connection strings are derived from these policies and used in producer and consumer applications.

Policy RightGrants Permission ToUse In
ListenRead events from Event Hub partitionsConsumer applications
SendPublish events to Event HubProducer applications
ManageListen + Send + create/delete Event HubsAdministrative tools only

Best Practice: Separate Policies

Recommended setup:

Policy "producers-policy": Send right only
  --> Connection string given to IoT devices and applications that publish events

Policy "consumers-policy": Listen right only
  --> Connection string given to analytics apps and consumers

Policy "admin-policy": Manage right
  --> Used only by DevOps scripts; never embedded in applications

Event Hub Namespace Configuration – Checklist

Configuration ItemRecommendation
Tier selectionStandard for most production; Premium for high-compliance or long retention needs
Initial throughput unitsStart conservatively; enable Auto-Inflate with a reasonable maximum
Partition countMatch expected consumer parallelism; plan for future growth
Retention periodSet to cover the longest expected consumer catch-up time
Access policiesCreate separate Send-only and Listen-only policies
Network accessUse IP filtering or Private Endpoints for production namespaces
Managed identityUse Azure AD managed identity instead of connection strings in production

Summary

An Event Hub Namespace is the container that organizes and secures all Event Hubs in a single unit. Tier selection determines retention, consumer group limits, isolation level, and features available. Partitions, retention, and throughput units are the three primary configuration levers that control capacity and behavior. Proper namespace design from the start prevents costly architectural changes later.

Leave a Comment