Hacker News new | ask | show | jobs
by IncreasePosts 193 days ago
Good point. Have two programs - one checking every even number and returning odd of not even. And then have a program checking every odd number and returning even if not. Then, a simple program to dispatch to either program randomly, so you end up in the long term with good performance for each.
3 comments

Why not run both and use the result retrieved the fastest.
Yeeessss! Microservices!
Your mention of Microservices opened up my mind to additional possibilities. How about we create a microservice for each integer, then deploy 4 billion of them. Send a request to all of them simultaneously. Only one of them will respond with the answer. We still need to decide how to deploy those microservices - one per machine, or multiple per machine?
Could try 1 per IPv4 address? There’s just barely enough!
That sounds kinda stupid, it would completely destroy the original space savings. Unless the sharding makes it fit within compiler limits.