Scaling Didit Webhook Consumers with Kubernetes and KEDA
Learn how to containerize and efficiently scale your Didit webhook consumers using Kubernetes and KEDA. This guide covers best practices for ensuring real-time processing of identity verification events, maintaining reliability.

Containerization is KeyEncapsulate your webhook consumer logic within Docker containers for portability, consistency, and efficient deployment across various environments.
Kubernetes for OrchestrationUtilize Kubernetes for robust orchestration, automated deployments, self-healing capabilities, and efficient management of your containerized webhook consumers at scale.
KEDA for Event-Driven ScalingImplement KEDA (Kubernetes Event-Driven Autoscaling) to automatically scale your webhook consumers based on the actual load of Didit webhook events, ensuring optimal resource use and responsiveness.
Didit's Seamless IntegrationDidit provides a secure, reliable webhook system with HMAC signature verification, enabling real-time processing of identity verification results and simplifying the integration with scalable consumer architectures.
The Challenge of Real-Time Identity Verification Event Processing
In today's fast-paced digital landscape, real-time processing of identity verification events is not just a luxury, but a necessity. Businesses leveraging platforms like Didit for ID Verification, Passive & Active Liveness, or AML Screening receive critical updates via webhooks. These events, ranging from successful verifications to fraud alerts, require immediate action to maintain a smooth user experience and ensure compliance. However, the volume and velocity of these webhooks can fluctuate dramatically. A sudden surge in user sign-ups, for instance, can overwhelm an inadequately scaled consumer application, leading to processing delays, missed events, or even system crashes. This is where a robust and scalable architecture for webhook consumption becomes paramount.
Traditional approaches often involve over-provisioning servers, leading to wasted resources during low-traffic periods, or manual scaling, which is reactive and prone to human error. The ideal solution is an infrastructure that can automatically adapt to the incoming webhook load, processing each event efficiently without human intervention. This blog post will guide you through containerizing your webhook consumers and scaling them effectively using Kubernetes and KEDA, ensuring your application is always ready for the next wave of Didit verification events.
Containerizing Your Webhook Consumers with Docker
The first step towards building a scalable webhook consumer system is containerization. Docker provides a standardized way to package your application and its dependencies into a lightweight, portable container. This ensures that your webhook consumer runs consistently across any environment, from your local development machine to production Kubernetes clusters. Your consumer application, whether it's written in Python, Node.js, Java, or any other language, should be designed to receive HTTP POST requests from Didit's webhook service, verify the signature, and then process the payload.
A typical Dockerfile for a webhook consumer might look something like this (for a Node.js example):
# Use a lightweight base image
FROM node:18-alpine
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install --production
# Copy the application code
COPY . .
# Expose the port your app runs on
EXPOSE 3000
# Command to run the application
CMD ["node", "server.js"]
Once containerized, your webhook consumer becomes an immutable unit, simplifying deployment and ensuring that what works in development will work in production. This consistency is vital when dealing with critical identity verification data from Didit, where processing errors can have significant implications for user experience and compliance.
Kubernetes: Orchestrating Your Containerized Consumers
With your webhook consumers containerized, Kubernetes steps in as the orchestrator. Kubernetes provides a powerful platform for deploying, managing, and scaling containerized applications. It offers features like self-healing, automated rollouts and rollbacks, and declarative configuration, making it the de facto standard for running modern cloud-native applications. For Didit webhook consumers, Kubernetes ensures high availability and reliability.
You would define your webhook consumer as a Kubernetes Deployment, specifying the Docker image, desired replicas, resource requests and limits, and any necessary environment variables (e.g., your Didit webhook secret shared key for signature verification). A corresponding Service would expose your consumer pods to the network, typically behind an Ingress controller, to receive incoming webhook requests from Didit. Didit's webhooks, configured via the API or Business Console, will then send events to the public endpoint exposed by your Kubernetes service.
Kubernetes' ability to manage the lifecycle of your pods means that if a consumer pod fails, Kubernetes will automatically restart it or replace it, ensuring continuous processing of Didit's real-time updates. This resilience is crucial for maintaining the integrity of your identity verification workflows, especially when dealing with high volumes of data from Didit's NFC Verification or 1:1 Face Match products.
KEDA: Event-Driven Autoscaling for Optimal Efficiency
While Kubernetes can scale applications based on CPU or memory utilization, this reactive approach isn't always ideal for event-driven workloads like webhook consumers. A sudden burst of Didit webhooks might cause CPU to spike, but the pods might not scale up fast enough, leading to a backlog. This is where KEDA (Kubernetes Event-Driven Autoscaling) shines. KEDA allows you to scale your Kubernetes deployments based on the number of events needing to be processed in various external event sources, such as message queues (e.g., Kafka, RabbitMQ, SQS).
To use KEDA effectively for Didit webhooks, you would typically funnel incoming webhooks into a message queue first. Your Kubernetes deployment then consumes messages from this queue. KEDA monitors the queue length and scales your consumer pods up or down accordingly. If Didit sends a flood of verification results, the queue length increases, and KEDA automatically provisions more consumer pods to process them. As the queue empties, KEDA scales down the pods, optimizing resource usage and reducing costs.
This asynchronous pattern provides several benefits:
- Decoupling: Your webhook endpoint can quickly acknowledge Didit's webhook, then enqueue the event for processing, preventing timeouts.
- Resilience: If your consumer application goes down, events are safely stored in the queue and can be processed once the consumers recover.
- Scalability: KEDA ensures your consumers scale precisely with demand, preventing bottlenecks and resource waste.
Didit's robust webhook system with HMAC signature verification ensures that events received are authentic and untampered, providing a secure foundation for this event-driven architecture. You can configure your Didit webhooks (v3 recommended) to send payload versions that align with your processing logic, and rotate your secret_shared_key as needed for enhanced security.
How Didit Helps
Didit is designed with developer-first principles, making integration with scalable architectures like Kubernetes and KEDA seamless. Our robust webhook system provides real-time notifications for all identity verification outcomes, whether it's an ID Verification result, a Proof of Address confirmation, or an Age Estimation outcome. Didit's webhooks are secure, utilizing HMAC signatures that you can easily verify within your consumer applications to ensure data integrity and authenticity. This is vital for maintaining trust and compliance, especially when dealing with sensitive user data.
Didit's modular architecture allows you to plug-and-play various identity checks, generating a diverse range of webhook events that your scalable consumer system can efficiently handle. With Didit's free tier, you can start building and testing your containerized webhook consumers without upfront costs, leveraging our AI-native platform for accurate and fast identity verification. Our API-driven approach and comprehensive documentation make it straightforward to set up, update, and manage your webhook configurations, including specifying the webhook_url, webhook_version (v3 recommended), and even rotating your secret_shared_key directly via the API or Business Console. Didit ensures that you receive the necessary data to automate trust and orchestrate risk, while providing the tools to process that data at any scale.
Ready to Get Started?
Ready to see Didit in action? Get a free demo today.
Start verifying identities for free with Didit's free tier.