frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Go rate limiter that writes 95%-99% less I/O

https://github.com/etalazz/vsa
3•etalazz•2h ago

Comments

etalazz•2h ago
I built a small open-source rate limiter in Go that doesn’t write every hit to storage. It uses a pattern I call the Vector–Scalar Accumulator (VSA): keep the latest committed allowance as a scalar in storage (S) and track recent flux in RAM as a vector (A_net). Availability is computed in O(1) as S - |A_net|. We only persist when the net drift matters (e.g., |A_net| >= threshold), then apply the delta once and reset. In traffic with back-and-forth or retries, this cuts datastore writes by ~95–99% because opposing ops cancel in memory.

Why this is different from batching: batching still ships every event later; VSA collapses commutative updates into their net now. I/O scales with information (signal), not with transactional volume (noise).

What you get

O(1) reads and O(1) memory per key (HashMap<Key, VSA>) Dramatically fewer writes, locks, and round-trips under high churn Concurrency-safe TryConsume(n) to prevent oversubscription Background worker that commits only when a threshold is crossed, plus final flush on shutdown Pluggable persistence (mock included); keep your DB/Redis calm, or pair with a durable log if you need every event Trade-offs

Uncommitted in-RAM flux can be lost on crash (tune the threshold to your risk, or mirror raw events to a log) Best for commutative counters and volatile limits (rate limiting, edge quotas, hot counters, inventory holds)

Why you might care

Running distributed rate limiters, API gateways, or edge caches Hotspot keys causing write amplification/lock contention You want durability without paying the price of writing every micro-op How it works (tiny sketch)

// Always read availability in O(1) Available = S - |A_net|

// Persist only when signal matters if |A_net| >= threshold { S = S - A_net A_net = 0 }

Repo, docs, and a reference API demo are included. Curious to hear feedback from folks building distributed limiters or edge caches—especially around crash semantics, threshold tuning, and production anecdotes. If you need every event, I recommend pairing VSA with a durable log while keeping the hot path net-based.

Show HN: WP-Easy, framework to build WordPress themes

https://github.com/drewbaker/wp-easy
1•drewrbaker•1m ago•0 comments

Free Online Sora Watermark Adder – Add Sora AI Watermarks Instantly in Browser

https://sorawatermarkadder.org
1•wplacetool•3m ago•0 comments

Ask HN: Estimation of copyright material used by LLM

1•megamix•8m ago•0 comments

The U.S. is the bribery cop. Is that about to change?

https://www.npr.org/2025/06/20/1254460243/foreign-corrupt-practices-act-bribery-glencore-sudan-oil
2•KLK2019•12m ago•1 comments

Modeling Identity Types

https://bartoszmilewski.com/2025/10/18/modeling-identity-types/
1•ibobev•13m ago•0 comments

Symmetry of Amp

https://morwenn.github.io//presortedness/2025/10/18/TSB005-symmetry-of-amp.html
1•ibobev•14m ago•0 comments

A Theoretical Perspective on Hyperdimensional Computing [pdf]

https://cseweb.ucsd.edu/~dasgupta/papers/TDR21.pdf
1•jerlendds•14m ago•0 comments

Quality Metrics

https://www.johndcook.com/blog/2025/10/18/quality-metrics/
1•ibobev•14m ago•0 comments

The Accountability Problem

https://www.jamesshore.com/v2/blog/2025/the-accountability-problem
1•FrancoisBosun•14m ago•0 comments

San Francisco's new AI school

https://www.theguardian.com/technology/2025/oct/18/san-francisco-ai-alpha-school-tech
1•andsoitis•21m ago•1 comments

Effect of Computerized Cognitive Training on Vesicular Acetylcholine Transporter

https://games.jmir.org/2025/1/e75161
2•bookofjoe•28m ago•1 comments

Watching 25,000 Dice Neatly Arrange Themselves Shouldn't Be This Fascinating

https://www.sciencealert.com/packing-density-shear-force-dice-inside-cylinder-physics
3•Anon84•38m ago•1 comments

Smartwatches achieve centimeter-level accuracy with new tracking algorithms

https://techxplore.com/news/2025-10-smartwatches-centimeter-accuracy-tracking-algorithms.html
1•Brajeshwar•43m ago•0 comments

Transparent wearables gives real-time warnings about overexposure to sunlight

https://techxplore.com/news/2025-10-transparent-wearable-real-overexposure-sunlight.html
2•Brajeshwar•44m ago•0 comments

The Fight over Whose AI Monster Is Scariest

https://www.wsj.com/tech/ai/the-fight-over-whose-ai-monster-is-scariest-41a43193
2•Brajeshwar•50m ago•0 comments

Autoerasetool / Tribeca, a security system for Apple internal devices

https://orangera.in/mw/index.php/BlogPost:AutoErase
1•denysvitali•52m ago•0 comments

Neuroscientists can now predict what color you're seeing

https://www.psypost.org/neuroscientists-can-now-predict-what-color-youre-seeing-the-secret-is-sur...
2•geox•54m ago•0 comments

Hackers Had Been Lurking in Cyber Firm F5 Systems Since 2023

https://www.bloomberg.com/news/articles/2025-10-18/hackers-had-been-lurking-in-cyber-firm-f5-syst...
5•JumpCrisscross•1h ago•0 comments

Friendship Begins at Home

https://3quarksdaily.com/3quarksdaily/2025/10/friendship-begins-at-home.html
2•herbertl•1h ago•0 comments

TerraVision: A Terrain Visualization System (1994) [pdf]

https://www.sri.com/wp-content/uploads/2021/12/778.pdf
1•yubblegum•1h ago•0 comments

The first non-opioid painkiller

https://worksinprogress.co/issue/the-first-non-opioid-painkiller/
1•herbertl•1h ago•0 comments

I made a website with Apple iWeb in 2025

https://www.spacebar.news/making-iweb-website-2025/
2•herbertl•1h ago•0 comments

I ended my relationship because AI told me to

https://jetwilliams.com/from-prayers-to-prompts/
4•tejitopia•1h ago•5 comments

Wrongfully imprisoned for more than 40 years, US man faces deportation to India

https://www.bbc.com/news/articles/clykvypl9gxo
3•tartoran•1h ago•1 comments

Broadcom AFBR-S20: High-Performance Miniature Spectrometer Product Brief [pdf]

https://docs.broadcom.com/docs/AFBR-S20xx-PB
1•teleforce•1h ago•1 comments

3-year-old born deaf can hear 2 years after breakthrough gene therapy treatment

https://www.goodmorningamerica.com/wellness/story/3-year-old-born-deaf-can-hear-gene-therapy-trea...
2•testrun•1h ago•0 comments

Console Raytracer in C++

https://github.com/DinoZ1729/Ray
1•reconnecting•1h ago•0 comments

Check Your Blood Alcohol Level

https://baccalculator.pro/
1•Rarpr716•1h ago•0 comments

Easy-to-use calculator for Roblox Grow a Garden

https://growagardencalculator.one
2•Rarpr716•1h ago•0 comments

Potential new therapeutic target for asthma discovered

https://medicalxpress.com/news/2025-10-potential-therapeutic-asthma.html
1•PaulHoule•1h ago•0 comments