Skip to content
Free since 2014. Built for the engineers who keep things running.

cat /articles/i-built-a-shared-pixel-canvas-with-laravel-rust.md

Laravel

★ I built a shared pixel canvas with Laravel Rust

A blog author builds Dots, a shared 500 by 500 pixel canvas, on Laravel Rust, keeping the drawing in server memory and pushing updates over WebSockets instead of PHP-style request handling.

freek.dev04 Dec 2026 · 4 min read · summary

article --summary

The summary

The author explains why a shared drawing app is awkward in a typical PHP-FPM setup, where state can't live between requests, and how Laravel Rust lets the canvas sit in memory as a singleton. The drawing is stored as one byte per pixel, so the full canvas is only about 250 KB, and it is saved to object storage every five seconds when it changes so a restart doesn't wipe it out. For live updates, the app runs its own WebSocket route on Axum rather than paying for a separate Reverb cluster. New visitors get the full canvas first, then batches of changed pixels go out every 50 milliseconds, with repeated paints on the same pixel collapsed into the final color. Cursor positions are throttled the same way. The post also notes the tradeoffs: the app runs on a single instance with autoscaling off, since a second instance would hold its own canvas, and a crash can lose changes made since the last snapshot. It closes with a pitch for the Flare error tracker and a note about Spatie's ports of its PHP packages to Rust and Go.

Editorial note: This is a summary of an article first published by freek.dev. The full piece is on their site.

Reading now

Topic
Laravel
Source
freek.dev
Published
04 Dec 2026
Format
Curated summary

Have a take on this?

Write it up and submit it. It goes on the list once an editor approves it.

Submit an article

articles --latest

Latest articles

New from the blogs we follow and the community.

All articles

newsletter --weekly

LaraChat Weekly, minus the noise.

The best reads, new jobs and upcoming events, in one email a week.