Technology

Databricks killed the foreach writer, mostly

Databricks GAed its Lakebase streaming sink, but limits on pipelines, serverless and sizing remain.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

2 min read

Streaming pipeline upserting user features into Lakebase Postgres
Credit: Databricks

Key facts

  • Native Lakebase sink is GA on Databricks Runtime 18 LTS and above
  • Test upserted 20K events per sec across 5 million users with P99 354 ms

Databricks made its native Lakebase sink for Spark Structured Streaming generally available.

The obvious read is that custom foreach writers are dead. I do not buy that yet. Databricks says one writeStream call now handles batching, pooling, retries with backoff and upserts, and it is a clean fix for weeks of glue code. That is true for the happy path.

The limits are real and they are in the fine print. The sink is not supported in Lakeflow Declarative Pipelines, Databricks says, and Real-Time Mode triggers run on classic compute while serverless must use Trigger.AvailableNow. Merge strategies need Databricks Runtime 19 and above, and writes to external Postgres over format("postgresql") remain in Public Preview. Those carveouts decide many architectures.

The strongest case for the sink is operational, not theoretical. Maria Marinova, Sr. Lead Software Engineer at DraftKings, which streams activity into Lakebase for a risk agent, said the native sink "reduces the custom work required for connection pooling, batching, and retries." Databricks backed that with a sustained test at 20K events per sec across 5 million users for one hour, reporting P50 183 ms and P99 354 ms end to end from Kafka timestamp to Lakebase, with 63.5 million upserts.

For that obvious reading to hold, throughput has to survive state growth and key contention. Databricks says Real-Time Mode is a Spark Structured Streaming trigger that processes records as they arrive for millisecond end to end latency, which explains the 100 to 200 ms sink step in its video feature demo. The demo still used synthetic data replayed into Kafka on a 40-core classic cluster writing to an 8-CU Lakebase project, and Databricks warns your numbers will differ with rate, state, cluster and Lakebase size. That caveat is fair, and it puts sizing work back on you.

Do not rewrite your path until you have load tested your keys, your conflicts and your retries. If you run classic compute on Databricks Runtime 18 LTS and above with Unity Catalog tables, try it.

Sources

TopicsDatabricksLakebaseSpark Structured StreamingDraftKingsReal-Time ModeUnity CatalogPostgreSQL

StartupHub.ai StaffDaniel SingerWritten by StartupHub.ai Staff, Editorial teamReviewed by Daniel Singer, EditorAbout

StartupHub.ai Staff, Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer, Editor

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

More from Daniel Singer

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.