Essay - Published: 2024.10.14 | create | fsharp | giraffe | htmx | one-million-checkboxes | projects | tech |
DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)
Today I'm releasing One Million Checkboxes.
One Million Checkboxes is a website that displays one million checkboxes. When you check / uncheck a box it gets synced to everyone else on the website.
I previously built One Thousand Checkboxes as a proof of concept for building globally distributed data with HTMX.
My inspiration was the original One Million Checkboxes (now archived) so eventually I knew I wanted to scale it to one million. Now I have.
I used a similar tech stack to One Thousand Checkboxes - in fact I cloned it as a starting point. The stack itself is basically CloudSeed - my project boilerplate for spinning up F# webapps quickly.
For more on these technologies and how I use them:
There were a few strategies I used to manage the bottleneck that is HTMX's HTML payload sizes. Usually this isn't a problem but since I'm constantly polling it can quickly blow up to unreasonable bandwidth usage.
In 1000 Checkboxes each grid reload cost about 5kb so reloading everything for one million checkboxes would quickly lead to 5mb for each reload which is unreasonable.
So I did a few things to minimize this:
I'm considering making a future post doing a deep dive on some of these strategies so let me know if you're interested in that.
Overall I've had a good time experimenting with checkboxes and HTMX. Some have suggested SSE to scale further but honestly I don't think that's the bottleneck and currently scalability / latency isn't much of a concern so may pass.
Potentially may scale to one billion checkboxes just to do it but that's for another time.
CTA: Go check some boxes! onemillioncheckboxes.xyz
If you liked this post you might also like:
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.