KatInterview

Design a Real-Time IP Blacklist and CIDR Lookup Engine

System DesignModel answer
MediumModel answerSystem Designsystem-designcachingnetworking

Last updated

Design a scalable, low-latency API and propagation architecture to block malicious IP addresses and CIDR ranges across distributed edge nodes.

Design an API and distributed backend architecture for an enterprise IP blacklist system.

The system must allow security operations and automated threat-detection services to add, update, remove, and query blocked IP addresses and network prefixes (CIDR blocks). Distributed edge routers, API gateways, and application microservices must evaluate incoming requests against this blacklist in real time.

Your design should cover:

  1. API Specifications: Define both management (control plane) and evaluation (data plane) interfaces.
  2. Data Structure & Storage: Select the data structures and persistent database for efficient single-IP and variable-length CIDR range matching.
  3. Low-Latency Read Path: Detail how edge components verify IPs under strict latency budgets.
  4. Cache Invalidation & Sync: Explain how changes flow from the write plane to all edge readers rapidly and reliably.
  5. Scale, Fault Tolerance & Observability: Address scale targets, edge isolation, edge-case failure modes, and operational monitoring.

Hints

Hint 1

Consider the asymmetry between read and write volumes: reads occur on every inbound HTTP packet/request, while writes are infrequent.

Hint 2

Prefix matching requires specific data structures like Patricia tries or interval arrays rather than plain hash tables.

Hint 3

Think about in-process evaluation (local caching) vs. remote API calls on the critical path.