Lately, Deichmann revealed a buyer story describing how Lakebase enabled seamless omnichannel advertising and marketing. This weblog covers the technical aspect of the story.
Each retail firm must leverage knowledge to ship personalised, high-performance advertising and marketing campaigns. Nonetheless, we see some inefficiencies throughout the business:
- Corporations pay for underutilized database assets: buyer segments used for personalised campaigns are sometimes saved in an OLTP database from which advertising and marketing instruments learn them. When advertising and marketing campaigns are launched, there’s a spike in database requests, however in any other case, database utilization is low.
- Advertising groups’ altering wants add an operational burden to knowledge groups: knowledge practitioners create new buyer segments within the Lakehouse, and each new request from Advertising ends in a package deal of synchronization Lakehouse-to-OLTP pipelines to create, preserve, and monitor.
A lakebase is a brand new, open structure that mixes the very best components of transactional databases with the pliability and economics of the info lake. Databricks Lakebase Postgres, our implementation of the lakebase structure, solves these issues:
- By separating storage from compute, knowledge will be saved cheaply in object shops with out scaling compute linearly. It means the quantity and variety of buyer attributes can enhance considerably with out requiring extra compute assets. As knowledge grows however database visitors doesn’t, Lakebase prices stay decrease than these of conventional OLTP databases.
- Powered by an elastic, serverless Postgres compute, Lakebase scales up immediately with demand and scales down when idle in lower than a second. Prices align straight with utilization, making it superb for bursty workloads like scheduled advertising and marketing campaigns. Lakebase clients pay just for the assets they want, decreasing prices and eliminating the necessity to dimension and plan their compute forward of time.
- By integrating seamlessly with the Lakehouse, the synchronization between Lakebase and the Lakehouse is absolutely managed, dependable, and environment friendly, taking the burden of pipeline creation and upkeep off Information Practitioners.
Integrating Lakebase with SAP Engagement Cloud
For instance the advantages of utilizing Lakebase because the backend database for our advertising and marketing marketing campaign platform, we’ll present the right way to combine Lakebase with SAP Engagement Cloud, an omnichannel advertising and marketing platform, and launch a personalised advertising and marketing marketing campaign primarily based on buyer segments beforehand created within the Lakehouse.
Step 1: Create and configure a brand new Lakebase venture
We arrange our Postgres occasion by creating a brand new Lakebase Autoscaling venture. A venture is the top-level container for our database assets. A newly created venture features a manufacturing database, which would be the PostgreSQL occasion that SAP Engagement Cloud connects to.
Advertising campaigns depend on time-based triggers. When a marketing campaign is triggered, SAP Engagement Cloud queries the database to retrieve prospects that meet the desired standards. These mechanics induce periodic spikes inside prolonged lows. Because of this, for compute, we scale to 0 for the prolonged lows, eliminating compute prices for these durations, and set a medium capability of 16 CU (~32 GB RAM) as the utmost for the spikes. Even when the chosen reminiscence vary is comparatively massive, Lakebase autoscaling velocity and reactivity remove the chance of useful resource underutilization, which lowers TCO and reduces the necessity for sizing and provisioning our database.

As soon as the Lakebase compute has been set, we have to create the required roles for SAP Engagement Cloud. Lakebase helps OAuth roles for Databricks identities and Native Postgres password roles. As a result of Engagement Cloud can’t deal with the hourly token rotation occurring for OAuth roles, we’ll use native Postgres roles. Postgres roles will be created in varied methods; we’ll use the Lakebase UI to generate a high-entropy password. Seize the password instantly and retailer it in a secret supervisor. We suggest rotating passwords by producing new ones on a daily schedule.
We then grant the required permissions to the newly created SAP Engagement Cloud Postgres position for our schema used for our synchronized buyer segments by operating these instructions within the Lakebase SQL console.
Step 2: Join SAP Engagement Cloud to Lakebase
SAP Engagement Cloud requires a CA certificates to connect with a PostgreSQL occasion. Lakebase makes use of certificates issued by Let’s Encrypt, so the required root certificates is ISRG Root X1.
We are able to receive the foundation certificates with:
We are able to examine the exported certificates to substantiate it is right:
When configuring our new PostgreSQL connection in SAP Engagement Cloud, we’ll paste the contents of this file when prompted for a CA certificates.
Step 3: Synchronize the client segments with Lakebase
With the connection and position created, we are able to synchronize our buyer segments from the Lakehouse to Lakebase. For this, we have to create a synced desk from the desk to synchronize. Databricks Synced Tables create a managed copy of our Unity Catalog knowledge in Lakebase, making it obtainable to functions that want OLTP-style, low-latency queries.
A number of synchronization modes can be found: snapshot, triggered, and steady. In our case, and fairly often, buyer segments are recomputed nightly in batch, changing a good portion of the dataset. When greater than 10% of the info is up to date, we suggest snapshot mode, which delivers 10x higher efficiency than triggered mode. From there, a managed pipeline is created, and the info is synchronized. Making new buyer segments obtainable to Engagement Cloud now takes only a few clicks, accelerating time to market and decreasing operational burden.

Moreover, on account of Lakebase separation of compute and storage, the dimensions and variety of the obtainable knowledge for Engagement Cloud can develop with out having to scale compute assets like in classical databases, retaining prices low. Nonetheless, it’s vital to remember the fact that Databricks Lakebase is optimized for high-concurrency level lookups and quick OLTP queries, not for big scans or traditional OLAP.
Synchronize Operational Information to the Lakehouse
Past the generated buyer segments, advertising and marketing campaigns can incorporate knowledge from different functions. As an illustration, clients would possibly signal as much as obtain notifications about product restocks or new arrivals in a selected class or model. Functions can use Lakebase as an ordinary Postgres database to retailer this notification knowledge, making it obtainable to Engagement Cloud for marketing campaign focusing on. Any knowledge written to Lakebase can then be synchronized to the Lakehouse for analytics by way of Lakehouse Sync—a local, steady CDC-based pipeline from Lakebase Postgres to Unity Catalog Delta tables that makes operational knowledge obtainable for richer analytics and AI.
Efficiency Optimization
Lakebase is Postgres, and we are able to optimize efficiency equally to a classical Postgres database.
Constructing indexes is likely one of the best, most impactful, and customary optimizations. When advertising and marketing campaigns are triggered, SAP Engagement Cloud fires queries to retrieve buyer IDs filtered by a WHERE clause.
Create an index primarily based on this filtering situation. Indexes will be created in Lakebase by writing within the Lakebase SQL console:
Within the case of SAP Engagement Cloud, indexes ought to already give us the efficiency we’d like. If extra optimizations are required, we should always first establish the longest and most frequent queries utilizing pg_stat_statements or utilizing the Databricks Lakebase UI, which offers the queries’ efficiency and a set of metrics to watch the database.

The longest and most problematic queries will be analyzed utilizing:
PREFETCH and FILECACHE are particular to Lakebase and present, respectively, what number of prefetch requests have been issued/hit/wasted and what have been the hits/misses in opposition to the Native File Cache (LFC). Databricks Lakebase UI additionally offers a helpful interface to run these analyses.

From there, we might discover extra optimization choices like:
- Altering the configuration of work_mem – bumping it as much as 256 MB for bigger compute will be helpful.
- Tune autovacuum_vacuum_scale_factor decrease on tables with a excessive churn charge, look ahead to bloat with pg_stat_user_tables.
Conclusion
Lakebase, with its distinctive expertise and tight integration with the Lakehouse, can present low-latency serving of buyer segments created by analytical and AI workloads.
Lakebase drastically reduces TCO by aggressively autoscaling and scaling to zero when assets are unused, eliminating prices for idle assets.
Lakebase’s integration with the Lakehouse removes the operational burden of sustaining synchronization pipelines, slashes the time to marketplace for new buyer segments, and permits extra personalised advertising and marketing campaigns, driving better engagement in a shorter time frame.
Able to modernize your advertising and marketing stack? Strive Databricks Lakebase Postgres right now and see how serverless OLTP mixed with the Lakehouse can lower your TCO and speed up marketing campaign supply. Go to the Databricks Lakebase product web page, learn the Deichmann buyer story, or contact your Databricks account workforce to scope a proof of idea tailor-made to your advertising and marketing marketing campaign workloads.
