HNHacker News
TopNewBestAskShowJobs

samwho

1,463 karma · joined June 25, 2011

I write interactive visualisations of programming topics at https://samwho.dev
submissionscomments
samwho··on A visual interactive guide to Bloom filters
I'm the author of this post, and am happy to answer any questions. :)
samwho··on A visual interactive guide to Bloom filters
You're very kind! I'm a big believer in writing you can really lose yourself in, and try and achieve that with interactivity and visuals. The aesthetics of my posts is very important to me.
samwho··on A visual interactive guide to Bloom filters
Thank you so much. I still have a way to go. People who struggle with low contrast will struggle with the default colour scheme, for example. But I'm trying to make progress with every new post <3
samwho··on Ask HN: What software/tech blogs/magazines should I be reading in 2024?
Same, but writing. I’m very deliberately avoiding things that might not be relevant 10 years from now. This means rarely writing about specific technologies / languages / implementations, and instead focusing on concepts.
samwho··on Safari for Apple Vision Pro
This looks so cool. I’m extremely excited to get my hands on one of these next year.
samwho··on Ask HN: In 2024, become an expert in Docker or Podman?
Maybe a silly question but what are you hoping to achieve by investing time in becoming an expert in a specific container technology?
samwho··on Ask HN: What talks do you consider real gems?
I know you said you have a preference for fresh stuff but I just have to post my all-time faves:

- Pushing Through Friction by Dan Na: https://youtu.be/8bxZuzDKoI0?si=FRVYc-XAK_HuRNs3. Great talk about how ideas get stalled in the big organisational machine, and what you can do about it.

- You Deserve Nice Things by Soroush Khanlou: https://youtu.be/CTZOjl6_NuY?si=a1pmGILQzGR9T4Wv. Eye opener about making nice-to-use data structures / APIs.

- The Most Important Design Guideline by Scott Meyers: https://youtu.be/sfLZ7v9gEnc?si=QFNdmcguaOHbmFfX. A fun exploration of badly designed software.

samwho··on Ask HN: Share your favorite software blog posts of 2023
Merry Christmas :)
samwho··on Retries – An interactive study of request retry methods
Thank you! <3
samwho··on Retries – An interactive study of request retry methods
It doesn’t apply to successful requests, that’s right.

The simulation retries failed requests using various retry strategies, and then after a successful request will wait a configured amount before sending the next request.

samwho··on Retries – An interactive study of request retry methods
I've uploaded the code for all of my visualisation posts here: https://github.com/samwho/visualisations.

Enjoy! :)

samwho··on Retries – An interactive study of request retry methods
I think I've misunderstood what circuit breakers are for years! I did indeed think they were a server-side mechanism. The original commenter's description of them is great, you can essentially create a heuristic based on the observed behaviour of the server and decide against overwhelming it further if you think it's unhealthy.

TIL! Seems like it can have tricky emergent behaviour. I bet if you implement it wrong you can end up in very weird situations. I should visualise it. :)

samwho··on Retries – An interactive study of request retry methods
I think what they mean is something that would cause client to do something at the same time (could be all sorts, some synchronised crash, aligning timers to clock-time, etc.). If the requests aren't user-driven then yes, you likely would want to include some jitter in the first request too.

Funnily, you'll notice that some of the visualisations have the clients staggering their first request. It's exactly for this reason. I wanted the visualisations to be as deterministic as possible while still feeling somewhat realistic. This staggering was a bit of a compromise.

Not sure what is meant by "if your exponential backoff counter is not global", though. Would love to know more about that.

samwho··on Retries – An interactive study of request retry methods
Throttling, tarpitting, and circuit-breakers are something I'd love to visualise in future, too. Throttling on its own is such a massive topic!
samwho··on Retries – An interactive study of request retry methods
Not a newsletter as such but I do have an email list where I post whenever I write something new. You can find it here: https://buttondown.email/samwho
samwho··on Retries – An interactive study of request retry methods
It uses PixiJS (https://pixijs.com/) for the 2D rendering and GSAP3 (https://gsap.com/) for the animation. The <traffic-simulation /> blocks are custom HTMl elements (https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...) which I use to encapsulate the logic.

I've been thinking about creating a separate repo to house the source code of posts I've finished so people can see it. I don't like all the bundling and minification but sadly it serves a very real purpose to the end user experience (faster load speeds on slow connections).

Until then feel free to email me (you'll find my address at the bottom of my site) and I'd be happy to share a zip of this post with you.

samwho··on Retries – An interactive study of request retry methods
You know, I hadn't actually considered mentioning it. Another commenter brought it up, too. It's so second nature I forgot about it entirely.

I'll look about giving it a nod in the text, thank you for the feedback. :)

samwho··on Retries – An interactive study of request retry methods
Totally! Thanks for bringing those up. I tried to keep the scope specifically on retries and client-side mitigation. There's a whole bunch of cool stuff to visualise on the server-side, and I'm hoping to get to it in the future.
samwho··on Retries – An interactive study of request retry methods
Yeah! An insidious problem that’s not obvious when you’re picking a retry interval.

I had fun with the details of the explosion animation. When it explodes, the number of requests that come out is the actual number of in-progress requests.

samwho··on Retries – An interactive study of request retry methods
Thanks for sharing!

I’m the author of this post, and happy to answer any questions :)

samwho··on Random Load Balancing Is Unevenly Distributed
Thanks for the shout out! Funnily, the article in the original post covers the most requested algorithm I never covered: power of two choices.
samwho··on Hashing
You're welcome!

I deliberately didn't go in to that for a few reasons.

1. It would have made this article very, very long. 2. It's a bit out of scope for an article on hashing. 3. I think I might give hash maps their own article in future.

Hash maps are fantastically deep. So many different ways to do it. You'll find a lot of material online but I'd recommend Raymond Hettinger's talk on how Pythons hash map data structure has evolved over time: https://www.youtube.com/watch?v=p33CVV29OG8.

samwho··on Hashing
I saw this during the writing of the post! Extremely cool, I mention it a little in my behind-the-scenes post.
samwho··on Hashing
I agonised over this. I did originally have a version that used 2-element arrays instead, but the resulting code felt more dense and hard to follow.

I figured that people who know enough to point this out already know what's up. People who don't will benefit from the code being easier to read.

samwho··on Hashing
This is my eternal struggle: be correct, or be simple.

I wrote a version that used 2-element arrays but the code became more dense and I worried about losing people. I was hoping that how easy it would be to translate it to not use objects would give me a pass here, but apparently not :D

samwho··on Hashing
I didn't know this. I created Haskie during the writing of my Memory Allocation post because I found myself trying to pre-empt reader questions a lot and it was weird to read. Creating a proxy for the reader in Haskie made it flow a lot better.

I've noticed in this post that a 2nd character that's a proxy for an "expert" in a topic would also be handy. Taking suggestions for a good dog breed to represent this character.

samwho··on Hashing
The buckets, in the context of hash maps, are typically lists. Either arrays or linked lists. They're used to store the key-value pairs.

Some load balancers do use hashing in much the same way hash maps do. Usually they'll take a combination of: source IP, source port, destination IP, destination port, and hash it. They'll then use that hash to pick a server. The practical impact of this is that each user always gets mapped to the same server. This is typically called "session sticky load balancing" because it means session information about that user can live on the server, safe in the knowledge that the user will always end up on that server and not get routed to any others.

samwho··on Hashing
This was purely due to familiarity. I knew murmur3 was considered a good, current hashing algorithm. I was able to find a good implementation of it in JS, so I didn't really look any further.

Thanks for exposing me to xxhash! I'll store that away as an alternative to murmur3 if I ever need one in future. :)

samwho··on Hashing
There’s a name I haven’t heard for a long time.

Thank you, sir! As soon as I can reliably spell “quaternions” I will think about trying it.

Funnily, one of the ideas I have cooking in my head is going to require a foray into 3D.

samwho··on Hashing
Oh damn, I didn’t know that. Have bookmarked that post, thank you so much for your comments. I’ve been very fortunate in my writing that the comment sections are always full of people with awesome insight that I missed during my own reading on the topic.
← PreviousPage 7 of 10Next →