Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Squarespace Engineering 6 min read Case study mediumAdept

Why We Built a Write Back Cache for Our Asset Library with Google Cloud Spanner

Squarespace's Alexandria asset-library service moved write latency off the critical path by adding a Google Cloud Spanner write-back cache in front of Google Cloud Storage, where libraries are stored as header, segment and trash objects. Synchronous GCS writes caused long-tail latency and hit GCS's one-write-per-second-per-object limit, which forced fragile write-coalescing logic. Updates now land in Spanner, are applied when libraries load into the in-memory cache, and are flushed to GCS asynchronously. A write-ahead log and per-library queues were rejected because only end state is needed and libraries are scoped individually. After a canary rollout, average write latency fell to about 30% and p99 to about 10% of previous levels.

Related posts

  • Session revocations at scale

    Canva Engineering mediumAdept

    Canva moved its gateway session-revocation cache from per-pod MySQL loads to sorted binary chunks in S3, eliminating the database stampede when hundreds of gateway pods started during deploys. Revocations are packed into 16-byte records in sorted flat arrays split into 30-minute S3 objects. Gateways binary-search the downloaded bytes directly and refresh recent chunks with conditional GETs. A ZooKeeper-elected worker appends new revocations, using conditional PUTs for optimistic concurrency so that racing writers never lose updates. The theoretically O(N^2) rebuild still exceeds 2000 revocations/sec, memory use dropped 87.5%, and read replicas were cut to two.

  • How does Turso Cloud keep your data durable and safe?

    Turso mediumAdept

    Turso Cloud makes every SQLite database durable on S3 and S3 Express, treating local server disk purely as a cache. Database files are split into 128kB segments grouped into generations, while recent WAL writes are acknowledged only after landing in low-latency S3 Express, with frequent checkpoints (around every 1MB). Segmenting enables lazy fetching, bounded per-tenant local storage and safe replacement of compute nodes. Continuous backups with 90-day point-in-time restore and instant metadata-only branching fall out of the same design.

  • Turso Cloud on AWS is now available for everybody

    Turso easyNovice

    Turso Cloud is now generally available on AWS, built on an S3-native architecture where every commit is made durable on S3 Express One Zone and local disks serve as a read cache. Two factors make object storage viable for an OLTP write-ahead log: massive multitenancy, which lets commits be batched across many databases, and S3 Express latency in the single-digit milliseconds, comparable to fsync on EBS. Because each database is just a SQLite file on an always-up multitenant server, there are no cold starts, and databases can move between servers as load shifts. Paid Fly.io customers may stay or migrate; free-tier databases are auto-migrated to mapped AWS regions starting March 21.

  • The bridge to agent-scale Git infrastructure

    GitHub Engineering mediumAdept

    GitHub has moved nearly all Git repositories to replicas split between its own data centers and Azure. The last, busiest repositories were held back by a 25ms cross-region round trip, because Spokes' quorum serialized every write behind a repository-wide lock. Narrowing the quorum's scope to individual references lets writes to different branches proceed concurrently, giving 3–4x higher throughput at lower latency in internal testing. A 'virtual write replica' makes Azure Blob Storage a quorum member and coalesces disjoint-reference writes into shared I/Os, so ephemeral read replicas can warm from object storage and scale independently of the write path.

  • Turso Cloud Goes Diskless: How We Built a Fully S3-Based Database Architecture

    Turso mediumAdept

    Turso Cloud moved to a diskless architecture where writes are acknowledged only after landing in S3 Express One Zone, so compute pods hold no durable local state and can be rescheduled freely. That makes Bring-Your-Own-Cloud deployments possible without Kubernetes StatefulSets. Benchmarks show standard S3 4kB uploads averaging 31ms with a p99 of 102ms. S3 Express stays in single-digit milliseconds, about 4ms over a local fsync, even across availability zones. Per-PUT costs are cut by batching writes across many active SQLite databases on each multi-tenant node, with local disks kept as a write-through read cache and checkpointed database files copied to standard S3 for free continuous backups.

The quest for software engineering knowledge.

Look:
Layout: