cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Lakebase Discussions
Ask questions, share challenges, and connect with others working on Lakebase. From troubleshooting to best practices, this is where conversations happen.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling a Lakebase project API directly from an web frontend

Sega2
New Contributor III

Today we have an web frontend and custom API that we call from the frontend. I can see Lakebase projects support an API and SQL over REST. And we are considering whether skipping the custom API and calling the Lakebase API directly. However I see some places there are security concerns regarding this. Any recommended practices or exeprience that can be shared in this matter?

1 REPLY 1

Ashwin_DSA
Databricks Employee
Databricks Employee

Hi @Sega2,

I don't there are many patterns or approaches published widely yet. In general, though, for production web apps, you may want to consider something like frontend --> thin backend --> Lakebase rather than calling Lakebase Data API directly from browser. 

The reasons are mostly standard webโ€‘security concerns... You donโ€™t want OAuth tokens with broad database access in the browser, and that's where a think backend gives you a place to centralise auth, rate limiting, input validation, and query shaping. 

If you do use the Lakebase Data API from a web client, just make sure you follow the best practices recommended in the Lakebase API documentation.

Attached a snapshot below for reference.

Lakebase security practices.png

If this answer resolves your question, could you mark it as โ€œAccept as Solutionโ€? That helps other users quickly find the correct fix.

Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***