frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Orchestrating 5000 Workers Without Distributed Locks: Rediscovering TDMA

1•Horos•1h ago
I needed to orchestrate 500-5000 batch workers (ML training, ETL) using Go and SQLite. Every tutorial said: use etcd, Consul, or ZooKeeper.

But why do these processes need to talk to each other at all?

THE INSIGHT

What if orchestrators never run simultaneously?

Runner-0 executes at T=0s, 10s, 20s... Runner-1 executes at T=2s, 12s, 22s... Runner-2 executes at T=4s, 14s, 24s... Runner-3 executes at T=6s, 16s, 26s... Runner-4 executes at T=8s, 18s, 28s...

Time-Division Multiple Access (TDMA). Same pattern GSM uses for radio.

GO IMPLEMENTATION

type Runner struct { ID, TotalRunners int CycleTime time.Duration }

func (r Runner) Start() { slot := r.CycleTime / time.Duration(r.TotalRunners) offset := time.Duration(r.ID) slot

    for {
        time.Sleep(time.Until(computeNextSlot(offset)))
        r.reconcile() // Check workers, start if needed
    }
}

Each runner gets 2s in a 10s cycle. No overlap = zero coordination.

SQLITE CONFIG

PRAGMA journal_mode=WAL; dbWrite.SetMaxOpenConns(1) // One writer dbRead.SetMaxOpenConns(10) // Concurrent reads

With TDMA, busy_timeout never triggers.

THE MATH

Capacity = SlotDuration / TimePerWorker = 2000ms / 10ms = 200 workers per runner

5 runners = 1000 workers 25 runners = 5000 workers (25s cycle, 12.5s avg latency)

For batch jobs running hours, 10s detection latency is irrelevant.

BENCHMARKS (real data from docs/papers)

System | Writes/s | Latency | Nodes | Use Case etcd | 10,000 | 25ms | 3-5 | Config ZooKeeper | 8,000 | 50ms | 5 | Election Temporal | 2,000 | 100ms | 15-20 | Workflows Airflow | 300 | 2s | 2-3 | Batch TDMA-SPI | 40 | 5s avg | 1-5 | Batch

WHAT YOU GAIN: - Zero consensus protocols (no Raft/Paxos) - Single-node deployment possible - Deterministic behavior - Radical simplicity

WHAT YOU SACRIFICE: - Real-time response (<1s) - High frequency (>1000 ops/sec) - Arbitrary scale (limit ~5000 workers)

UNIVERSAL PATTERN

Wireless Sensor Networks: DD-TDMA (IEEE 2007) - same pattern Kubernetes Controllers: Reconcile every 5-10s (implicit TDMA) Build Systems: Time-slice job claims vs SELECT FOR UPDATE

WHY ISN'T THIS COMMON?

1. Cultural bias: Industry teaches "add consensus layer" as default 2. TDMA sounds old: It's from 1980s telecoms (but old ≠ bad) 3. SQLite underestimated: Actually handles 50K-100K writes/sec on NVMe 4. Most examples optimize for microservices (1000s ops/sec), not batch

WHEN NOT TO USE: Microservices (<100ms latency needed) Real-time systems (trading, gaming) >10,000 operations/sec required

GOOD FOR: Batch processing ML training orchestration ETL pipelines (hourly/daily) Video/image processing Anything where task duration >> detection latency

THE REAL LESSON

Modern distributed systems thinking: 1. Assume coordination needed 2. Pick consensus protocol 3. Deal with complexity

Alternative: 1. Can processes avoid each other? (temporal isolation) 2. Can data be partitioned? (spatial isolation) 3. Is eventual consistency OK?

If yes to all three: you might not need coordination at all.

CONCLUSION

I built a simple orchestrator for batch workers and rediscovered a 40-year-old telecom pattern that eliminates distributed coordination entirely.

The pattern: TDMA + spatial partitioning + SQLite The application to workflow orchestration seems novel.

If Kubernetes feels like overkill, maybe time-slicing is enough.

Sometimes the best distributed system is one that doesn't need to be distributed.

--- Full writeup: [blog link] Code: [github link]

Discussion: Anyone else using time-based scheduling for coordination-free systems? What about high clock skew networks?

Comments

wazokazi•1h ago
The workers sit idle for n-1 out of n time slices. As n gets larger, amount of work being done approaches zero.
Horos•1h ago
TDMA schedules the orchestrators (lightweight checks), not the workers (heavy jobs).

Orchestrators: Active 1/n of time (~10ms to check state) Workers: Run continuously for hours once started

T=0s: Orchestrator-0 checks → starts job (runs 2 hours) T=2s: Orchestrator-1 checks → job still running T=10s: Orchestrator-0 checks again → job still running

Think: traffic lights (TDMA) vs cars (drive continuously).

Work throughput is unchanged. TDMA only coordinates who checks when.

Modulation of cognition and AP-1 signaling by early-life rearing conditions

https://www.nature.com/articles/s41467-025-65343-5
1•PaulHoule•3m ago•0 comments

A New Home for PwSafe

https://support.huvisoft.dev/hc/en-us/articles/39442976714388-A-New-Home-for-pwSafe
1•transpute•4m ago•0 comments

Show HN: Datalensia – Client-side visual tools for exploring and comparing JSON

https://www.datalensia.com/
1•taiwas•5m ago•0 comments

2025 End of Year Pay Report

https://levels.fyi/2025
1•zuhayeer•5m ago•0 comments

AI toys spark privacy concerns as US officials urge action on data risks

https://thenationaldesk.com/news/fact-check-team/fact-check-team-ai-toys-spark-privacy-concerns-a...
2•smurda•6m ago•0 comments

They Were Supposed to Protect Young Workers. Instead, They Cashed In

https://www.nytimes.com/2025/12/25/nyregion/j1-visa-sponsors-profits-abuse.html
1•JumpCrisscross•7m ago•0 comments

Telegram Protocol Dissector

https://github.com/tomer8007/mtproto-dissector
1•somerandomuser8•10m ago•0 comments

Nike's Revival of Classic Brand Has a Hitch–Soccer Coach Grabbed the Trademark

https://www.wsj.com/business/retail/nikes-revival-of-classic-brand-has-a-hitchsoccer-coach-grabbe...
1•impish9208•11m ago•1 comments

Package Managers: What Do They Do, Really?

https://tudorr.ro/blog/2025-12-23-package-managers/
1•tudurom•11m ago•0 comments

Spark Declarative Pipelines Programming Guide

https://spark.apache.org/docs/latest/declarative-pipelines-programming-guide.html
1•raffael_de•12m ago•0 comments

Weight-loss pill approval set to accelerate food industry product overhauls

https://www.reuters.com/business/healthcare-pharmaceuticals/weight-loss-pill-approval-set-acceler...
1•JumpCrisscross•14m ago•0 comments

Show HN: I made a privacy-first personal finance app

https://www.wealthsync.co/
1•dimos851•17m ago•0 comments

Ask HN: What do you consider fun?

1•IndySun•19m ago•0 comments

Ask HN: What are some ideas to create magical experiences for kids?

1•andrewstuart•20m ago•0 comments

Unix V4 Update

https://irreal.org/blog/?p=13493
2•tsenturk•21m ago•0 comments

Tell HN: Math academy and iPad and sleep issues solved = me learning math

2•mettamage•26m ago•1 comments

Context Is the Missing Layer AI Agents Need

https://www.graphlit.com/blog/context-layer-ai-agents-need
3•kirkmarple•28m ago•0 comments

Show HN: Autoclaude – resume Claude Code after you hit your rate limit

http://autoclaude.blmc.dev/
1•henryaj•35m ago•0 comments

LLMs from Scratch Using Middle School Math – TDS Archive

https://medium.com/data-science/understanding-llms-from-scratch-using-middle-school-math-e602d27e...
1•bilsbie•42m ago•0 comments

Show HN: Kotodama OS – An external layer to prevent LLM persona drift

https://github.com/mrookiiheya-arch/kotodama-os
1•kotodama_R•43m ago•0 comments

Show HN: Pivor, Open source self-hosted CRM

https://github.com/Lexaro-Software/pivor
1•acaronlex•44m ago•0 comments

Hyp: One-Click Install for Popular Open-Source Softwares

https://hyp.app
3•hassanjahan•53m ago•3 comments

Show HN: I Updated My 2D Ant Game for the Holidays

https://github.com/aanthonymax/ant-and-apples
1•aanthonymax•54m ago•0 comments

I Killed Color on My Phone. The Result Shocked Me

https://www.nytimes.com/2025/12/25/opinion/smartphone-color-grayscale-addiction.html
1•geox•57m ago•0 comments

Docker Deployment Without the Registry

https://bjarneo.github.io/pipe/
4•bjarneo•58m ago•3 comments

Simple Is a Scam

https://nocomplexity.substack.com/p/simple-is-a-scam
3•runningmike•58m ago•1 comments

Ask HN: Is ChatGPT getting buggier over time or is it me?

3•softwaredoug•1h ago•0 comments

Ask HN: What's the best lecture or talk you've seen in 2025?

7•hopefully_can•1h ago•0 comments

Ask HN: ChatGPT Getting Buggier over Time?

2•softwaredoug•1h ago•0 comments

How to Spot a Bureaucrat?

https://www.tareqrafed.com/how-to-spot-bureaucrat
2•grog6•1h ago•0 comments