r/SQL 19h ago

Discussion Anyone using Lakebase with SQL heavy apps ?

How do u handle query performances when the same tables are being hit by both app queries and AI generated SQLs from any AI tools such as Codex, CLaude, Genie etc
Curious if you separate workloads or optimize at the query level.

2 Upvotes

5 comments sorted by

1

u/WorldOfUmbro 19h ago

Curious to hear your use case? Do you already have Lakebase in any of these coding agents? Genie will use Lakehouse to query. Agents probably too, maybe Lakebase for memory.

1

u/shdw_0x0 18h ago

I’d lean toward separating the workloads rather than trying to optimize every AI-generated query. AI SQL can be unpredictable, so giving it a read-only/limited workload makes it much easier to protect the app’s latency.

1

u/Einar_Son_of_Bjorn 14h ago

Don’t tune the AI SQL first. Split the traffic.App queries want short, indexed, stable plans. Codex/Claude/Genie will throw scans and SELECT * at the same tables. One pool, one victim: the app.If you must stay on Lakebase: app on the primary role, AI on a replica or a locked-down user with a statement timeout. Same credentials for both is the failure mode.If the app is ordinary OLTP and the lake is only there because that’s where Databricks put it, MariaDB is the boring split: primary for the product, replica or a second user for generated SQL, timeouts on the AI login. You keep the operational database from becoming a notebook backend. You do not get Genie or Unity Catalog in the bargain - that’s the trade.Is Lakebase the system of record for the app, or already a copy next to the warehouse?

1

u/mmccarthy404 8h ago

I mean aren't all Lakebase backends SQL heavy 😄

I've been able to use Lakebase as a quick and dirty backend for some smaller analytics apps that likely would have performed better in Lakehouse, but since these apps were transactional in nature, I wanted to keep my infrastructure footprint small, and it performed fine for my use case! Once LTAP is more ironed out, I can move the analytics portions over much more easily, but haven't had the time to look into it yet

1

u/Glitch_In_The_Data 6h ago

If AI traffic is frequent but small and indexed, it may be a reasonable option to share Lakebase but with some guardrails.

If it’s scan heavy, unpredictable workload, I would route it to the warehouse against a synced delta tables… especially if there are latency sensitive applications that are dependent on the data. It can help avoid competing against the lakebase compute.