Skip to content

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

Figma 11 min read Case study mediumAdept

The search for speed in Figma

Figma's search slowness traced mostly to its own stack, not OpenSearch: OpenSearch's headline 8 ms metric was per-shard time, and only the "took" field in responses reveals overall query latency, which accounted for under 30% of API time. Fixes included reordering and slimming Ruby permission checks, repairing a database connection setup bug that also sped up the rest of Figma, and trimming index size by 50% and then 90% so the data fit in the OS page cache. Load tests with a custom Go benchmark showed AWS sizing guidance suited log workloads, not latency-sensitive search. Cutting shards from 450 to 180 and moving to nodes with less CPU and more RAM paid off, while concurrent segment search hurt. Overall API latency fell about 60%, peak QPS rose over 50%, and cost dropped more than 50%.

Related posts

  • The infrastructure behind AI search in Figma

    Figma mediumAdept

    Figma's AI search embeds frames and published components with a CLIP-based multimodal model, so screenshots, layer selections and text all query one vector space. Text queries are embedded directly, while selections are rendered to images first, which worked better than embedding JSON. Indexing runs as chained async jobs: a headless C++ editor enumerates frames, metadata goes to DynamoDB, thumbnails go to S3, SageMaker produces embeddings in batches, and OpenSearch kNN serves faceted vector search. Component search runs lexical and vector queries in parallel and merges them with min-max score normalization. Costs were cut by porting Ruby to C++, CPU rendering with llvmpipe, a four-hour indexing debounce (only 12% of data processed), dropping duplicates and drafts (index halved) and vector quantization; the post also covers an OpenSearch replica bug and a pitfall where excluding embeddings from _source wiped them on document updates.

  • How Canva achieved 10x faster search and 70% lower costs with ClickHouse

    ClickHouse mediumAdept

    Canva moved tracing and logging (about 3 million spans and 3 million logs per second) onto a self-managed ClickHouse cluster of 5 shards × 3 replicas on Kubernetes. It reached a 14x compression ratio, cut costs by about 70%, and brought P90 trace search down from 30s to 2.5s. The ingestion gains came from batching roughly 200k spans per insert in OpenTelemetry collectors and writing straight to local tables. Search speed came from a sorting key aligned with Jaeger's filters, daily partitions, a materialized-view lookup table keyed by trace ID, and a client-side sliding search window. Logs flow through Kinesis and Lambda using tuned async inserts, with ngram Bloom filters on flattened log strings for free-text search and a custom DSL query gateway.

  • How we built AI search in Figma

    Figma easyNovice

    Figma pivoted from an AI design-autocomplete prototype to shipping visual and semantic search after research showed 75% of objects added to the canvas come from other files and designers struggle to find mid-level frames. To keep indexing tractable on an infinite canvas, the team indexed only UI-like frames found via dimension heuristics, deduplicated copied designs and unaltered file copies, and delayed indexing until a file was idle for four hours. Search quality was measured with evals built as a Figma plugin for labeling results, and the UI landed in the Actions panel with previews and filters to serve both exploration and execution workflows.

  • Observability At Scale — Every Byte Counts

    Wise Engineering mediumAdept

    Five observability changes at Wise cut monthly spend by 40%. Switching Loki chunk compression from Snappy to lz4 cut S3 storage and cross-AZ traffic by roughly 50% with negligible CPU impact. Moving the OpenTelemetry Collector to Tempo path from gzip to zstd reduced Tempo ingest by about 40%, and upgrading Prometheus to Remote Write v2 dropped daily traffic to Mimir from ~16TB to ~5.5TB. Aligning Loki's split_queries_by_interval with the ~1-hour p90 chunk span eliminated redundant chunk reads, and an AI-assisted investigation tracked down a Fluent Bit connection limit, with the overall lesson being to challenge defaults on high-volume data paths and validate against measured cost.

  • The Day Our Own Queries DoS’ed Us: Inside Zalando Search

    Zalando Engineering mediumAdept

    A Zalando Elasticsearch cluster serving two large markets was overwhelmed by a self-inflicted denial of service: a bug in an internal maintenance workload made an application send only 20-100 requests per second of faceting queries aggregating on SKU, a unique-per-product, extremely high-cardinality field. Because the traffic was low-volume, syntactically valid and untagged, it went unnoticed, and the usual mitigations (longer cache TTLs, scaling coordinator and data nodes, lower query termination thresholds) gave no relief. Splitting the markets via shard allocation isolated the problem, and trace analysis in Lightstep linked a 50x query spike from the internal client to the incident. High-cardinality terms aggregations run as heavy work on the shard-level search thread pool, not the parallel slice collectors, so a handful of them can saturate CPU and queues and starve normal traffic.

The quest for software engineering knowledge.

Look:
Layout: