---
title: "Scaling Scientific Data: Migrating Benchling’s Schema Model for Performance at Scale"
description: "Benchling replaced its PostgreSQL entity-attribute-value (EAV) storage for schema field values with a single JSONB column per entity, cutting row counts and per-row overhead that had slowed automated assay-result ingestion."
url: "https://swe.quest/articles/scaling-scientific-data-migrating-benchling-s-schema-model-for-performance-at-eb9ad927a91c702e"
canonical: "https://benchling.engineering/scaling-scientific-data-migrating-benchlings-schema-model-for-performance-at-scale-2a91cf971040"
source: "Benchling Engineering"
published: "2024-12-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["postgres","schema-migrations","performance","scalability"]
---

# Scaling Scientific Data: Migrating Benchling’s Schema Model for Performance at Scale

A post on [Benchling Engineering](https://swe.quest/sources/benchling.md), published 2024-12-04, 10 min read, Case study. Original: [https://benchling.engineering/scaling-scientific-data-migrating-benchlings-schema-model-for-performance-at-scale-2a91cf971040](https://benchling.engineering/scaling-scientific-data-migrating-benchlings-schema-model-for-performance-at-scale-2a91cf971040)

## Summary

Benchling replaced its PostgreSQL entity-attribute-value (EAV) storage for schema field values with a single JSONB column per entity, cutting row counts and per-row overhead that had slowed automated assay-result ingestion. Instead of a GIN index, which would slow inserts, entity linkages live in a separate table keyed by attribute name. The tradeoffs were more row-level lock contention, harder per-field queries and looser typing. The three-year migration ran in stages: dual writes with nightly integrity checks, then switching reads to JSONB, then removing the EAV tables. It produced up to 7x faster ingestion, roughly 2x faster analysis queries, and duplicate checks that dropped from minutes to 10-20 ms.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- relational data modeling
- row-level locking

## Keywords

PostgreSQL, JSONB, Entity-Attribute-Value, GIN index, Benchling

## Related posts

- [Migrating JSONB columns in Go](https://swe.quest/articles/migrating-jsonb-columns-in-go-042317bcb9572fbf.md): incident.io · 2024-07-11 · Medium · 4 min read · Schema migrations, Go, PostgreSQL
  When a JSONB column's shape changes, a custom sql.Scanner and driver.Valuer on the Go column type can read both the old and new formats while always writing the new one. incident.io used this to move conditions from a flat array to an array of condition groups, which was needed to support OR logic.
- [What really matters for performance: lessons from a year of benchmarks](https://swe.quest/articles/what-really-matters-for-performance-lessons-from-a-year-of-benchmarks-0ec8700c872ad4a4.md): ClickHouse · 2025-12-22 · Easy · 7 min read · Analytics & OLAP, Performance engineering, Caching, Databases
  Six ClickHouse benchmarks from 2025 point to one conclusion: performance depends on how efficiently an engine moves data end-to-end.
- [The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more](https://swe.quest/articles/the-billion-docs-json-challenge-clickhouse-vs-mongodb-elasticsearch-and-more-e942a192bad31355.md): ClickHouse · 2025-01-29 · Medium · 28 min read · Analytics & OLAP, Databases, Storage engines, Performance engineering
  JSONBench is a reproducible benchmark that loads up to one billion Bluesky event JSON documents into ClickHouse, MongoDB, Elasticsearch, DuckDB and PostgreSQL, then measures storage size and the speed of five analytical queries.
- [Bloom filters: the niche trick behind a 16× faster API](https://swe.quest/articles/bloom-filters-the-niche-trick-behind-a-16-faster-api-f8c936f8ee9c7bb2.md): incident.io · 2025-11-14 · Medium · 16 min read · PostgreSQL, Data structures, Performance engineering, API design
  incident.io cut P95 latency of its alert-filtering API for large organisations from 5s to 0.3s by pushing JSONB attribute filters into Postgres using bloom filters.
- [Top 3 features in Postgres 17](https://swe.quest/articles/top-3-features-in-postgres-17-b0d086972cf3cc60.md): Neon · 2024-08-30 · Medium · 5 min read · PostgreSQL, SQL
  Postgres 17 adds RETURNING support to MERGE (with a merge\_action() function that reports whether each row was inserted, updated or deleted), SQL/JSON functions including JSON\_TABLE for turning JSON into relational rows, and performance work.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
