<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mahdi Askari on Medium]]></title>
        <description><![CDATA[Stories by Mahdi Askari on Medium]]></description>
        <link>https://medium.com/@boghbogh?source=rss-abf80fcb1af5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vdDkHZrLWGnJViro45V1JQ.png</url>
            <title>Stories by Mahdi Askari on Medium</title>
            <link>https://medium.com/@boghbogh?source=rss-abf80fcb1af5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:32:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@boghbogh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Two Years at Snowflake: Culture, Customers, and the AI Revolution]]></title>
            <link>https://medium.com/@boghbogh/two-years-at-snowflake-culture-customers-and-the-ai-revolution-7eb2a2a98733?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7eb2a2a98733</guid>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 20:04:31 GMT</pubDate>
            <atom:updated>2025-12-22T20:36:19.624Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s hard to believe it has already been two years since I joined Snowflake. As I hit this milestone, I’ve been reflecting on the journey so far — the rapid evolution of AI, the incredible people I work with, and the genuine joy I find in my role. Looking back at where I was two years ago and where I am now, the difference is night and day. I wanted to share a few thoughts on what makes this place special and why I’m more excited than ever about the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8S0-9g35u_VbNpDkVYOBw@2x.jpeg" /></figure><h3>The Field CTO Role: Bridging Strategy and AI Across APJ</h3><p><em>(Although we are NOT called Field CTO anymore, I have an emotional attachment to the title!! so.. 🤷‍♂!)</em></p><p>People often ask me, “What does a Field CTO actually do?” It’s a unique intersection of technology, strategy, and business vision. My focus here is on Data and, increasingly, AI. My job isn’t just about explaining <em>how</em> the technology works, but <em>why</em> it matters for business transformation.</p><p>One of the most rewarding aspects of my role is the scope. As an APJ resource, I have the privilege of engaging with diverse markets across the Asia Pacific and Japan region. One day I might be discussing Generative AI governance with a bank in Australia, and the next, I’m strategizing on LLM deployment with a manufacturer in Japan or a retailer in India. This exposure to different industries and cultures keeps me sharp and constantly learning. It’s not just a desk job; it’s a role that connects me to the pulse of AI innovation across half the globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1872vkiCpn2GhwfLFkhE2Q@2x.jpeg" /></figure><h3>Customers Who Move Fast (and a Platform That Lets Them)</h3><p>One of the biggest refreshers coming to Snowflake has been the interactions with our customers. There is a palpable energy here. Our customers are friendly, collaborative, and, most importantly, they move <em>fast</em>.</p><p>In my past experiences at my previous employer, conversations were often dominated by infrastructure headaches. We spent a lot of time “firefighting” — trying to keep the lights on, debugging clusters, and managing complexity just to get to the starting line. It felt like we were constantly battling the tool rather than using it.</p><p>At Snowflake, the dynamic is completely different. Because the platform just works, we skip the maintenance talks and go straight to value creation. We aren’t bogged down by “keeping it running”; we are focused on “getting stuff done.” It is incredibly satisfying to see customers actually deploying AI solutions rather than just troubleshooting the infrastructure beneath them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPZ6DmkyHfr4rt-vaN4jvw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZK30BB7XeTELzO3Qn2GKTg@2x.jpeg" /></figure><h3>Culture: Collaboration Without Borders</h3><p>A lot of companies put “collaboration” on a poster on the wall, but at Snowflake, it is woven into the fabric of the organization. The culture here is defined by high morale and a genuine “One Team” mentality.</p><p>In the APJ region specifically, cross-border collaboration is the norm, not the exception. There is a profound sense of psychological safety here; you can ask for help in a public channel and get five answers from experts in three different time zones within minutes. We recently brought the entire APJ technical team together for our “Tech Up” event in Singapore. The energy was electric. It wasn’t just about training; it was about celebrating our wins and strengthening those human connections. It is rare to see a technical team with such high morale, united by a shared mission rather than internal competition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4GCVQPU30lFutThHKM8quA@2x.jpeg" /></figure><h3>My Team: Small Squad, Big Impact</h3><p>I cannot write this post without a special shout-out to my immediate team. The Field CTO office is a specialized, lean group, but the impact we drive is massive.</p><p>To my fellow FCTOs: thank you. It is rare to find a group this talented that is also this supportive. We challenge each other to be better, but we always have each other’s backs. Whether it’s sharing insights from a difficult customer meeting or just being a sounding board for new ideas, your support makes the “field” feel a lot less lonely. I deeply appreciate the camaraderie and the trust we have built; it’s a privilege to run alongside you all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFh5_A2Mt9QLnI7Ck8Z5VQ@2x.jpeg" /></figure><h3>Valuing the Human Element</h3><p>Perhaps the most profound difference I’ve felt over the last two years is the philosophy regarding people. I’ve worked in environments previously where the core value was explicitly “Company First.” While that might sound noble in a boardroom, in practice, it often translated to a harsh reality where employees felt like transactional resources — squeezed for output until they burned out. It created a culture where you felt you had to earn your right to exist every single day.</p><p>Snowflake flips the script. Here, the philosophy is that if you take care of your people, the company thrives naturally. “Employee First” isn’t just a slogan; it’s felt in how leadership engages with us, how our time is respected, and how our wins are celebrated. I feel valued not just as a “Field CTO” or a unit of productivity, but as a person. That support allows me to do the best work of my career, and it’s the main reason I’m still smiling two years in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pvsT3xPEbAPQSz7YfadYVw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HvRsL8fZ6tJV1x8-_01lhg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xJbIS5de_0f0e3Sm9LfPPQ@2x.jpeg" /></figure><h3>And what comes next?</h3><p>As I sit here in seat 5C, embarking on my last trip of the year to Sydney, I’ve been trying to organize my thoughts on this two-year milestone. If I spit out what is in my head ( I do this often!!!), it comes down to this: I have found a home here. I am happy. I feel like I belong. For the first time in a long time, I have surrounded myself with people I don’t just tolerate working with, but people I genuinely want to hang out with and call friends.</p><p>So here is my simple plan:</p><ul><li>Buy another jacket!! Every damn photo is with that blue jacket. Seriously!!! Go buy another jacket!</li><li>Win more business and have fun while doing it!</li></ul><p>That should cover all basis!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*zd7TQbByWCSBw-lNd7hp4w@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7JbMeFDHzWWdk8Ep9W4PQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hD6RYndePID9JjdapE8uOw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*PpgWHo9cVF1B3zUaAW26Aw@2x.jpeg" /></figure><p>Over and out!</p><p>Mahdi</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7eb2a2a98733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Model Registry- The Easy Button for Self-hosted LLMs in Snowflake Data Cloud & AI Cloud]]></title>
            <link>https://medium.com/@boghbogh/snowflake-model-registry-the-easy-button-for-self-hosted-llms-in-snowflake-data-cloud-ai-cloud-ad10e21b284b?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad10e21b284b</guid>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 20:18:31 GMT</pubDate>
            <atom:updated>2025-12-12T02:33:55.244Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jImHmYFUmks-Bq8llKwdgA.png" /></figure><p><em>First things first: a huge thank you to </em><strong><em>@pavithranrao.1512 </em></strong><em>, </em><strong><em>@avinash.joshi_26600 </em></strong><em>, and </em><strong><em>@sumit.das_56970</em></strong><em> from the Snowflake Product and Engineering team. I truly appreciate the time they took to provide input, test the code, and review this content — not to mention their hard work in building the feature itself!</em></p><h3>Maximising GenAI ROI: Hosting Open Source Models on Snowflake with vLLM</h3><p>As Generative AI moves from “experimental” to “mission-critical,” the question for many data teams is no longer <em>if</em> they should use LLMs, but <em>how</em> to deploy them efficiently. While commercial APIs like GPT-5 and Claude are powerful, a new paradigm is emerging: hosting open-source models directly within your data platform.</p><p>In this post, we’ll explore why you should bring the model to your data, how Snowflake Container Services (SPCS) makes this possible, and the specific architectures (like vLLM) required to make it fast and cost-effective.</p><h3>Tokens vs. GPUs!!: Why Host Open Source?</h3><p>The default path for many is to call a commercial API (OpenAI, Anthropic). While convenient, this “Token” model has three distinct downsides for enterprise workloads:</p><ol><li><strong>Cost Scalability:</strong> With commercial APIs, you pay <strong>per token</strong>. As your usage scales from thousands to millions of transactions, your costs scale linearly and indefinitely.</li><li><strong>Data Privacy:</strong> Sending sensitive PII or proprietary data to an external API endpoint often violates strict compliance/security governance.</li><li><strong>The “Generalist” Tax:</strong> Commercial models are massive “know-it-all” generalists. Often, a smaller open-source “expert” model (like Llama 3 8B or Mistral), fine-tuned on your specific data, can perform <em>your</em> specific task (e.g., summarizing <em>your</em> financial reports) faster and more accurately than a generic giant.</li></ol><h4>The “GPUs” Advantage</h4><p>When you host a model on Snowflake, you flip the financial model. You pay for the infrastructure (Compute), not the tokens. If you run a GPU 24/7, the cost is fixed, regardless of whether you process 1 million or 100 million tokens. For high-volume workloads, this offers massive ROI.</p><h3>The Engine Room: SPCS and GPU Inference</h3><p>Historically, hosting LLMs required complex external infrastructure (Kubernetes clusters, AWS Sagemaker) that forced data to leave your secure environment.</p><ul><li><strong>Snowflake Container Services (SPCS)</strong> changes this. It allows you to run containerized workloads (Docker images) directly within Snowflake’s security perimeter.</li><li><strong>Compute Pools:</strong> These are collections of virtual machines that power your containers. Crucially, Snowflake offers <strong>GPU-accelerated</strong> compute pools (using NVIDIA A10s and A100s) specifically designed for AI inference</li><li><strong>Zero Data Movement:</strong> Because the container runs inside Snowflake, your LLM can query your Snowflake tables directly without the data ever traversing the public internet.</li></ul><p><strong>Reference:</strong> For a deep dive on the architecture, see the<a href="https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/container"> Snowflake Container Services Documentation</a>.</p><h3>Ollama vs. vLLM: Selecting the Right Inference Engine</h3><p>If you try to run Llama 3 using standard “Hugging Face Transformers” Python code, it will likely be too slow for production. This is where <strong>vLLM</strong> comes in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uyozbb0-Juit2yc1CHTihQ.png" /><figcaption><strong>Verdict:</strong> For production SPCS deployments, always wrap your Llama/Mistral models in a <strong>vLLM</strong> container.</figcaption></figure><h3>Sizing Your Hardware: GPUs and Scaling Strategies</h3><p>Before deploying, you must match your model size to the correct Snowflake Compute Pool. If your model doesn’t fit in the GPU’s VRAM (Video RAM), it simply won’t run. Use a calculator like <a href="https://apxml.com/tools/vram-calculator">https://apxml.com/tools/vram-calculator</a> to estimate VRAM usage. Rough Rule of Thumb: Parameters (Billions) × 2 = GB of VRAM needed (FP16).</p><h4>Strategy A: Single GPU (1 Node, 1 GPU)</h4><ul><li><strong>Use Case:</strong> Small models (&lt; 15B Params).</li><li><strong>Snowflake Compute Pool:</strong> GPU_NV_S (1x NVIDIA A10G, 24GB VRAM).</li><li><strong>vLLM Config:</strong> No special flags needed.</li><li><strong>Best For:</strong> Llama 3 8B, Mistral 7B, Gemma 7B.</li></ul><h4>Strategy B: Single Node, Multi-GPU (Tensor Parallelism)</h4><ul><li><strong>Use Case:</strong> Medium/Large models (70B Params). The model is too big for one card, but fits on one server.</li><li><strong>Snowflake Compute Pool:</strong> GPU_NV_M (4x NVIDIA A10G) or GPU_NV_L (8x NVIDIA A100).</li><li><strong>vLLM Config:</strong> — tensor-parallel-size 4 (or 8).</li><li><strong>How it works:</strong> vLLM splits the model weights across the cards. They talk over fast NVLink connections.</li><li><strong>Best For:</strong> Llama 3 70B, Mixtral 8x7B.</li></ul><h4>Strategy C: Multi-Node, Multi-GPU (Massive Scale)</h4><ul><li><strong>Use Case:</strong> Extremely large models (e.g., Llama 3.1 405B) that exceed the memory of a single 8-GPU node.</li><li><strong>Status:</strong> <strong>Out of Scope for this guide.</strong></li><li><strong>Why?</strong> Deploying models at this scale requires orchestrating a complex distributed cluster (typically using Ray), managing advanced pipeline parallelism, and ensuring ultra-low latency networking between machines. This requires specialized hardware configurations and operational overhead that is unnecessary for the vast majority of enterprise use cases.</li></ul><h3>The Deployment: The “Easy Button” with Snowflake Model Registry</h3><p>Traditionally, deploying a model to a container service like SPCS was a multi-step “DevOps” heavy process. You had to:</p><ol><li>Manually write a Dockerfile.</li><li>Build and push the image to a repository.</li><li>Write a complex YAML specification file.</li><li>Execute SQL commands to create the service.</li></ol><h4><strong>Enter the Snowflake Model Registry</strong></h4><p>The Model Registry abstracts nearly all of this complexity. Instead of wrangling Docker and YAML, you can deploy your model directly from Python code. When you call the deployment API, Snowflake automatically builds the container, sets up the endpoints, and launches the service on your GPU pool — all “behind the scenes.”</p><h4>Option: The “Click-Ops” Alternative vs. The Python Advantage</h4><p>Before diving into the code, it is worth noting that Snowflake also offers a no-code UI path for this. As detailed in the recent engineering blog,<a href="https://medium.com/snowflake/scaling-price-performant-ai-inference-with-snowflake-ba850001ed43"> Scaling Price-Performant AI Inference with Snowflake</a>, you can often deploy standard Hugging Face models directly through the Snowsight web interface.</p><p>The rest of this post covers the <strong>“Low-Code” Python approach below.</strong> Why? Currently, the UI is excellent for standard deployments, but if you need to pass specific, advanced arguments to the vLLM engine (such as tuning the gpu_memory_utilization, max_model_len, or specific quantisation configs), the Python SDK is required. While these advanced configuration options are on the roadmap for the UI, the Python create_service function gives you full control <em>today</em> to optimise your inference engine for maximum throughput.</p><p>Here is how you can go from a model on Hugging Face to a live inference endpoint in Snowflake in just a few lines of Python code.</p><h4>Step 1: Connect and Log the Model</h4><p>First, we reference the model we want to use. The Registry allows you to log models directly from Hugging Face. If you have direct access to HF and have set up your external access, you can directly access the model, log it in to the model registry.</p><pre># Pick your model of choice from HF<br>import huggingface_hub<br>from snowflake.ml.model import HuggingFacePipelineModel<br>from snowflake.ml.model import openai_signatures<br>from snowflake.ml.utils import connection_params<br>from snowflake.snowpark import Session<br>from snowflake import snowpark<br>from snowflake.ml.registry import registry as registry_module<br>from snowflake.ml.utils.connection_params import SnowflakeLoginOptions<br>model = &quot;Qwen/Qwen3-30B-A3B&quot;<br>model_ref = HuggingFacePipelineModel(<br>   model=&quot;Qwen/Qwen3-30B-A3B&quot;,<br>   task=&quot;text-generation&quot;,<br>)<br># Get a reference to model registry <br>session = session = get_active_session()<br>assert session is not None<br>registry = registry_module.Registry(<br>   session=session,<br>)<br>assert registry is not None<br># Log your model into model registr<br>model_name = &quot;Qwen3_30B_A3B_model_final&quot;<br>mv = registry.log_model(<br>   model=model_ref,<br>   model_name=model_name,<br>   signatures=openai_signatures.OPENAI_CHAT_SIGNATURE<br>)<br>mv</pre><p>For environments with strict security or networking restrictions (such as air-gapped networks), direct access to the Internet or Hugging Face might be blocked. In these scenarios, you can use a cross-environment approach: pre-download the model in an environment with internet access (e.g., your local machine or a Dev account), and then switch sessions to log the model into the restricted Snowflake environment. The code below demonstrates how to download a model to your local cache and subsequently log it to a registry that lacks external connectivity.</p><pre>model = &quot;Qwen/Qwen3-30B-A3B&quot;<br>cache_dir = &quot;Qwen/Qwen3_30B_A3B&quot;<br>repo_snapshot_dir = huggingface_hub.snapshot_download(<br>   repo_id=model,<br>   cache_dir=cache_dir,<br>)<br><br>model_ref = HuggingFacePipelineModel(<br>   model=&quot;Qwen/Qwen3-30B-A3B&quot;,<br>   task=&quot;text-generation&quot;,<br>   download_snapshot=False,<br>)<br>assert model_ref.repo_snapshot_dir is None<br>model_ref.repo_snapshot_dir = repo_snapshot_dir<br>assert not model_ref.repo_snapshot_dir is None</pre><h4>Step 2: Deploy with create_service</h4><p>This is the magic command. The create_service method takes your registered model and deploys it to SPCS. You simply tell it which Compute Pool to use and how many GPUs you need.</p><pre><br>## Take Note of model version printed after logging the model and update the model version in next line! <br>#### TO DO #####<br>model_name = &quot;QWEN3_30B_A3B_MODEL_FINAL&quot;<br>version_name = &quot;WICKED_BADGER_1&quot;<br>mv = registry.get_model(model_name).version(version_name)<br>from snowflake.ml.model.inference_engine import InferenceEngine<br><br><br>mv.create_service(<br>   service_name=&quot;Qwen3_30B_A3B_service_vLLM&quot;,   <br>   service_compute_pool=&quot;MAHDI_GPU_COMPUTE_POOL&quot;,  # Pick a compute pool name with GPU<br>   gpu_requests=&quot;4&quot;,  # 4 if the compute pool has 4 GPUs<br>   ingress_enabled=True,  # set a False if you don&#39;t want to create a service endpoint<br>   image_repo=&quot;MAHDI_PLAYGROUND.LLMS.Qwen3_30B_A3B_image_repo&quot;,  # Optional: specify a container services image repo name<br>   inference_engine_options={<br>       &quot;engine&quot;: InferenceEngine.VLLM,<br>       &quot;engine_args_override&quot;: [<br>            &quot;--tensor-parallel-size=4&quot;,<br>            &quot;--gpu-memory-utilization=0.85&quot;,<br>            &quot;--max-model-len=1024&quot;,<br>            &quot;--max-num-seqs=2&quot;<br>       ],<br>   },)</pre><h4>What happens behind the scenes?</h4><p>When you run create_service, Snowflake performs the following actions automatically:</p><ul><li><strong>Containerization:</strong> It dynamically generates a Docker image containing your model, the correct Python environment (Conda), and the inference server logic.</li><li><strong>Image Registry:</strong> It builds and pushes this image to your internal Snowflake image repository — <strong>when required! </strong>. When using vLLM engine the `create_service` skips the build step as the image in system repo is enough to start the inference server. Building inference image usually takes about 15 mins which is saved when using vLLM.</li><li><strong>Service Creation:</strong> It generates the necessary service specification and executes the CREATE SERVICE command on the Compute Pool you specified.</li></ul><p>By using the Model Registry, you effectively skip the “infrastructure plumbing” and focus purely on the model and the application logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYLlA6shkEsqPMo5IVQRcw.png" /><figcaption><strong>Model Registry</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-G9KPkLaWcgZaQagfjjFTw.png" /><figcaption><strong>Inference Service</strong></figcaption></figure><h4>Step 3: Inference Time!</h4><pre>import openai<br>client = openai.OpenAI(base_url=url, api_key=&quot;not_a_real_key&quot;)<br>services_df = mv.list_services()<br>services_df<br><br>endpoint = services_df.iloc[-1][&quot;inference_endpoint&quot;] # change index if the model has more than once service<br><br>## v1 is the current version of inference endpoint for Open AI compatible APIs<br>## no relation with model versioning in Snowflake ML Registry<br>url = f&quot;https://{endpoint}/v1&quot;<br>url<br><br><br>## in next line, you don&#39;t need an actual key from openai. <br>## You can pass any string.. <br>## the Snowflake PAT is what it is being used for authentication. <br>client = openai.OpenAI(base_url=url, api_key=&quot;not_a_real_key&quot;)<br><br><br>pat = &quot;.........&quot;<br><br>#model_name=&quot;Qwen3_30B_A3B_model_final&quot;<br>## CASE SENSITIVE!!!!!<br>model_name=&quot;QWEN3_30B_A3B_MODEL_FINAL&quot;<br>messages = [<br>   {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are a helpful assistant. Answer in a concise manner.&quot;},<br>   {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Who is your creator??&quot;},<br>]<br><br>completions = client.chat.completions.create(<br>   model=model_name,<br>   messages=messages,<br>   extra_headers={&quot;Authorization&quot;: f&#39;Snowflake Token=&quot;{pat}&quot;&#39;},<br>   max_completion_tokens=250,<br>)<br>completions</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2dUz1bUagZAHcg7jpeU1A.png" /><figcaption><strong>Sample Output</strong></figcaption></figure><p>If you had the data in a table, you can use the following SQL snippet to run inference as a batch inference:</p><pre>-- input table with questions in string format<br><br>CREATE OR REPLACE TABLE llm_input_table (question VARCHAR);<br>INSERT INTO<br>    llm_input_table (question)<br>VALUES<br>    (&#39;What is the capital of France?&#39;),<br>    (&#39;What is the capital of India?&#39;),<br>    (&#39;What is the capital of Italy?&#39;);<br><br>-- service function call<br><br>with chat_inputs as (<br>    select<br>        array_construct(<br>            object_construct(<br>                &#39;role&#39;,<br>                &#39;system&#39;,<br>                &#39;content&#39;,<br>                &#39;You are a helpful assistant.&#39;<br>            ),<br>            object_construct(<br>                &#39;role&#39;,<br>                &#39;user&#39;,<br>                &#39;content&#39;,<br>                question<br>            )<br>        )::ARRAY as messages,<br>        0.9::FLOAT as temperature,<br>        100::NUMBER as max_completion_tokens,<br>        NULL::ARRAY as stop,<br>        1::NUMBER as n,<br>        False::BOOLEAN as stream,<br>        0.9::FLOAT as top_p,<br>        0.9::FLOAT as frequency_penalty,<br>        0.1::FLOAT as presence_penalty<br>    from<br>        llm_input_table<br>)<br>SELECT<br>    &lt;SERVICE_NAME&gt; ! __CALL__(<br>        messages,<br>        temperature,        <br>        max_completion_tokens,<br>        stop,<br>        n,<br>        stream,<br>        top_p,<br>        frequency_penalty,<br>        presence_penalty<br>    )<br>from<br>    chat_inputs;</pre><h3>Running it in your account:</h3><p>You can access the complete notebook for this tutorial <a href="https://github.com/boghbogh/randomfiles/blob/main/CUSTOM_LLMS_MODEL_REGISTRY_VLLM_INFERENCE.ipynb"><strong>here</strong>.</a> This workflow is flexible — you can run it natively using <strong>Snowflake Notebooks</strong> (Container Runtime) or locally using your preferred IDE (like VS Code).</p><p><strong>Prerequisites for a successful run:</strong></p><ul><li><strong>Connectivity:</strong> Ensure your environment has outbound access to Hugging Face to download the model.</li><li><strong>Infrastructure:</strong> You must provision a GPU Compute Pool and Image Repository in advance. (I have included the necessary setup SQL in a commented-out cell at the beginning of the notebook).</li><li><strong>Snowflake-ML Version: </strong>1.20</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad10e21b284b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Databricks API Tax, Just because!]]></title>
            <link>https://medium.com/@boghbogh/the-databricks-api-tax-just-because-11da897e3e87?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/11da897e3e87</guid>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 00:23:53 GMT</pubDate>
            <atom:updated>2025-11-12T00:23:53.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khoXdeHAcxpaBGR6mHHcKg.jpeg" /></figure><p>Databricks advertises performance, but for customers not paying close attention, their default settings and UI limitations are silently inflating the bill. If you run bursty SQL workloads on Databricks, you expect your compute to stop quickly when idle. However, the standard user interface (UI) subtly traps customers into paying for more time than necessary.</p><h3>The 5-Minute Illusion and the Cost Trap</h3><p>When configuring auto-termination in the Databricks UI, you’ll notice a common default of <strong>10 minutes</strong> of idle time before shutdown. Many users accept this or try to set it lower, only to be blocked at <strong>5 minutes</strong>.</p><h3>The API Tax: Only for the Experts</h3><p>This isn’t just about technical difficulty; it’s about <strong>opacity</strong>. Databricks pushes cost optimization into the complexity of the API, while the simplified UI allows substantial idle compute time to linger, thereby benefiting their revenue?? or actually what? I am unclear why but.. here is the fix.</p><p>This code snippet iterates through your warehouses and reduces the auto-termination to 1 minute when supported. Non-serverless warehouses are still not supported. <a href="https://github.com/boghbogh/randomfiles/blob/main/ReduceAutoTermination.ipynb">Link to the notebook</a></p><pre><br><br>import requests<br>import json<br>import os<br><br><br>DATABRICKS_HOST = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiUrl().getOrElse(None)<br>DATABRICKS_TOKEN = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().getOrElse(None)<br><br>TARGET_AUTO_STOP_MINS = 1<br><br>HEADERS = {<br>    &#39;Authorization&#39;: f&#39;Bearer {DATABRICKS_TOKEN}&#39;,<br>    &#39;Content-Type&#39;: &#39;application/json&#39;<br>}<br><br>LIST_URL = f&quot;{DATABRICKS_HOST}/api/2.0/sql/warehouses&quot;<br><br><br>def list_warehouses():    <br>    try:<br>        response = requests.get(LIST_URL, headers=HEADERS)<br>        response.raise_for_status()<br>        return response.json().get(&#39;warehouses&#39;, [])<br>    except requests.exceptions.RequestException as e:<br>        print(f&quot;❌ Error listing warehouses: {e}&quot;)<br>        return []<br><br>def update_warehouse_setting(warehouse):<br>    &quot;&quot;&quot;Updates the auto_stop_mins setting for a single warehouse.&quot;&quot;&quot;<br>    warehouse_id = warehouse.get(&#39;id&#39;)<br>    warehouse_name = warehouse.get(&#39;name&#39;)<br>    current_auto_stop = warehouse.get(&#39;auto_stop_mins&#39;)<br>    payload = {<br>        &quot;id&quot;: warehouse_id,<br>        &quot;name&quot;: warehouse_name,<br>        &quot;cluster_size&quot;: warehouse.get(&#39;cluster_size&#39;, &#39;Medium&#39;),<br>        &quot;min_num_clusters&quot;: warehouse.get(&#39;min_num_clusters&#39;, 1),<br>        &quot;max_num_clusters&quot;: warehouse.get(&#39;max_num_clusters&#39;, 1),<br>        &quot;auto_stop_mins&quot;: TARGET_AUTO_STOP_MINS<br>        # Add other configurations (e.g., enable_photon) if they are consistently used<br>    }<br>    <br>    edit_url = f&quot;{DATABRICKS_HOST}/api/2.0/sql/warehouses/{warehouse_id}/edit&quot;<br>    <br>    try:<br>        response = requests.post(edit_url, headers=HEADERS, data=json.dumps(payload))<br>        response.raise_for_status()<br>        print(f&quot;   Success: &#39;{warehouse_name}&#39; updated.&quot;)<br>    except requests.exceptions.HTTPError as err:<br>        print(f&quot;   ❌ Error updating &#39;{warehouse_name}&#39;: Selected Minimum Not Supported&quot;)<br>    except requests.exceptions.RequestException as e:<br>        print(f&quot;   ❌ Network error updating &#39;{warehouse_name}&#39;: {e}&quot;)<br><br><br># --- Main Execution ---<br><br>all_warehouses = list_warehouses()<br><br>if not all_warehouses:<br>    print(&quot;No SQL Warehouses found or failed to retrieve the list. Script finished.&quot;)<br>else:<br>    print(f&quot;Found {len(all_warehouses)} SQL Warehouses to process.&quot;)    <br>    for warehouse in all_warehouses:<br>        update_warehouse_setting(warehouse)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11da897e3e87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Aggregation Policies: Enterprise-Grade Privacy Protection That Databricks Can’t Match]]></title>
            <link>https://medium.com/@boghbogh/snowflake-aggregation-policies-enterprise-grade-privacy-protection-that-databricks-cant-match-5a8f8b66c285?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a8f8b66c285</guid>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 01:14:43 GMT</pubDate>
            <atom:updated>2025-07-16T04:43:54.331Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 3 of our Data Governance Deep-Dive Series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2FAhE4zRSMd2acoD-evyw@2x.jpeg" /></figure><p>Building on our exploration of Snowflake’s superior RBAC architecture and Data Segregation post, this post examines another area where Snowflake demonstrates clear enterprise leadership: aggregation policies.</p><p>While data sharing and analytics have democratized access to information, they’ve also created new privacy challenges. Snowflake’s aggregation policies provide a sophisticated solution that controls what type of query can access data from a table or view, requiring queries to aggregate data into groups of a minimum size to return results, thereby preventing queries from returning information from an individual record.</p><h3>Understanding Aggregation Policies: Privacy by Design</h3><h3>What Are Aggregation Policies?</h3><p>An aggregation policy is a schema-level object that controls what type of query can access data from a table or view. When an aggregation policy is applied to a table, queries against that table must aggregate data into groups of a minimum size in order to return results, thereby preventing a query from returning information from an individual record.</p><p>Think of aggregation policies as intelligent guardrails that automatically enforce privacy protection without requiring manual intervention. They operate at the query execution level, ensuring that even authorized users cannot accidentally or intentionally extract individual records from sensitive datasets.</p><h3>Two Levels of Privacy Protection</h3><p>Snowflake’s aggregation policies support both:</p><p><strong>Row-Level Privacy</strong>: Protects individual records in a dataset from being accessed directly <strong>Entity-Level Privacy</strong>: Protects information about specific entities even when that information spans multiple rows</p><p>This dual approach addresses the complexity of modern data structures where sensitive information might be distributed across multiple records.</p><h3>Real-World Use Cases: Where Aggregation Policies Shine</h3><h3>Healthcare Analytics: HIPAA Compliance Made Simple</h3><p><strong>Scenario</strong>: A hospital system wants to share patient outcome data with research partners while maintaining HIPAA compliance.</p><p><strong>Challenge</strong>: Researchers need aggregate statistics (average recovery times, treatment effectiveness) but must never access individual patient records.</p><p><strong>Solution</strong>: Aggregation policies ensure that queries must aggregate at least 10 patient records, making individual identification impossible while enabling valuable research insights.</p><pre>-- Healthcare aggregation policy<br>CREATE AGGREGATION POLICY healthcare_privacy <br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt; <br>AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 10);<br><br>-- Applied to patient outcomes table<br>ALTER TABLE patient_outcomes SET AGGREGATION POLICY healthcare_privacy;</pre><h3>Financial Services: Customer Privacy Protection</h3><ul><li><strong>Scenario</strong>: A bank wants to provide transaction analytics to business partners while protecting individual customer privacy.</li><li><strong>Challenge</strong>: Partners need spending pattern insights but cannot access individual customer transaction details.</li><li><strong>Solution</strong>: Conditional aggregation policies that allow internal analysts full access while requiring external partners to aggregate customer data.</li></ul><pre>--Conditional financial privacy policy<br>CREATE AGGREGATION POLICY financial_privacy<br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt;<br>CASE<br>WHEN CURRENT_ROLE() IN (&#39;INTERNAL_ANALYST&#39;, &#39;COMPLIANCE_OFFICER&#39;)<br>THEN NO_AGGREGATION_CONSTRAINT()<br>ELSE AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 50)<br>END;</pre><h3>Retail Analytics: Competitive Intelligence Protection</h3><ul><li><strong>Scenario</strong>: A retailer shares sales data with suppliers while protecting competitive intelligence.</li><li><strong>Challenge</strong>: Suppliers need category performance data but shouldn’t access store-level performance details.</li><li><strong>Solution</strong>: Aggregation policies that require minimum store counts for any sales analysis.</li></ul><h3>Educational Data: Student Privacy (FERPA Compliance)</h3><ul><li><strong>Scenario</strong>: Universities sharing academic performance data with education researchers.</li><li><strong>Challenge</strong>: Researchers need demographic and performance correlations while maintaining student anonymity.</li><li><strong>Solution</strong>: Entity-level aggregation policies that protect student identity across multiple academic records.</li></ul><h3>Hands-On Implementation: Complete Working Example</h3><p>Let’s build a comprehensive example that demonstrates aggregation policies in action.</p><h3>Sample Schema Setup</h3><pre>--Create database and schema structure<br>CREATE DATABASE privacy_demo;<br>CREATE SCHEMA privacy_demo.sensitive_data;<br>CREATE SCHEMA privacy_demo.policies;<br>--Create roles for different access levels<br>CREATE ROLE data_analyst;<br>CREATE ROLE external_partner;<br>CREATE ROLE privacy_admin;<br>CREATE ROLE internal_analyst;<br>GRANT ALL PRIVILEGES ON SCHEMA privacy_demo.policies TO ROLE privacy_admin;<br><br>--Sample customer transaction table<br>CREATE TABLE privacy_demo.sensitive_data.customer_transactions (<br>transaction_id VARCHAR(50),<br>customer_id VARCHAR(50),<br>transaction_date DATE,<br>amount DECIMAL(10,2),<br>category VARCHAR(50),<br>store_location VARCHAR(100),<br>customer_age_group VARCHAR(20),<br>customer_income_bracket VARCHAR(30)<br>);<br>--Insert sample data<br>INSERT INTO privacy_demo.sensitive_data.customer_transactions VALUES<br>(&#39;TXN001&#39;, &#39;CUST001&#39;, &#39;2024–01–15&#39;, 125.50, &#39;Electronics&#39;, &#39;New York - Manhattan&#39;, &#39;25–34&#39;, &#39;50K-75K&#39;),<br>(&#39;TXN002&#39;, &#39;CUST002&#39;, &#39;2024–01–15&#39;, 89.99, &#39;Clothing&#39;, &#39;New York - Manhattan&#39;, &#39;35–44&#39;, &#39;75K-100K&#39;),<br>(&#39;TXN003&#39;, &#39;CUST003&#39;, &#39;2024–01–16&#39;, 234.75, &#39;Electronics&#39;, &#39;New York - Brooklyn&#39;, &#39;25–34&#39;, &#39;50K-75K&#39;),<br>(&#39;TXN004&#39;, &#39;CUST004&#39;, &#39;2024–01–16&#39;, 45.20, &#39;Groceries&#39;, &#39;New York - Manhattan&#39;, &#39;45–54&#39;, &#39;75K-100K&#39;),<br>(&#39;TXN005&#39;, &#39;CUST005&#39;, &#39;2024–01–17&#39;, 156.80, &#39;Clothing&#39;, &#39;New York - Queens&#39;, &#39;25–34&#39;, &#39;100K+&#39;),<br>(&#39;TXN006&#39;, &#39;CUST001&#39;, &#39;2024–01–17&#39;, 67.30, &#39;Groceries&#39;, &#39;New York - Manhattan&#39;, &#39;25–34&#39;, &#39;50K-75K&#39;),<br>(&#39;TXN007&#39;, &#39;CUST006&#39;, &#39;2024–01–18&#39;, 298.45, &#39;Electronics&#39;, &#39;New York - Brooklyn&#39;, &#39;35–44&#39;, &#39;100K+&#39;),<br>(&#39;TXN008&#39;, &#39;CUST007&#39;, &#39;2024–01–18&#39;, 78.90, &#39;Clothing&#39;, &#39;New York - Queens&#39;, &#39;25–34&#39;, &#39;50K-75K&#39;),<br>(&#39;TXN009&#39;, &#39;CUST008&#39;, &#39;2024–01–19&#39;, 189.60, &#39;Electronics&#39;, &#39;New York - Manhattan&#39;, &#39;45–54&#39;, &#39;75K-100K&#39;),<br>(&#39;TXN010&#39;, &#39;CUST009&#39;, &#39;2024–01–19&#39;, 112.25, &#39;Groceries&#39;, &#39;New York - Brooklyn&#39;, &#39;35–44&#39;, &#39;50K-75K&#39;),<br>(&#39;TXN011&#39;, &#39;CUST010&#39;, &#39;2024–01–20&#39;, 445.80, &#39;Electronics&#39;, &#39;New York - Queens&#39;, &#39;25–34&#39;, &#39;100K+&#39;),<br>(&#39;TXN012&#39;, &#39;CUST002&#39;, &#39;2024–01–20&#39;, 23.50, &#39;Groceries&#39;, &#39;New York - Manhattan&#39;, &#39;35–44&#39;, &#39;75K-100K&#39;);</pre><h3>Creating Sophisticated Aggregation Policies</h3><pre>--Give privacy_admin role to your user<br>GRANT ROLE privacy_admin TO USER *******<br>--Switch to privacy admin role<br>USE ROLE privacy_admin;<br>USE SCHEMA privacy_demo.policies;<br>--Basic aggregation policy for external partners<br>CREATE AGGREGATION POLICY external_partner_policy<br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt;<br>AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 5);<br> - Advanced conditional policy based on role<br>CREATE AGGREGATION POLICY role_based_privacy_policy<br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt;<br>CASE<br>WHEN CURRENT_ROLE() = &#39;INTERNAL_ANALYST&#39;<br>THEN NO_AGGREGATION_CONSTRAINT()<br>WHEN CURRENT_ROLE() = &#39;DATA_ANALYST&#39;<br>THEN AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 3)<br>ELSE AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 8)<br>END;<br><br>-- Entity-level privacy policy for customer protection<br>CREATE AGGREGATION POLICY customer_entity_privacy<br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt;<br>AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 4);</pre><h3>Applying Policies and Testing Access</h3><pre>-- Apply the conditional policy to our transaction table<br>ALTER TABLE privacy_demo.sensitive_data.customer_transactions<br>SET AGGREGATION POLICY privacy_demo.policies.role_based_privacy_policy;<br> -- Grant necessary permissions<br>GRANT USAGE ON DATABASE privacy_demo TO ROLE external_partner;<br>GRANT USAGE ON SCHEMA privacy_demo.sensitive_data TO ROLE external_partner;<br>GRANT SELECT ON TABLE privacy_demo.sensitive_data.customer_transactions TO ROLE external_partner;<br> - Test as external partner (requires aggregation)<br>GRANT ROLE external_partner TO USER *****;<br>USE ROLE external_partner;<br> --This query will work - aggregates data properly<br>SELECT<br>category,<br>customer_age_group,<br>COUNT(*) as transaction_count,<br>AVG(amount) as avg_amount<br>FROM privacy_demo.sensitive_data.customer_transactions<br>GROUP BY category, customer_age_group<br>HAVING COUNT(*) &gt;= 8; - Ensures minimum group size<br>--This query will fail - tries to access individual records<br><br>SELECT * FROM privacy_demo.sensitive_data.customer_transactions LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ffRWVgVfnD88lo1m" /><figcaption>Query Failing Due to Violation of Policy</figcaption></figure><p>Now Let’s switch roles and try again</p><pre><br>--Test as internal analyst (unrestricted access)<br>GRANT ROLE internal_analyst TO USER****;<br>USE ROLE internal_analyst;<br> --This query works - internal analysts have unrestricted access<br>SELECT customer_id, transaction_date, amount<br>FROM privacy_demo.sensitive_data.customer_transactions<br>WHERE customer_id = &#39;CUST001&#39;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WmP9Vh_YTMKahIVd" /></figure><h3>Advanced Policy Management</h3><pre>--Monitor policy usage<br>SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.AGGREGATION_POLICIES<br>WHERE POLICY_NAME = &#39;ROLE_BASED_PRIVACY_POLICY&#39;;<br> - Check policy references<br>SELECT * FROM TABLE(<br>INFORMATION_SCHEMA.POLICY_REFERENCES(<br>POLICY_NAME =&gt; &#39;privacy_demo.policies.role_based_privacy_policy&#39;<br>)<br>);<br> --Modify policy if needed<br>ALTER AGGREGATION POLICY privacy_demo.policies.role_based_privacy_policy<br>SET BODY -&gt;<br>CASE<br>WHEN CURRENT_ROLE() = &#39;INTERNAL_ANALYST&#39;<br>THEN NO_AGGREGATION_CONSTRAINT()<br>WHEN CURRENT_ROLE() = &#39;DATA_ANALYST&#39;<br>THEN AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 5) - Increased from 3<br>ELSE AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 10) - Increased from 8<br>END;</pre><h3>Databricks: The Aggregation Policy Gap</h3><h3>The Absence of Native Aggregation Control</h3><p>Databricks lacks native aggregation policy functionality, creating significant challenges for organizations that need to enforce privacy-preserving analytics. This absence forces organizations to implement complex, error-prone workarounds.</p><h3>Databricks Workaround Approach</h3><p>Without native aggregation policies, Databricks users must resort to:</p><h4>1. Application-Level Controls (Fragile and Incomplete)</h4><pre># Databricks workaround - application-level enforcement<br>def safe_query_with_aggregation(df, group_cols, agg_cols, min_group_size=5):<br>&quot;&quot;&quot;<br>Workaround function to enforce minimum group sizes<br>Problems:<br>- Relies on developer discipline<br>- Easy to bypass<br>- No system-level enforcement<br>&quot;&quot;&quot;<br>grouped = df.groupBy(*group_cols).agg(*agg_cols)<br>grouped_with_count = grouped.withColumn(&quot;group_size&quot;,<br>df.groupBy(*group_cols).count())<br># Filter out small groups - but this is not enforced at query level<br>return grouped_with_count.filter(col(&quot;group_size&quot;) &gt;= min_group_size)<br># Usage example<br>from pyspark.sql import SparkSession<br>from pyspark.sql.functions import *<br>spark = SparkSession.builder.appName(&quot;PrivacyWorkaround&quot;).getOrCreate()<br># Load sensitive data<br>sensitive_df = spark.table(&quot;customer_transactions&quot;)<br># Attempt to enforce aggregation - but this is easily bypassed<br>safe_results = safe_query_with_aggregation(<br>sensitive_df,<br>[&quot;category&quot;, &quot;age_group&quot;],<br>[avg(&quot;amount&quot;).alias(&quot;avg_amount&quot;), count(&quot;*&quot;).alias(&quot;transaction_count&quot;)],<br>min_group_size=5<br>)<br># The problem: Nothing prevents this direct access<br># dangerous_query = sensitive_df.select(&quot;customer_id&quot;, &quot;amount&quot;).collect()</pre><h4>2. View-Based Restrictions (Limited and Inflexible)</h4><pre>- Databricks workaround using views<br>CREATE OR REPLACE VIEW safe_customer_analytics AS<br>SELECT<br>category,<br>customer_age_group,<br>store_location,<br>COUNT(*) as transaction_count,<br>AVG(amount) as avg_amount,<br>SUM(amount) as total_amount<br>FROM customer_transactions<br>GROUP BY category, customer_age_group, store_location<br>HAVING COUNT(*) &gt;= 5; - Hard-coded minimum group size<br><br> --Problems with this approach:<br> --1. Fixed aggregation - no flexibility<br> --2. No role-based variations<br> --3. Easy to create alternative views<br> --4. No protection of base table</pre><h4>3. Delta Lake Table Access Controls (Insufficient)</h4><pre>- Databricks Unity Catalog approach - grants access but no aggregation enforcement<br>GRANT SELECT ON TABLE customer_transactions TO GROUP data_analysts;<br>GRANT SELECT ON TABLE customer_transactions TO GROUP external_partners;<br>-- Problem: Both groups can run these queries<br>-- SELECT * FROM customer_transactions WHERE customer_id = &#39;specific_customer&#39;;<br>-- No way to enforce aggregation at query level</pre><h3>Critical Limitations of Databricks Workarounds</h3><ul><li><strong>No System-Level Enforcement</strong>: Workarounds rely on application logic that can be bypassed by determined users or forgotten by developers.</li><li><strong>Maintenance Overhead</strong>: Each workaround requires custom development, testing, and maintenance across multiple applications and notebooks.</li><li><strong>Inconsistent Protection</strong>: Different applications may implement different privacy controls, creating gaps in protection.</li><li><strong>Performance Impact</strong>: Application-level aggregation checks add computational overhead and complexity.</li><li><strong>Audit Challenges</strong>: Tracking privacy compliance across multiple custom implementations is nearly impossible.</li><li><strong>Developer Risk</strong>: Privacy protection depends on individual developer knowledge and discipline rather than system guarantees.</li></ul><h3>The Snowflake Advantage: Built-in Privacy Guarantees</h3><h3>System-Level Protection</h3><p>Unlike Databricks’ workarounds, Snowflake’s aggregation policies provide:</p><ul><li><strong>Query-Level Enforcement</strong>: Protection is built into the query execution engine, making it impossible to bypass.</li><li><strong>Automatic Compliance</strong>: Policies are automatically enforced regardless of the application, tool, or user interface accessing the data.</li><li><strong>Role-Based Flexibility</strong>: Different users can have different aggregation requirements based on their roles and responsibilities.</li><li><strong>Audit Completeness</strong>: Every query attempt is logged with policy enforcement details, providing comprehensive compliance trails.</li></ul><h3>Enterprise-Grade Features</h3><ul><li><strong>Conditional Logic</strong>: Policies can include complex business logic based on user roles, time of day, or other contextual factors.</li><li><strong>Remainder Group Handling</strong>: Snowflake automatically handles groups that don’t meet minimum size requirements, preventing data leakage.</li><li><strong>Integration with Other Policies</strong>: Aggregation policies work seamlessly with masking policies, row access policies, and RBAC.</li><li><strong>Zero-Maintenance Privacy</strong>: Once implemented, policies require no ongoing application-level maintenance.</li></ul><h3>Implementation Best Practices</h3><h3>Policy Design Strategy</h3><ol><li><strong>Start with Business Requirements</strong>: Map privacy needs to specific aggregation requirements</li><li><strong>Design Role-Based Hierarchies</strong>: Create policies that reflect organizational access patterns</li><li><strong>Plan for Flexibility</strong>: Use conditional policies to accommodate different user types</li><li><strong>Consider Entity-Level Privacy</strong>: Protect entities that span multiple records</li></ol><h3>Performance Optimization</h3><p>We can also add conditions on when and where the policy kicks in. In this example, we exclude all queries running on INTERNAL_WH to make sure users running queries on this warehouse get the best performance.</p><pre>-- Optimize aggregation policies for performance<br>CREATE AGGREGATION POLICY optimized_policy<br>AS () RETURNS AGGREGATION_CONSTRAINT -&gt;<br>CASE<br>WHEN CURRENT_WAREHOUSE() = &#39;INTERNAL_WH&#39;<br>THEN NO_AGGREGATION_CONSTRAINT()<br>WHEN CURRENT_TIME() BETWEEN TIME(&#39;09:00:00&#39;) AND TIME(&#39;17:00:00&#39;)<br>THEN AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 5)<br>ELSE AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE =&gt; 10)<br>END;</pre><h3>Monitoring and Governance</h3><p>We can also monidtor frequency of policy execution and how many queries were written and executed that violated the policy.</p><pre>--Regular policy auditing<br>SELECT<br>policy_name,<br>policy_body,<br>created_on,<br>last_altered_on<br>FROM SNOWFLAKE.ACCOUNT_USAGE.AGGREGATION_POLICIES<br>WHERE deleted_on IS NULL;<br> - Monitor policy violations<br>SELECT<br>query_text,<br>user_name,<br>role_name,<br>execution_status,<br>error_message<br>FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY<br>WHERE error_message ILIKE &#39;%aggregation%policy%&#39;<br>AND start_time &gt;= DATEADD(day, -7, CURRENT_TIMESTAMP());</pre><h3>Conclusion: Privacy Protection Without Compromise</h3><p>Snowflake’s aggregation policies represent a fundamental advancement in privacy-preserving analytics. While Databricks forces organizations to choose between data accessibility and privacy protection through complex workarounds, Snowflake provides both through intelligent, system-level enforcement.</p><p>The choice is clear: organizations can continue struggling with fragile, custom privacy implementations in Databricks, or they can leverage Snowflake’s enterprise-grade aggregation policies that provide automatic, comprehensive privacy protection without sacrificing analytical capabilities.</p><p>As we continue our data governance series, the next post will explore how Snowflake’s data classification and tagging capabilities create a comprehensive governance framework that builds on the RBAC and privacy foundations we’ve established. The pattern is consistent: where other platforms require custom development and ongoing maintenance, Snowflake provides enterprise-ready solutions built into the platform architecture.</p><p><em>Stay tuned for Part 4 of our series, where Joel and I will dive deep into data classification strategies and their role in comprehensive data governance.</em></p><p>(p.s. Medium Code Editor and Formatter was on a mental break, so it screwed up the SQL. Here is <a href="https://github.com/boghbogh/randomfiles/blob/main/AggPolicies.sql">sql worksheet</a> to get the example up and running! )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a8f8b66c285" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why True RBAC Matters!!]]></title>
            <link>https://medium.com/@boghbogh/why-true-rbac-matters-b47b8e9edfa1?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b47b8e9edfa1</guid>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 11:06:12 GMT</pubDate>
            <atom:updated>2025-06-14T02:38:21.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Case for Snowflake’s Superior Access Control Model</h3><p>In the evolving landscape of data platforms, Role-Based Access Control (RBAC) has become a critical differentiator. While many platforms offer access control features, few implement true RBAC with the sophistication and elegance of Snowflake. This post explores why proper role-based security architecture matters and demonstrates how Snowflake’s approach surpasses alternatives like Databricks’ group-based model.</p><h3>The Foundation: Why Databases Need Sophisticated RBAC</h3><h3>The Enterprise Security Challenge</h3><p>Modern data platforms are the backbone of business intelligence, housing everything from customer data to financial records. The stakes for proper access control have never been higher:</p><ul><li><strong>Regulatory Compliance</strong>: GDPR, HIPAA, SOX, and other regulations demand granular access controls</li><li><strong>Data Breach Prevention</strong>: Limiting access reduces attack surface and insider threats</li><li><strong>Operational Efficiency</strong>: Proper permissions prevent data corruption and unauthorized modifications</li><li><strong>Audit Requirements</strong>: Clear permission trails are essential for compliance reporting</li></ul><h3>Beyond Simple Permissions: The Need for Roles</h3><p>Individual user permission management becomes unwieldy at scale. Roles provide the abstraction layer that makes enterprise security manageable, auditable, and maintainable.</p><h3>Roles vs Groups: A Critical Architectural Distinction</h3><p>The confusion between roles and groups has led many organizations to implement suboptimal security models. Understanding this distinction is crucial for proper RBAC implementation.</p><h3>Groups: Organizational Identity Containers</h3><p>Groups represent <strong>who users are</strong> within an organization:</p><ul><li>Departmental affiliations (Engineering, Sales, HR)</li><li>Geographic locations (US-East, EU-Central, APAC)</li><li>Project teams (DataMigration2024, CustomerAnalytics)</li></ul><h3>Roles: Functional Permission Containers</h3><p>Roles define <strong>what users can do</strong> within the system:</p><ul><li>Data access levels (ReadOnlyAnalyst, DataScientist, DatabaseAdmin)</li><li>Business functions (FinancialReporter, CustomerServiceRep, AuditViewer)</li><li>Technical capabilities (ETLDeveloper, MLModelBuilder, SchemaDesigner)</li></ul><h3>The Enterprise Advantage of Separation</h3><p>This architectural separation provides:</p><ul><li><strong>Flexibility</strong>: Users can have multiple organizational affiliations and functional roles</li><li><strong>Maintainability</strong>: Role permissions can evolve without affecting organizational structure</li><li><strong>Compliance</strong>: Clear audit trails separating identity from function</li><li><strong>Scalability</strong>: Role-based permissions scale with organizational growth</li></ul><h3>Databricks Groups: The Limitations of a Hybrid Approach</h3><p>Databricks attempts to solve access control through groups, but this approach reveals fundamental architectural limitations.</p><h3>The Databricks Group Model</h3><pre>-- Databricks group creation<br>CREATE GROUP data_analysts;<br>CREATE GROUP finance_team;<br>CREATE GROUP ml_engineers;<br>-- Permission grants to groups<br>GRANT SELECT ON schema.customer_data TO data_analysts;<br>GRANT ALL PRIVILEGES ON schema.financial_data TO finance_team;<br>GRANT CREATE TABLE ON schema.ml_workspace TO ml_engineers;<br>-- User assignment<br>ALTER GROUP data_analysts ADD USER john.doe@company.com;</pre><h3>Critical Limitations of the Databricks Approach</h3><p><strong>Semantic Confusion</strong>: Groups serve dual purposes, creating ambiguity between organizational identity and functional permissions. This leads to groups like “finance_team” that mix departmental identity with data access rights.</p><p><strong>Limited Flexibility</strong>: Users can belong to multiple groups, but there’s no clear hierarchy or inheritance model. This creates permission sprawl and makes it difficult to understand what access a user actually has.</p><p><strong>Maintenance Overhead</strong>: As organizations grow, the number of groups proliferates exponentially. Without proper role abstraction, administrators must manage an ever-growing matrix of group-to-permission mappings.</p><p><strong>Audit Complexity</strong>: When groups represent both identity and function, audit trails become convoluted. It’s difficult to answer questions like “Who has access to financial data?” or “What can John Doe actually do?”</p><p><strong>Workspace Fragmentation</strong>: Many Databricks permissions are workspace-specific, creating silos and inconsistent access patterns across the platform.</p><h3>Snowflake’s Superior RBAC Architecture</h3><p>Snowflake implements true RBAC with a sophisticated, enterprise-grade architecture that addresses all the limitations of group-based systems.</p><h3>The Snowflake Role Model</h3><pre>-- Role creation with clear functional purpose<br>CREATE ROLE data_analyst;<br>CREATE ROLE senior_data_analyst;<br>CREATE ROLE financial_data_reader;<br>CREATE ROLE customer_data_analyst;<br>-- Sophisticated role hierarchy<br>GRANT ROLE data_analyst TO ROLE senior_data_analyst;<br>GRANT ROLE financial_data_reader TO ROLE senior_data_analyst;<br>-- Granular permission assignment<br>GRANT SELECT ON schema.customer_data TO ROLE customer_data_analyst;<br>GRANT SELECT ON schema.financial_data TO ROLE financial_data_reader;<br>GRANT CREATE VIEW ON schema.analytics TO ROLE data_analyst;<br>-- Flexible user-role assignment<br>GRANT ROLE data_analyst TO USER john.doe;<br>GRANT ROLE financial_data_reader TO USER john.doe;<br>GRANT ROLE customer_data_analyst TO USER jane.smith;<br>-- Dynamic role switching<br>USE ROLE data_analyst;<br>USE ROLE financial_data_reader;</pre><h3>Snowflake’s Architectural Advantages</h3><p><strong>True Role Hierarchy</strong>: Snowflake supports sophisticated role inheritance, allowing senior roles to inherit permissions from junior roles. This creates a natural progression of access that mirrors organizational structure while maintaining functional clarity.</p><p><strong>Multiple Concurrent Roles</strong>: Users can hold multiple roles simultaneously and switch between them as needed. This flexibility is essential for modern data professionals who wear multiple hats.</p><p><strong>Session-Level Security</strong>: The ability to switch roles within a session provides fine-grained security control. Users can operate with minimal permissions by default and elevate only when necessary.</p><p><strong>Built-in Governance</strong>: Snowflake includes system roles (ACCOUNTADMIN, SYSADMIN, SECURITYADMIN) that provide clear separation of administrative duties, a critical requirement for enterprise governance.</p><p><strong>Comprehensive Audit Trail</strong>: Every role assignment, permission grant, and role switch is logged, providing complete visibility into who has access to what and when.</p><h3>Why Snowflake’s Approach Wins: A Detailed Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOec7iidWTYeot6cYGgceA.png" /></figure><h3>Operational Excellence</h3><p><strong>Snowflake’s role model reduces administrative overhead</strong> through:</p><ul><li>Clear role inheritance reducing permission duplication</li><li>Systematic approach to permission management</li><li>Built-in governance through system roles</li><li>Comprehensive logging and monitoring</li></ul><p><strong>Databricks requires significant custom development</strong> to achieve similar governance capabilities:</p><ul><li>Custom tooling for permission auditing</li><li>Manual processes for role lifecycle management</li><li>Complex group hierarchies that become unwieldy at scale</li></ul><h3>Scalability and Flexibility</h3><p>Snowflake’s architecture scales naturally with organizational growth:</p><ul><li><strong>Role Templates</strong>: Standard roles can be replicated across departments</li><li><strong>Dynamic Inheritance</strong>: New roles can inherit from existing ones</li><li><strong>Flexible Assignment</strong>: Users can be granted roles as needed without restructuring</li><li><strong>Context-Aware Security</strong>: Role switching allows appropriate access in different contexts</li></ul><h3>Real-World Enterprise Scenarios</h3><p><strong>Scenario 1: Financial Services Compliance</strong> A bank needs to ensure that only authorized personnel can access customer financial data, with different levels of access for different roles. Snowflake’s role hierarchy naturally supports this:</p><pre>CREATE ROLE customer_data_viewer;<br>CREATE ROLE customer_data_analyst;<br>CREATE ROLE customer_data_manager;<br>GRANT ROLE customer_data_viewer TO ROLE customer_data_analyst;<br>GRANT ROLE customer_data_analyst TO ROLE customer_data_manager;<br>-- Granular permissions at each level<br>GRANT SELECT ON customer_basic_info TO ROLE customer_data_viewer;<br>GRANT SELECT ON customer_financial_details TO ROLE customer_data_analyst;<br>GRANT ALL PRIVILEGES ON customer_data_schema TO ROLE customer_data_manager;</pre><p><strong>Scenario 2: Multi-Tenant Analytics Platform</strong> A company providing analytics services to multiple clients needs to ensure strict data isolation. Snowflake’s role model makes this straightforward:</p><pre>CREATE ROLE client_a_analyst;<br>CREATE ROLE client_b_analyst;<br>CREATE ROLE cross_client_reporter;<br>-- Client-specific access<br>GRANT SELECT ON client_a_schema.* TO ROLE client_a_analyst;<br>GRANT SELECT ON client_b_schema.* TO ROLE client_b_analyst;<br>-- Aggregated reporting role<br>GRANT SELECT ON aggregated_reporting_views.* TO ROLE cross_client_reporter;</pre><h3>Implementation Best Practices for Snowflake RBAC</h3><h3>Strategic Role Design</h3><ol><li><strong>Functional Over Organizational</strong>: Design roles around what users do, not where they sit</li><li><strong>Hierarchical Planning</strong>: Use role inheritance to minimize permission duplication</li><li><strong>Principle of Least Privilege</strong>: Grant minimum necessary permissions, allow elevation as needed</li><li><strong>Role Lifecycle Management</strong>: Plan for role creation, modification, and retirement</li></ol><h3>Operational Excellence</h3><pre>-- Example of well-designed role hierarchy<br>CREATE ROLE base_user;<br>CREATE ROLE data_reader;<br>CREATE ROLE data_analyst;<br>CREATE ROLE senior_data_analyst;<br>CREATE ROLE data_manager;<br>-- Build hierarchy<br>GRANT ROLE base_user TO ROLE data_reader;<br>GRANT ROLE data_reader TO ROLE data_analyst;<br>GRANT ROLE data_analyst TO ROLE senior_data_analyst;<br>GRANT ROLE senior_data_analyst TO ROLE data_manager;<br>-- Assign appropriate default roles<br>ALTER USER john.doe SET DEFAULT_ROLE = data_reader;<br>ALTER USER jane.smith SET DEFAULT_ROLE = data_analyst;</pre><h3>Governance and Monitoring</h3><p>Snowflake’s superior logging capabilities enable comprehensive governance:</p><pre>-- Monitor role usage<br>SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY <br>WHERE ROLE_NAME = &#39;SENSITIVE_DATA_ANALYST&#39;;<br>-- Audit role assignments<br>SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_USERS <br>WHERE DELETED_ON IS NULL;<br>-- Track role switching<br>SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.SESSIONS <br>WHERE USER_NAME = &#39;john.doe&#39;;</pre><h3>Migration Strategy: Moving from Databricks to Snowflake</h3><h3>Assessment Phase</h3><ol><li><strong>Audit Current Groups</strong>: Document all existing Databricks groups and their permissions</li><li><strong>Identify Patterns</strong>: Distinguish between organizational groups and functional roles</li><li><strong>Map Dependencies</strong>: Understand how current permissions support business processes</li></ol><h3>Design Phase</h3><ol><li><strong>Role Architecture</strong>: Design Snowflake roles based on business functions, not existing groups</li><li><strong>Hierarchy Planning</strong>: Create role inheritance structure that minimizes complexity</li><li><strong>Permission Mapping</strong>: Map current group permissions to appropriate Snowflake roles</li></ol><h3>Implementation Phase</h3><ol><li><strong>Parallel Development</strong>: Build Snowflake role structure alongside existing Databricks setup</li><li><strong>Incremental Migration</strong>: Move teams gradually, validating access patterns</li><li><strong>Comprehensive Testing</strong>: Ensure all business processes work with new role structure</li></ol><h3>The Competitive Advantage of Superior RBAC</h3><p>Organizations that implement Snowflake’s sophisticated RBAC model gain significant advantages:</p><p><strong>Reduced Security Risk</strong>: Proper role-based access control significantly reduces the attack surface and insider threat risk.</p><p><strong>Improved Compliance Posture</strong>: Comprehensive audit trails and built-in governance features simplify regulatory compliance.</p><p><strong>Operational Efficiency</strong>: Well-designed role hierarchies reduce administrative overhead and improve user productivity.</p><p><strong>Business Agility</strong>: Flexible role assignment enables rapid response to changing business needs without compromising security.</p><p><strong>Cost Optimization</strong>: Proper access controls prevent unauthorized resource usage and reduce compliance costs.</p><h3>Conclusion: The Clear Choice for Enterprise Data Security</h3><p>While Databricks offers basic access control through groups, Snowflake’s sophisticated RBAC architecture represents the gold standard for enterprise data security. The distinction between identity and function, support for role hierarchies, session-level security, and comprehensive audit capabilities make Snowflake the superior choice for organizations serious about data security and governance.</p><p>The initial investment in understanding and implementing Snowflake’s RBAC model pays dividends in reduced security risk, improved compliance posture, and operational efficiency. As data continues to grow in value and regulatory scrutiny intensifies, organizations need access control systems that can scale with their needs while maintaining the highest security standards.</p><p>Snowflake’s RBAC architecture isn’t just better than Databricks’ group-based approach — it’s the foundation for enterprise-grade data security in the modern era. Organizations still relying on simpler group-based models are not just missing out on superior functionality; they’re accepting unnecessary security risks and operational complexity that sophisticated RBAC was designed to eliminate.</p><h3>What’s Next: Our Data Governance Deep-Dive Series</h3><p>This exploration of RBAC fundamentals is just the beginning of a comprehensive examination of enterprise data governance.<br> <a href="https://medium.com/u/2929a8fea844">Joel Roland</a> and I will be publishing a multi-part blog series that builds on these RBAC foundations to cover the broader landscape of data governance in modern cloud platforms.</p><p>Our upcoming posts will delve into data classification and advanced security patterns. Each post will continue to demonstrate how Snowflake’s architecture provides superior capabilities for enterprise data governance compared to alternative platforms. Stay tuned as we explore how proper RBAC serves as the cornerstone for a comprehensive data governance strategy that scales with your organisation’s needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b47b8e9edfa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set your GCP up for Databricks deployment]]></title>
            <link>https://medium.com/@boghbogh/set-your-gcp-up-for-databricks-deployment-badd42dbd9d0?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/badd42dbd9d0</guid>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Wed, 09 Feb 2022 02:48:08 GMT</pubDate>
            <atom:updated>2022-02-09T02:48:08.196Z</atom:updated>
            <content:encoded><![CDATA[<p>So you have subscribed to Databricks in the GCP marketplace and are now ready to deploy a workspace. There are a few checks that I would like to do before deploying a workspace. Some are done automatically by Databricks deployment process and some you have to do your own due diligence.</p><p><strong>Required APIs</strong></p><p>As part of a workspace deployment Databricks automatically enables a couple of APIs. You can do a quick check to see if these APIs are enabled beforehand too using gcloud command.</p><pre>gcloud services list --enabled --project PROJECT_ID</pre><p>And you should check these two APIs are enabled:</p><ul><li>storage.googleapis.com</li><li>container.googleapis.com</li></ul><figure><img alt="Enabled APIs" src="https://cdn-images-1.medium.com/max/537/1*MKn9uRIMSrtIv0H0BkKIrQ.png" /></figure><p><strong>Required/Recommended Quotas</strong></p><p>The list is fully documented and available here: <a href="https://docs.gcp.databricks.com/administration-guide/account-settings-gcp/quotas.html#google-cloud-resource-quotas-that-databricks-requires">https://docs.gcp.databricks.com/administration-guide/account-settings-gcp/quotas.html#google-cloud-resource-quotas-that-databricks-requires</a></p><p>But here is a quick script that checks the above requirements and a list of all required resources and their current limit. You can check this against Databricks deployment requirements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b15b0a6928ea07ccd8c7d8782dc2e45/href">https://medium.com/media/6b15b0a6928ea07ccd8c7d8782dc2e45/href</a></iframe><p>Link to the original code file: <a href="https://github.com/boghbogh/dbgcputility/blob/main/Scripts/chekgcpquotas.py">https://github.com/boghbogh/dbgcputility/blob/main/Scripts/chekgcpquotas.py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=badd42dbd9d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Exfiltration Protection with Databricks on GCP]]></title>
            <link>https://medium.com/@boghbogh/data-exfiltration-protection-with-databricks-on-gcp-bab31d094602?source=rss-abf80fcb1af5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bab31d094602</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[datarbricksongcp]]></category>
            <category><![CDATA[databricks]]></category>
            <dc:creator><![CDATA[Mahdi Askari]]></dc:creator>
            <pubDate>Thu, 20 Jan 2022 20:39:11 GMT</pubDate>
            <atom:updated>2022-01-20T20:55:15.402Z</atom:updated>
            <content:encoded><![CDATA[<p>As per <a href="https://en.wikipedia.org/wiki/Data_exfiltration">Wikipedia</a>: <em>Data exfiltration occurs when malware and/or a malicious actor carries out an unauthorized data transfer from a computer. It is also commonly called data extrusion or data exportation. Data exfiltration is also considered a form of data theft. Since the year 2000, a number of data exfiltration efforts have severely damaged the consumer confidence, corporate valuation, and intellectual property of businesses and the national security of governments across the world</em>. The problem assumes even more significance as enterprises start storing and processing sensitive data (PII, PHI or Strategic Confidential) with public cloud services.</p><p>Before we begin, let’s have a quick look at the default Databricks deployment architecture from <a href="https://docs.gcp.databricks.com/getting-started/overview.html">here</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJGxfnGkTCi3OaXH3e0hfA.png" /><figcaption>High-level Databricks Architecture</figcaption></figure><p>Databricks is structured to enable secure cross-functional team collaboration while keeping a significant amount of backend services managed by Databricks so you can stay focused on your data science, data analytics, and data engineering tasks.</p><p>Databricks operates out of a control plane and a data plane.</p><ul><li>The control plane includes the backend services that Databricks manages in its own Google Cloud account. Notebook commands and many other workspace configurations are stored in the control plane and encrypted at rest.</li><li>The data plane is managed by your Google Cloud account and is where your data resides. This is also where data is processed. You can use Databricks connectors so that your clusters can connect to <a href="https://docs.gcp.databricks.com/data/data-sources/index.html">external data sources</a> outside of your Google Cloud account to ingest data or for storage. You can also ingest data from external <a href="https://docs.gcp.databricks.com/spark/latest/structured-streaming/data-sources.html">streaming data sources</a>, such as events data, streaming data, IoT data, and more.</li></ul><p>Databricks has published a step by step guide on how to secure your deployment on GCP. This guide includes:</p><ul><li>Enabling Google Private Access</li><li>Modifying firewall rules</li><li>Modifying DNS routing</li></ul><p>You can access the link to the guide here:</p><p><a href="https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/firewall.html#control-plane-service-endpoint-ip-addresses-by-region">https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/firewall.html</a></p><p>We have put a small script that runs all of the above modifications in one run, and all you need to do is replace a few variables and run the script to modify your Databricks deployment.</p><p><a href="https://github.com/boghbogh/dbgcputility/blob/main/Scripts/secure-vpc.sh">https://github.com/boghbogh/dbgcputility/blob/main/Scripts/secure-vpc.sh</a></p><p>Thank you</p><p>p.s. A big THANK YOU to our security legend <a href="https://medium.com/u/d01528cee23a">Bhavin K</a> who put the content for documentation together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bab31d094602" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>