Urgent.News

What's breaking now, across thousands of outlets.

Tech

Estimación de cardinalidad hiper-eficiente: Redis HyperLogLog en producción con wredis

Estimación de cardinalidad hiper-eficiente: Redis HyperLogLog en producción con wredis Contar elementos únicos en millones de usuarios activos diarios, direcciones IP o eventos telemétricos IoT en una base de datos relacional tradicional o en un Set estándar de Redis agota rápidamente la memoria RAM disponible. Un Set en Redis almacenando 100 millones de UUIDs requiere varios gigabytes de RAM. En…

HyperLogLog Cardinality Estimation in Production with wredis: Redis HyperLogLog in Production with wredis

Counting unique elements in millions of daily active users, IP addresses, or IoT telemetry events overwhelms traditional relational databases or standard Redis Sets with RAM. Redis HyperLogLog (HLL) implements a probabilistic estimation algorithm that keeps memory consumption constant at ~12 KB per key, while maintaining an error standard below 0.81%.

Why HyperLogLog with wredis? wredis integrates cardinality operations with strict typing, automatic TTL management, and high-concurrency connection pooling.

```python

from wredis import RedisHLLManager

# Initialize HLL Manager with enterprise-level pooling

hll_manager = RedisHLLManager(

host='localhost',

port=6379,

db=0

)

# Register daily unique visitors with distributed keys

key_visitors_today = 'visitors:2026-09-20'

hll_manager.add(key_visitors_today, *[f'user_{i}' for i in range(100000)], ttl=86400)

# Massive ingestion of unique identifiers with sub-millisecond latency

lote_usuarios_1 = [f'user_{i}' for i in range(100000, 150000)]

hll_manager.add(key_visitors_today, *lote_usuarios_1, ttl=86400)

# Estimate total unique visitors with bounded memory (~12 KB)

total_uniques = hll_manager.count(key_visitors_today)

print(f'Estimated unique visitors: {total_uniques}')

# Expected result: ~150,000 unique records with 0.81% margin of error

```

Key advantages for production architecture:

Constant footprint: Exactly 12 KB per counter, regardless of 10,000 or 10,000,000 distinct records.

Ultra-fast merging: Combines multiple HyperLogLog keys (e.g., daily metrics into weekly or monthly accumulations) directly on Redis without transferring massive data to the application.

Built-in TTL and lifecycle control: Prevents the accumulation of outdated analytical metrics in memory.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

Fool's Expertise

  • Huang dismissed AI doomerism, but missed chance to explain Hinton's wrong predictions
  • Hinton's mistake stemmed from making claims beyond his domain expertise
  • Consulting experts from various fields crucial to avoid "Fool's Expertise"

Feeding the OLAP beast: ClickHouse massive bulk ingestion steps.

Feeding the OLAP beast: ClickHouse massive bulk ingestion steps. ClickHouse is a columnar beast, but treating it like MySQL by inserting row-by-row will bring your cluster to its knees.

  • ClickHouseBulkStep enables bulk data insertion in OLAP pipelines
  • Utilize wpipe-steps and wpipe import Pipeline for efficient production pipelines
  • Insert sample telemetry data batch and verify successful record count

PDF, ZIP and binary files streaming over Kafka with names intact.

PDF, ZIP and binary files streaming over Kafka with names intact. Day 07 of the WKafka Open-Source Engineering Series. Don't provision a cloud bucket when all you need is sending small PDFs and ZIPs…

  • WKafka library streams PDF, ZIP, binary files over Kafka while preserving file names.
  • Traditional approaches require cloud buckets for small file transfers; WKafka handles it natively.

Archivos PDF, ZIP y binarios viajando en Kafka con nombre intacto.

Archivos PDF, ZIP y binarios viajando en Kafka con nombre intacto. Día 07 de la serie técnica WKafka Open Source. No aprovisiones un bucket en la nube cuando lo único que necesitas es enviar PDFs o…

  • WKafka transmits PDF, ZIP, and binary files with original names intact.
  • Addresses loss of file names and extensions during data conversion.
  • Native serializer packs file names and binary data into one unit.

More from Monday 28 September →