<?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 ratheesh nellikal on Medium]]></title>
        <description><![CDATA[Stories by ratheesh nellikal on Medium]]></description>
        <link>https://medium.com/@ratheeshnellikkal?source=rss-2ca96620a433------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kRL3W2XDh01fW1vS</url>
            <title>Stories by ratheesh nellikal on Medium</title>
            <link>https://medium.com/@ratheeshnellikkal?source=rss-2ca96620a433------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:53:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ratheeshnellikkal/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[10 Cortex Code CLI Tricks Every Snowflake Developer Should Know !]]></title>
            <link>https://medium.com/@ratheeshnellikkal/10-cortex-code-cli-tricks-every-snowflake-developer-should-know-29d4ec744697?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/29d4ec744697</guid>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 05:03:46 GMT</pubDate>
            <atom:updated>2026-02-10T17:53:11.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>10 Cortex Code CLI Tricks Every Snowflake Developer Should Know !</h3><p>If you’ve ever wished you had a coding assistant that actually <em>understands</em> Snowflake — one that knows your tables, speaks SQL fluently, and can build Streamlit apps or data pipelines on command — that’s exactly what Snowflake Cortex Code CLI delivers.</p><p>I’ve been using Snowflake Cortex Code CLI for the past few weeks , and it has completely transformed how I work with Snowflake. What used to take hours of documentation hunting and trial-and-error now takes minutes.</p><p>In this article, I’ll walk you through everything you need to get started with Cortex Code CLI , plus the <strong>10 tips and tricks</strong> that have made me significantly more productive. Whether you’re a Snowflake veteran or just getting started, these shortcuts will save you hours of work.</p><p>Let’s dive in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bniNXosIGKW7oGjgxZt9tw.png" /><figcaption>image generated by AI</figcaption></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><h3><strong>What is Snowflake Cortex Code CLI?</strong></h3><p>In simple terms, Snowflake <a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli">Cortex Code CLI</a> is your army of minions who understand Snowflake terminology and language, and can build code and apps for you. In technical terms, it’s an AI-driven intelligent agent integrated into the Snowflake platform that understands Snowflake’s ecosystem deeply.</p><p>You can use either the Command Line Interface (CLI) or the Snowsight version. Let’s cover both.</p><p>Follow the documentation links here to set this up the <a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-snowsight">snowsight</a> or <a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli">CLI</a> version, a quick summary of the set up steps are given below.</p><h3><strong>Getting Started with Snowsight</strong></h3><p>The Snowsight version appears as a star icon on the side of your screen. If you’re using it for the first time, you may notice that the prompts are not enabled. To fix this, you need to enable cross-region inference.</p><p>Using an ACCOUNTADMIN role, run the following command:</p><pre>ALTER ACCOUNT SET CORTEX_ENABLED_CROSS_REGION = &#39;ANY_REGION&#39;;</pre><p>Please use this documentation <a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cross-region-inference">link</a> for more details on cross region inference.</p><h3><strong>Installing the Cortex Code CLI</strong></h3><p>I personally prefer the CLI version due to its versatility. Here’s how to install it:</p><pre>curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh</pre><h3><strong>Configuring Your Environment</strong></h3><p>Before you start using Cortex Code, you need to configure your Snowflake environment:</p><p>- If you already have <strong>Snowflake CLI</strong> installed, you can import those configurations</p><p>- Otherwise, Cortex Code will guide you through the configuration process</p><p>When you configure it for the first time, it creates a `config.toml` file under your `~/.snowflake` folder. However, if you already have Snowflake CLI set up, the `connections.toml` file takes precedence over `config.toml`.</p><p>And now you are ready to go !</p><blockquote>If you’re using Visual Studio Code (or any other editor ) , open the integrated terminal and run `cortex` directly from there. This makes it much easier to browse and work with files generated by Cortex Code, since everything stays within your editor.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*QRN9_FV25AoqIAmV6ceNEA.png" /></figure><h3><strong>Discovering Built-in Skills</strong></h3><blockquote>Skills are domain-specific prompts that supercharge the AI for particular workflows.</blockquote><p>One important thing to know: Cortex Code CLI comes with <strong>pre-built skills</strong>! You can see all available skills by:</p><p>1. Typing a prompt like “show me all the skills”</p><p>2. Typing `$` in the prompt to see skill suggestions</p><p>3. Using `/skill` command to browse skills</p><h3><strong>Top 10 Tips and Tricks</strong></h3><h4><strong>1. Quick File References with `@`</strong></h4><p>Stop copying and pasting file contents. Just type `@` (select files or) followed by the path to inject files directly into your context.</p><pre>@src/utils/helpers.py Can you explain what this file does?</pre><p>Need only specific lines? Add a range:</p><pre>@src/app.py$10–50 There is a bug somewhere in these lines</pre><p>This injects just lines 10–50 into your context — perfect for large files.</p><h4><strong>2. Instant Snowflake Table Context with `#`</strong></h4><p>Working with Snowflake data? Reference tables directly using `#` and Cortex Code will auto-inject the table schema AND sample rows.</p><pre>#ANALYTICS.PUBLIC.SALES_DATA Write a query to get total sales by region</pre><p>The AI receives the full table structure and sample data, enabling it to write accurate queries without you describing the schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*sYrV06_ukmKCjNlOvVfSQw.png" /></figure><h4><strong>3. Run Bash Commands with `!`</strong></h4><p>Execute shell commands without leaving your conversation. The output goes straight to the agent for analysis.</p><pre>!git status<br>!npm test<br></pre><p>The agent sees the command output and can help you debug issues immediately.</p><h4><strong>4. Execute SQL Directly with `/sql`</strong></h4><p>Run SQL queries against your Snowflake connection without context switching.</p><pre>/sql SELECT COUNT(*) FROM olympic_events</pre><p>Quick validation, data exploration, or running generated queries — all without leaving the CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*I5z3EJaOPqiGmRuyYlcGtQ.png" /></figure><h4><strong>5. Use Skills for Specialized Tasks</strong></h4><p>Skills are domain-specific prompts that supercharge the AI for particular workflows. Invoke them with `$`:</p><pre>&gt; $developing-with-streamlit Help me create a dashboard for sales metrics<br>&gt; $machine-learning I need to train a model on this dataset</pre><p>To see all available skills:</p><pre>&gt; /skill </pre><p>Or simply type `$` and use arrow keys to browse and select.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*cvROe6nFXnwj1-msyEnjZg.png" /></figure><h4><strong>6. Master the Three Operational Modes</strong></h4><p>Cycle through modes with `Shift+Tab`:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*sR9iDQLW-YVl_bQiJ_vSSQ.png" /></figure><pre>&gt; /plan<br>[Plan Mode Enabled]<br>&gt; Refactor the authentication module to use OAuth2<br>[Agent shows detailed plan before making any changes]</pre><h4><strong>7. Fork and Rewind for Safe Experimentation</strong></h4><p>About to try something risky? Create a conversation branch with `/fork`. Things went wrong? Step back with `/rewind`.</p><p><strong>Example — Fork before experimenting:</strong></p><pre>&gt; /fork<br>[Session forked - you can safely experiment]<br>&gt; Try implementing this with a completely different approach using GraphQL</pre><p><strong>Example — Rewind when things go wrong:</strong></p><pre>&gt; /rewind<br>[Shows list of previous states]<br>Select state to rewind to: 3<br>[Conversation restored to state 3]</pre><h4><strong>8. Resume Sessions Anytime</strong></h4><p>Left in the middle of a complex task? Resume right where you left off with full context restored.</p><pre># Resume your most recent session<br>cortex -- resume last<br># list the recent sessions and you can chose the one you want<br>cortex -- resume<br># Resume a specific session by ID<br>cortex -r abc123-session-id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*tJzWt6v8gmgzAeeCKMA25A.png" /></figure><p>Your entire conversation history and context is restored instantly.</p><h4><strong>9. Compact Long Conversations</strong></h4><p>Context getting bloated after a long session? `/compact` summarizes your conversation while preserving essential information.</p><pre>&gt; /compact<br>[Summarizing conversation…]<br>[Context compressed from 50,000 tokens to 8,000 tokens]<br>[All important context preserved]</pre><p>Your session stays fast and focused, and you can continue working without losing critical context.</p><h4><strong>10. Background Long-Running Commands</strong></h4><p>Starting a dev server, running tests, or executing a long build? Use `Ctrl+B` to run commands in the background.</p><pre>&gt; !npm run dev<br>[Press Ctrl+B to background this command]<br>[Command running in background - you can continue working]<br>&gt; /agents<br>[Shows all background processes and their status]</pre><h4><strong>Quick Reference Card</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5lPi_DK2QCvEzOvZ-j0ZA.png" /></figure><h4><strong>Getting Help Within Cortex Code</strong></h4><blockquote>Do you know the best way to learn Cortex Code is to use Cortex Code itself! Here’s how:</blockquote><pre>&gt; $cortex-code-guide</pre><p>This loads the comprehensive built-in guide covering:</p><p>- All CLI commands and slash commands</p><p>- Keyboard shortcuts</p><p>- Configuration options</p><p>- Skills system</p><p>- Session management</p><p>- And much more!</p><h4>Summary:</h4><p>Cortex Code is more than just an AI chat — it’s a full development environment that speaks Snowflake fluently. Master these shortcuts and you’ll find yourself coding faster than ever.</p><p><em>What’s your favorite Cortex Code trick? Drop it in the comments!</em></p><h4>References:</h4><p><a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cross-region-inference">Cross region inference</a></p><p><a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli">Cortex code cli</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29d4ec744697" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Replicating Data from PostgreSQL to Snowflake with Openflow]]></title>
            <link>https://medium.com/@ratheeshnellikkal/replicating-data-from-postgresql-to-snowflake-with-openflow-e0522c1ec913?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0522c1ec913</guid>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 14:01:03 GMT</pubDate>
            <atom:updated>2026-02-02T17:21:18.899Z</atom:updated>
            <content:encoded><![CDATA[<p>This is Part 3 of a three-part series on building a complete data pipeline from PostgreSQL to Snowflake using Openflow:</p><p>Part 1: <a href="https://medium.com/@ratheeshnellikkal/getting-started-with-snowflake-postgresql-create-your-first-instance-and-load-data-f7171f3f10c5">Setting Up Snowflake PostgreSQL</a></p><p>Part 2: <a href="https://medium.com/@ratheeshnellikkal/configuring-openflow-on-snowpark-container-services-aecd9bb01f50">Configuring Openflow on Snowpark Container Services</a></p><p>Part 3: Replicating Data from PostgreSQL to Snowflake(this article)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKp_IRl4x17qIJeS5JLlPw.png" /><figcaption>image generated using AI</figcaption></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p><strong>Introduction</strong></p><p>In Parts 1 and 2, we created a PostgreSQL instance with sample data and set up Openflow on Snowpark Container Services. Now it’s time for the exciting finale — connecting everything together and watching our data flow into Snowflake!</p><p>By the end of this article, you’ll have:</p><ul><li>PostgreSQL connector installed and configured</li><li>Data flowing from PostgreSQL to Snowflake</li><li>Analytics queries running on your replicated data</li></ul><p>Let’s make it happen!</p><p><strong>Prerequisites Check</strong></p><p>Before proceeding, verify you have:</p><p>✅ PostgreSQL instance running with sample data (Part 1)</p><p>✅ Openflow deployment and runtime on SPCS (Part 2)</p><p>✅ External Access Integration for PostgreSQL (Part 2)</p><p>✅ Runtime status shows Running</p><p><strong>Step 1: Set up Snowflake databases and Schema for Ingestion</strong></p><pre>USE ROLE ACCOUNTADMIN;<br><br>-- Create ingestion database<br>CREATE DATABASE IF NOT EXISTS OPENFLOW_INGESTION;<br><br>-- Grant permissions to runtime role<br>GRANT USAGE ON DATABASE OPENFLOW_INGESTION TO ROLE OPENFLOW_RUNTIME_ROLE;<br>GRANT CREATE SCHEMA ON DATABASE OPENFLOW_INGESTION TO ROLE OPENFLOW_RUNTIME_ROLE;<br><br>-- Grant runtime role to admin (for management)<br>GRANT ROLE OPENFLOW_RUNTIME_ROLE TO ROLE OPENFLOW_ADMIN;</pre><p><strong>Step 2: Create Publications and Replication Slots in PostgreSQL</strong></p><p>Since we will be having three processor created as part of PostgreSQL connections lets configure <strong>Publications</strong> and <strong>replication slots</strong> in PostgreSQL. These are required for <strong>CDC (Change Data Capture)</strong> / incremental replication — not for full/snapshot loads.</p><p><strong>Why they’re needed:</strong></p><p><a href="http://Openflow Connector for PostgreSQL requires a publication to be created and configured in PostgreSQL before replication starts. You can create it for all, or a subset of tables, as well as for specific tables with specified columns only. Make sure that every table and column that you plan to have replicated is included in the publication. You can also modify the publication later, while the connector is running. To create and configure a publication, do the following:"><strong>Publication</strong></a><strong> </strong>Defines <em>which tables</em> to stream changes from (INSERT/UPDATE/DELETE)</p><p><strong>Replication Slot</strong>Ensures PostgreSQL <em>retains WAL logs</em> so no changes are lost, even if Openflow disconnects temporarily</p><pre>-- Create publication for all tables in sales_dw schema<br>CREATE PUBLICATION sales_dw_publication FOR TABLE <br>    sales_dw.dim_date,<br>    sales_dw.dim_customer,<br>    sales_dw.dim_product,<br>    sales_dw.dim_store,<br>    sales_dw.fact_sales;<br><br>-- Create replication slot for CDC<br>SELECT pg_create_logical_replication_slot(&#39;sales_dw_slot&#39;, &#39;pgoutput&#39;);<br><br>-- validate <br>-- Check publication exists and see which tables are included<br>SELECT * FROM pg_publication;<br><br>-- See tables in the publication<br>SELECT * FROM pg_publication_tables WHERE pubname = &#39;sales_dw_publication&#39;;<br><br>-- Check replication slot exists<br>SELECT * FROM pg_replication_slots WHERE slot_name = &#39;sales_dw_slot&#39;;</pre><p><strong>Step3: Access the Openflow Canvas</strong></p><p><em>Refer Snowflake official documentation </em><a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/connectors/postgres/setup#configure-the-connector"><em>here</em></a><em> for more detailed instructions</em></p><p>1. Sign in to Snowsight</p><p>2. Navigate to Ingestion &gt; Openflow</p><p>3. Click Launch Openflow</p><p>4. Select your deployment (`postgres_replication`)</p><p><strong>Step 3: Add the PostgreSQL Source Connector</strong></p><ol><li>In the Openflow Overview page you can see ‘ Features Connectors’ and click on ‘View more connectors’ link if you don’t see postgres connector</li></ol><p>2. Then Click on Install under the PostgreSQL Connector</p><p>3. It asks for a runtime and Chose the runtime you have created earlier ‘postgres_replication’</p><p>4. Click on Add</p><p>5. It Ask you to login again then configure the connector and you can see it in your canvas, as shown in the third picture. Note you may see some error, but its okay, we will work on it next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*I0RTwEXTUQkGH5ad8JpThg.png" /><figcaption>Click on view more to see all the Connectors</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*pAEljCMnOSjtTFP8yUUTqg.png" /><figcaption>Chose PostgreSQL connector and click on Install</figcaption></figure><p><strong>3. Configure Connection Settings</strong></p><ol><li>Right click on the Process group and Click on Parameters</li><li>you can see three parameter contexts</li></ol><ul><li>PostgreSQL Source Parameters</li><li>PostgreSQL Destination Parameters</li><li>PostgreSQL Ingestion Parameters</li></ul><p>3. Click on the hamburger menu for the PostgreSQL Source Parameter and click on edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4CXWmVI0L4_HTYRkWE4Kzg.png" /></figure><h4><strong><em>Use following values for PostgreSQL Source Parameter</em></strong></h4><ul><li><strong>PostgreSQL Connection URL</strong> : <em>jdbc:postgresql://&lt;your postgres url&gt;:5432/postgres</em></li><li><strong>PostgreSQL JDBC Driver</strong> : <em>Click on edit, then Check “Reference Assets” and add the postgresql jbdc driver (I used postgresql-42.7.5.jar) ( Please find the below figures)</em></li><li><strong>PostgreSQL Password</strong>: <em>Password copied while creating Postgres instance</em></li><li><strong>Publication Name</strong> : <em>sales_dw_publication (created in the previous step)</em></li><li><strong>Replication Slot Name</strong>: <em>sales_dw_slot (created in the previous step)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*L490sZZhFOqNh8gegaVtpg.png" /><figcaption>Check Reference assets and click on the upload button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*hMWipkHHhAGOvMzxwq9dPQ.png" /><figcaption>Select the correct jbdc driver and upload to the connector</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*8UQUTzdWuIXtI3HZCp_-5w.png" /><figcaption>PostgreSQL Source Parameters looks like this:</figcaption></figure><h4>Use following values for <strong>PostgreSQL Destination Parameter</strong></h4><ul><li><strong>Destination Database</strong> : OPENFLOW_INGESTION</li><li><strong>Snowflake Account Identifier : </strong><em>No need to set a value here</em></li><li><strong>Snowflake Authentication String</strong>: SNOWFLAKE_MANAGED</li><li><strong>Snowflake Connection Strategy</strong> : STANDARD</li><li><strong>Snowflake Private Key</strong>: <em>No need to set a value here</em></li><li><strong>Snowflake Private Key File</strong>: <em>No need to set a value here</em></li><li><strong>Snowflake Private Key Password</strong>: <em>No need to set a value here</em></li><li><strong>Snowflake Role</strong>: OPENFLOW_RUNTIME_ROLE (or similar created earlier)</li><li><strong>Snowflake Username</strong>: &lt;user name&gt;</li><li><strong>Snowflake Warehouse</strong> : &lt;warehouse name&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*SuDEUOX15-b-s7o-cTEfdg.png" /><figcaption>PostgreSQL Destination Parameter</figcaption></figure><blockquote><em>Note: Openflow typically creates a schema matching your source schema name. Don’t be surprised if you see `OPENFLOW_INGESTION.SALES_DW` instead of a custom schema name.</em></blockquote><h4>Use following values for PostgreSQL Ingestion Parameter</h4><p>There are only two things you have to worry about in this section .</p><ul><li><strong>Included Table Names </strong>: sales_dw.dim_customer,sales_dw.dim_date,sales_dw.dim_product,sales_dw.dim_store,sales_dw.fact_sales</li></ul><p><em>Please make sure to provide the table names in this format : &lt;schema&gt;.&lt;tablename&gt; and each tables should be seperated by comma.</em></p><ul><li><strong>Object identifier Resolution</strong> : I set this to CASE_INSENSITIVE</li></ul><p><em>Please note: Do not change after initial start of the connector. Determines if schema / table / column names are treated as case-sensitive or case-insensitive and set this accordinlgy.</em></p><p>There is another parameter that you can play around later is <strong>“Ingestion Type”</strong> I decided to go with full load for this quick demo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*VX_L3Xdlm4BNf8xjg5ASXA.png" /><figcaption>PostgreSQL Ingestion Parameter</figcaption></figure><p><strong>4. Run the flow</strong></p><ul><li>Right click on the plane and select “Enable All Controller Services”</li><li>Right click on the imported process group and select Start</li></ul><p>The connector start the data ingestion and when you double click on the process group you can see something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*OGaDbfAkF_NqhXUqluUz_g.png" /><figcaption>Flow is running</figcaption></figure><p>If you see any connection error during the testing please verify following:</p><p>(For PostgreSQL Source Parameters)</p><ul><li>Connection timeout =&gt;Check External Access Integration includes your PostgreSQL hostname</li><li>Authentication failed =&gt;Verify username/password</li><li>Host not found =&gt;Check hostname spelling; ensure egress rule is correct |</li></ul><p><strong>5. Verify Data in Snowflake</strong></p><p>Once you verify the process group or flow is running login to snowflake and make sure new objects are created and data is loaded there.</p><pre>--Check Tables Were Created<br><br>-- Switch to appropriate role<br>USE ROLE OPENFLOW_RUNTIME_ROLE;<br>-- Or use ACCOUNTADMIN if needed<br>USE ROLE ACCOUNTADMIN;<br><br>-- Check schemas in ingestion database<br>SHOW SCHEMAS IN DATABASE OPENFLOW_INGESTION;<br><br>-- List tables in the sales_dw schema<br>SHOW TABLES IN SCHEMA OPENFLOW_INGESTION.SALES_DW;<br><br>--Verify Row Counts<br><br><br>-- Compare row counts with PostgreSQL source<br>SELECT &#39;dim_customer&#39; as table_name, COUNT(*) FROM OPENFLOW_INGESTION.SALES_DW.DIM_CUSTOMER<br>UNION ALL SELECT &#39;dim_date&#39;, COUNT(*) FROM OPENFLOW_INGESTION.SALES_DW.DIM_DATE<br>UNION ALL SELECT &#39;dim_product&#39;, COUNT(*) FROM OPENFLOW_INGESTION.SALES_DW.DIM_PRODUCT<br>UNION ALL SELECT &#39;dim_store&#39;, COUNT(*) FROM OPENFLOW_INGESTION.SALES_DW.DIM_STORE<br>UNION ALL SELECT &#39;fact_sales&#39;, COUNT(*) FROM OPENFLOW_INGESTION.SALES_DW.FACT_SALES<br>ORDER BY table_name;<br></pre><p><strong>Summary: What We Built</strong></p><p>Congratulations!</p><p>You’ve successfully built an end-to-end data pipeline to bring data from PostgreSQL to Snowflake using Snowflake Openflow !</p><p>Resources:</p><p>Set up Openflow — <a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/about-spcs">Snowflake SPCS deployment</a></p><p>Openflow connector for <a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/connectors/postgres/about">PostgreSQL</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0522c1ec913" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Openflow on Snowpark Container Services !]]></title>
            <link>https://medium.com/@ratheeshnellikkal/configuring-openflow-on-snowpark-container-services-aecd9bb01f50?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/aecd9bb01f50</guid>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 13:48:52 GMT</pubDate>
            <atom:updated>2026-02-02T17:23:00.228Z</atom:updated>
            <content:encoded><![CDATA[<h3>Configuring Openflow on Snowpark Container Services !</h3><p>This is Part 2of a three-part series on building a complete data pipeline from PostgreSQL to Snowflake using Openflow:</p><p>Part 1: <a href="https://medium.com/@ratheeshnellikkal/getting-started-with-snowflake-postgresql-create-your-first-instance-and-load-data-f7171f3f10c5">Setting Up Snowflake PostgreSQL</a></p><p>Part 2: Configuring Openflow on Snowpark Container Services (this article)</p><p>Part 3: <a href="https://medium.com/@ratheeshnellikkal/replicating-data-from-postgresql-to-snowflake-with-openflow-e0522c1ec913">Replicating Data from PostgreSQL to Snowflake</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhQ0NoHUK-QYVf6vP73mog.png" /></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p><strong>Introduction</strong></p><p>In <a href="https://medium.com/@ratheeshnellikkal/getting-started-with-snowflake-postgresql-create-your-first-instance-and-load-data-f7171f3f10c5">Part 1</a>, we created a PostgreSQL instance and loaded it with sample data. Now it’s time to set up Openflow — Snowflake’s data integration service — to replicate that data into Snowflake tables for analytics.</p><p><strong>What is Snowflake Openflow ?</strong></p><blockquote><a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/about">Snowflake Openflow</a> is an integration service that connects any data source and any destination with hundreds of processors supporting structured and unstructured text, images, audio, video and sensor data. Built on <a href="https://nifi.apache.org/">Apache NiFi</a>, Openflow lets you run a fully managed service in your own cloud for complete control.</blockquote><p>Since Snowflake <a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/about">Openflow</a> is built on Apache NiFi, so if you’re familiar with that ecosystem, you’ll feel right at home. For this tutorial, we’re deploying Openflow on <a href="https://docs.snowflake.com/en/developer-guide/snowpark-container-services/overview">Snowpark Container Services</a> (SPCS) — Snowflake’s fully managed container runtime.</p><p><em>Important: Before proceeding, follow the official Set up Openflow — </em><a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/setup-openflow-spcs"><em>Snowflake Deployment</em></a></p><p>By the end of this article, you’ll have:</p><ul><li>Openflow admin role with proper permissions</li><li>Role hierarchy for usage/operate/monitor access</li><li>Openflow deployment running on SPCS</li><li>Runtime with External Access Integration for PostgreSQL connectivity</li><li>Ingestion database ready to receive replicated data</li></ul><p><strong>Step 1: Create the Openflow Admin Role</strong></p><blockquote>Note that users with a default role of ACCOUNTADMIN can’t login to Openflow- Snowflake deployment runtimes and will get an error message.</blockquote><blockquote>Snowflake recommends assigning a different defualt role to any user that will login to runtime. In addition Snowflake recommends setting default secondary roles to ALL for all openflow users.</blockquote><pre>USE ROLE ACCOUNTADMIN;<br><br>-- Create the Openflow admin role<br>CREATE ROLE IF NOT EXISTS RN_OPENFLOW_ADMIN;<br><br>-- These are required for creating Openflow resources<br>GRANT CREATE OPENFLOW DATA PLANE INTEGRATION ON ACCOUNT TO ROLE RN_OPENFLOW_ADMIN;<br>GRANT CREATE OPENFLOW RUNTIME INTEGRATION ON ACCOUNT TO ROLE RN_OPENFLOW_ADMIN;<br>GRANT CREATE COMPUTE POOL ON ACCOUNT TO ROLE RN_OPENFLOW_ADMIN;<br><br>-- Grant to your user<br>GRANT ROLE RN_OPENFLOW_ADMIN TO USER &lt;USERNAME&gt;;<br><br>-- Set as default role and set secondary roles<br>ALTER USER &lt;USERNAME&gt; SET DEFAULT_ROLE = RN_OPENFLOW_ADMIN;<br>ALTER USER &lt;USERNAME&gt; SET DEFAULT_SECONDARY_ROLES = (&#39;ALL&#39;);</pre><p><strong>Step 2: Create the Openflow Deployment</strong></p><ol><li>Sign in to Snowsight with the `OPENFLOW_ADMIN` role</li><li>In the navigation menu, select Ingestion → Openflow</li><li>Select Launch Openflow</li><li>Click Create a deployment</li><li>In the Prerequisites step, verify you meet all requirements, then click Next</li><li>In the Deployment location step</li></ol><ul><li>Select Snowflake as the deployment location (this deploys to SPCS)</li><li>Enter a name for your deployment (e.g., `postgres_replication`)</li><li>Click Next</li><li>Click Create Deployment</li></ul><p>Usually it takes around 15–20 minutes to set up the Openflow deployment for you. In the meantime, lets set up the access control to create the runtime.</p><p><strong>Step 3: Create the Runtime role</strong></p><pre>USE ROLE ACCOUNTADMIN;<br>---- Create runtime role<br>CREATE ROLE IF NOT EXISTS OPENFLOW_RUNTIME_ROLE;<br>-- Grant to your user (for testing)<br>GRANT ROLE OPENFLOW_RUNTIME_ROLE TO USER &lt;USER&gt;;<br><br>-- Make sure this role has access to a warehouse <br>GRANT USAGE, OPERATE ON WAREHOUSE OPENFLOW_WH TO ROLE OPENFLOW_RUNTIME_ROLE;</pre><p><strong>Step 4: Create external access integration for Postgres</strong></p><p>Don’t forget about the Postgres database we have set up in the <a href="https://medium.com/@ratheeshnellikkal/getting-started-with-snowflake-postgresql-create-your-first-instance-and-load-data-f7171f3f10c5">part-1</a> of this series.</p><p><strong>This is crucial!</strong> Since Openflow runs on SPCS (containers), it needs explicit permission to connect to external resources — including the PostgreSQL instance that we have created earlier.</p><p>A quick note on <a href="https://docs.snowflake.com/en/developer-guide/external-network-access/external-network-access-overview">external access integration</a></p><blockquote>You can create secure access to specific network locations external to Snowflake, then use that access from within the handler code for user-defined functions (UDFs) and stored procedures. You can enable this access through an external access integration.</blockquote><pre>USE ROLE ACCOUNTADMIN;<br><br>-- Create database for Openflow network configuration<br>CREATE DATABASE IF NOT EXISTS OPENFLOW_CONFIG;<br>CREATE SCHEMA IF NOT EXISTS OPENFLOW_CONFIG.NETWORK;<br><br>-- Create network rule for PostgreSQL egress<br>-- IMPORTANT: Replace with YOUR PostgreSQL hostname!<br>CREATE OR REPLACE NETWORK RULE OPENFLOW_CONFIG.NETWORK.POSTGRES_EGRESS_RULE<br>    MODE = EGRESS<br>    TYPE = HOST_PORT<br>    VALUE_LIST = (&#39;&lt;your_postgres_hostname&gt;:5432&#39;);<br><br><br>/**How to find your PostgreSQL hostname:**/<br>-- 1. Go to **Postgres** in Snowsight<br>-- 2. Click on your instance<br>-- 3. Copy the hostname (looks like `abc123xyz.sfpscogs-yourorg.us-west-2.aws.postgres.snowflake.app`)<br><br>### Create External Access Integration<br><br>USE ROLE ACCOUNTADMIN;<br><br>-- Create External Access Integration<br>CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION OPENFLOW_POSTGRES_EAI<br>   ALLOWED_NETWORK_RULES = (OPENFLOW_CONFIG.NETWORK.POSTGRES_EGRESS_RULE)<br>   ENABLED = TRUE;<br><br>-- Grant EAI usage to runtime role<br>GRANT USAGE ON INTEGRATION OPENFLOW_POSTGRES_EAI TO ROLE OPENFLOW_RUNTIME_ROLE;<br><br>### Verify Your Setup<br><br>-- Check network rules<br>SHOW NETWORK RULES IN SCHEMA OPENFLOW_CONFIG.NETWORK;<br><br>-- Check external access integrations<br>SHOW EXTERNAL ACCESS INTEGRATIONS;</pre><p><strong>Step 5: Create the Openflow runtime</strong></p><p>The runtime is where your data pipelines actually execute.</p><ol><li>In the Openflow Control Plane, select Create a runtime</li><li>Configure the runtime:</li></ol><ul><li>Deployment &gt; Select the Deployment you created earlier</li><li>Runtime Name &gt; `postgres_runtime` (Chose a descriptive name)</li><li>Node Type &gt; Start with smallest (Scale based on data volume )</li><li>Min Nodes &gt; 1 (Runtime starts with 1 when idle</li><li>Max Nodes &gt; 3 (Scaleto this number high CPU load)</li><li>Snowflake Role &gt;OPENFLOW_RUNTIME_ROLE (created in the previous step)</li><li>You can leave other optional settings blank as of now</li><li>External Access Integrations &gt; OPENFLOW_POSTGRES_EAI (created in previous step)</li></ul><p>3. Click Create</p><p>Wait a couple of minutes for the runtime to spin up on SPCS. The status will change to Running.</p><p><strong>Summary</strong></p><p>Congratulations! You’ve successfully:</p><p>✅ Created Openflow admin role with proper permissions</p><p>✅ Configured network access with engress rules and External Access Integration</p><p>✅ Runtime with External Access Integration for PostgreSQL connectivity</p><p><strong>What’s Next?</strong></p><p>Your Openflow environment is ready! In Part 3, we’ll:</p><ul><li>Install the PostgreSQL connector</li><li>Configure the connection to our PostgreSQL instance</li><li>Set up table replication</li><li>Verify data in Snowflake and run analytics queries</li></ul><p>Continue to Part 3: Replicating Data from PostgreSQL to Snowflake</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aecd9bb01f50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Snowflake PostgreSQL — Create Your First Instance and Load Data]]></title>
            <link>https://medium.com/@ratheeshnellikkal/getting-started-with-snowflake-postgresql-create-your-first-instance-and-load-data-f7171f3f10c5?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7171f3f10c5</guid>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 03:00:00 GMT</pubDate>
            <atom:updated>2026-02-02T17:23:26.101Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with Snowflake PostgreSQL — Create Your First Instance and Load Data</h3><p>A step-by-step guide to spinning up a managed PostgreSQL database in Snowflake and building a sample data warehouse</p><p>This is Part 1 of a three-part series on building a complete data pipeline from PostgreSQL to Snowflake using Openflow:</p><p>Part 1: Setting Up Snowflake PostgreSQL (this article)</p><p>Part 2: <a href="https://medium.com/@ratheeshnellikkal/configuring-openflow-on-snowpark-container-services-aecd9bb01f50">Configuring Openflow on Snowpark Container Services</a></p><p>Part 3: <a href="https://medium.com/@ratheeshnellikkal/replicating-data-from-postgresql-to-snowflake-with-openflow-e0522c1ec913">Replicating Data from PostgreSQL to Snowflake</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0jwp3-IFCtT_6gWzA8Fhg.png" /><figcaption>image generated by AI</figcaption></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p><strong>Introduction</strong></p><p>Have you ever wished you could run PostgreSQL alongside Snowflake, all within a single platform? With Snowflake’s managed PostgreSQL instances, that’s now a reality.</p><p>Snowflake recently introduced [<a href="https://www.snowflake.com/en/developers/guides/getting-started-with-snowflake-postgres/">managed PostgreSQL instances</a>]— a fully managed PostgreSQL 16–18 databases running directly within your Snowflake account.</p><p>This is perfect for teams that:</p><ul><li>Need PostgreSQL for transactional workloads alongside Snowflake for analytics</li><li>Want to consolidate infrastructure management</li><li>Are migrating from PostgreSQL but need to maintain compatibility during transition</li></ul><p>In this article, we’ll create a PostgreSQL instance, configure network access, and build a sample star schema data warehouse. Let’s get started!</p><p><strong>What are we building?</strong></p><p>By end of this article you will have the following data model up and running in Postgres</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MnFK7LM99jPGwsCVF7n5cw.jpeg" /></figure><p><strong>Step 1: Create Your PostgreSQL Instance</strong></p><p>Follow the Snowflake PostgreSQL <a href="https://www.snowflake.com/en/developers/guides/getting-started-with-snowflake-postgres/">Quickstart</a> or use these steps:</p><p>1. Navigate to Postgres in Snowsight’s left navigation menu</p><p>2. Click + Create</p><p>3. Configure your instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*FD83VmfnvEx9AV5r1AreNQ.png" /></figure><p>Lets leave Network policy as blank now, we will come back to this.</p><p>4. Click Create</p><p>5. CRITICAL: <strong>Save your credentials immediately! </strong>The password won’t be shown again.</p><p><strong>You’ll receive:</strong></p><p>- <strong>Username</strong>: `snowflake_admin`</p><p>- <strong>Password</strong>: (generated — save this securely!)</p><p>- <strong>Hostname</strong>: (e.g., `abc123xyz.sfpscogs-yourorg.us-west-2.aws.postgres.snowflake.app`)</p><p>6. Click Continue to network settings</p><p><strong>Step 2: Configure Network Access</strong></p><p>Here’s something that tripped me up initially: P<strong>ostgreSQL instances don’t allow any connections by default</strong>. You must explicitly configure network access.</p><p><strong>Create Network Rules and Policy</strong></p><pre>USE ROLE ACCOUNTADMIN;<br>--Create a dedicated database for network configuration<br>CREATE DATABASE IF NOT EXISTS POSTGRES_CONFIG;<br>CREATE SCHEMA IF NOT EXISTS POSTGRES_CONFIG.NETWORK;<br><br>--Create ingress rule allowing all IPs (quick setup)<br>CREATE NETWORK RULE POSTGRES_CONFIG.NETWORK.PG_INGRESS_ALL<br>TYPE = IPV4<br>VALUE_LIST = (&#39;0.0.0.0/0&#39;)<br>MODE = POSTGRES_INGRESS;<br><br>--Create the network policy<br>CREATE NETWORK POLICY PG_POLICY_ALLOW_ALL<br>ALLOWED_NETWORK_RULE_LIST = (&#39;POSTGRES_CONFIG.NETWORK.PG_INGRESS_ALL&#39;)<br>COMMENT = &#39;Allow all IPs to connect to PostgreSQL&#39;;</pre><p><strong>Please note: </strong>I have used a wide open network rule in this example, this works for a quick demo or POC, but make sure you are using a more restrictive setting for your production work load !</p><p><strong>Attach Policy to Your Instance</strong></p><p>1. Go to Postgres → Select your instance</p><p>2. Click the edit icon next to Network settings</p><p>3. Select ‘PG_POLICY_ALLOW_ALL’</p><p>4. Click Save</p><p><em>Important: If you’re still unable to connect after attaching the policy, restart the instance. Network policy changes sometimes require a restart to take effect.</em></p><p><strong>Step 3: Connect to PostgreSQL</strong></p><p>I used DBeaver for testing the connectivity and with the saved credentials it finally worked. However I had to play around the network rules / policies for a while though.</p><p><strong>Connection String Format</strong></p><p>postgresql://snowflake_admin:&lt;password&gt;@&lt;hostname&gt;:5432/postgres?sslmode=require</p><p><strong>Test Your Connection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJ4tJk8aGpVc3dUG9oNCwQ.png" /></figure><p><strong>Troubleshooting Connection Issues</strong></p><p>Connection timeout =&gt; Check network policy is attached; restart instance</p><p>SSL required error =&gt; Add `?sslmode=require` to connection string</p><p>Password auth failed =&gt;Regenerate credentials in Snowsight</p><p>IP not allowed =&gt;Check your IP (`curl -s ifconfig.me`) and update network rule</p><p><strong>Step 4: Create the Data Warehouse Schema</strong></p><p>Now let’s build a proper star schema. This is a classic dimensional modeling pattern perfect for analytics.</p><p><strong>Create Schema and Dimension Tables</strong></p><pre>--Create our data warehouse schema<br>CREATE SCHEMA IF NOT EXISTS sales_dw;<br><br>--Date Dimension (the backbone of any analytics)<br>CREATE TABLE sales_dw.dim_date (<br>  date_key INTEGER PRIMARY KEY,<br>  full_date DATE NOT NULL,<br>  year INTEGER,<br>  quarter INTEGER,<br>  month INTEGER,<br>  month_name VARCHAR(20),<br>  week INTEGER,<br>  day_of_week INTEGER,<br>  day_name VARCHAR(20),<br>  is_weekend BOOLEAN<br>);<br><br>--Customer Dimension<br>CREATE TABLE sales_dw.dim_customer (<br>  customer_key SERIAL PRIMARY KEY,<br>  customer_id VARCHAR(20) UNIQUE NOT NULL,<br>  first_name VARCHAR(50),<br>  last_name VARCHAR(50),<br>  email VARCHAR(100),<br>  city VARCHAR(50),<br>  state VARCHAR(50),<br>  country VARCHAR(50),<br>  segment VARCHAR(30)<br>);<br><br>--Product Dimension<br>CREATE TABLE sales_dw.dim_product (<br>  product_key SERIAL PRIMARY KEY,<br>  product_id VARCHAR(20) UNIQUE NOT NULL,<br>  product_name VARCHAR(100),<br>  category VARCHAR(50),<br>  subcategory VARCHAR(50),<br>  brand VARCHAR(50),<br>  unit_cost DECIMAL(10,2),<br>  unit_price DECIMAL(10,2)<br>);<br><br>--Store Dimension<br>CREATE TABLE sales_dw.dim_store (<br>  store_key SERIAL PRIMARY KEY,<br>  store_id VARCHAR(20) UNIQUE NOT NULL,<br>  store_name VARCHAR(100),<br>  city VARCHAR(50),<br>  state VARCHAR(50),<br>  country VARCHAR(50),<br>  region VARCHAR(50),<br>  store_type VARCHAR(30)<br>);<br><br>--Create the Fact Table<br>--Sales Fact Table (where the magic happens)<br>CREATE TABLE sales_dw.fact_sales (<br>  sale_id SERIAL PRIMARY KEY,<br>  date_key INTEGER REFERENCES sales_dw.dim_date(date_key),<br>  customer_key INTEGER REFERENCES sales_dw.dim_customer(customer_key),<br>  product_key INTEGER REFERENCES sales_dw.dim_product(product_key),<br>  store_key INTEGER REFERENCES sales_dw.dim_store(store_key),<br>  quantity INTEGER,<br>  unit_price DECIMAL(10,2),<br>  discount_pct DECIMAL(5,2),<br>  total_amount DECIMAL(12,2)<br>);<br><br>--Add indexes for query performance<br>CREATE INDEX idx_fact_sales_date ON sales_dw.fact_sales(date_key);<br>CREATE INDEX idx_fact_sales_customer ON sales_dw.fact_sales(customer_key);<br>CREATE INDEX idx_fact_sales_product ON sales_dw.fact_sales(product_key);<br>CREATE INDEX idx_fact_sales_store ON sales_dw.fact_sales(store_key);</pre><p><strong>Step 5: Load Sample Data</strong></p><pre>--Generate a full year of dates (2025)<br>INSERT INTO sales_dw.dim_date (date_key, full_date, year, quarter, month, month_name, week, day_of_week, day_name, is_weekend)<br>SELECT<br>TO_CHAR(d, &#39;YYYYMMDD&#39;)::INTEGER as date_key,<br>d as full_date,<br>EXTRACT(YEAR FROM d)::INTEGER,<br>EXTRACT(QUARTER FROM d)::INTEGER,<br>EXTRACT(MONTH FROM d)::INTEGER,<br>TO_CHAR(d, &#39;Month&#39;),<br>EXTRACT(WEEK FROM d)::INTEGER,<br>EXTRACT(DOW FROM d)::INTEGER,<br>TO_CHAR(d, &#39;Day&#39;),<br>EXTRACT(DOW FROM d) IN (0, 6)<br>FROM generate_series(&#39;2025–01–01&#39;::date, &#39;2025–12–31&#39;::date, &#39;1 day&#39;::interval) d;<br><br>--Insert customers across different segments<br>INSERT INTO sales_dw.dim_customer (customer_id, first_name, last_name, email, city, state, country, segment) VALUES<br>(&#39;CUST001&#39;, &#39;John&#39;, &#39;Smith&#39;, &#39;john.smith@email.com&#39;, &#39;New York&#39;, &#39;NY&#39;, &#39;USA&#39;, &#39;Enterprise&#39;),<br>(&#39;CUST002&#39;, &#39;Sarah&#39;, &#39;Johnson&#39;, &#39;sarah.j@email.com&#39;, &#39;Los Angeles&#39;, &#39;CA&#39;, &#39;USA&#39;, &#39;SMB&#39;),<br>(&#39;CUST003&#39;, &#39;Michael&#39;, &#39;Williams&#39;, &#39;mwilliams@email.com&#39;, &#39;Chicago&#39;, &#39;IL&#39;, &#39;USA&#39;, &#39;Enterprise&#39;),<br>(&#39;CUST004&#39;, &#39;Emily&#39;, &#39;Brown&#39;, &#39;emily.b@email.com&#39;, &#39;Houston&#39;, &#39;TX&#39;, &#39;USA&#39;, &#39;Consumer&#39;),<br>(&#39;CUST005&#39;, &#39;David&#39;, &#39;Jones&#39;, &#39;djones@email.com&#39;, &#39;Phoenix&#39;, &#39;AZ&#39;, &#39;USA&#39;, &#39;SMB&#39;),<br>(&#39;CUST006&#39;, &#39;Lisa&#39;, &#39;Garcia&#39;, &#39;lgarcia@email.com&#39;, &#39;Seattle&#39;, &#39;WA&#39;, &#39;USA&#39;, &#39;Enterprise&#39;),<br>(&#39;CUST007&#39;, &#39;James&#39;, &#39;Miller&#39;, &#39;jmiller@email.com&#39;, &#39;Denver&#39;, &#39;CO&#39;, &#39;USA&#39;, &#39;Consumer&#39;),<br>(&#39;CUST008&#39;, &#39;Jennifer&#39;, &#39;Davis&#39;, &#39;jdavis@email.com&#39;, &#39;Boston&#39;, &#39;MA&#39;, &#39;USA&#39;, &#39;SMB&#39;),<br>(&#39;CUST009&#39;, &#39;Robert&#39;, &#39;Martinez&#39;, &#39;rmartinez@email.com&#39;, &#39;Austin&#39;, &#39;TX&#39;, &#39;USA&#39;, &#39;Enterprise&#39;),<br>(&#39;CUST010&#39;, &#39;Amanda&#39;, &#39;Wilson&#39;, &#39;awilson@email.com&#39;, &#39;Portland&#39;, &#39;OR&#39;, &#39;USA&#39;, &#39;Consumer&#39;);<br><br>--Insert products<br>INSERT INTO sales_dw.dim_product (product_id, product_name, category, subcategory, brand, unit_cost, unit_price) VALUES<br>(&#39;PROD001&#39;, &#39;Laptop Pro 15&#39;, &#39;Electronics&#39;, &#39;Computers&#39;, &#39;TechBrand&#39;, 800.00, 1299.99),<br>(&#39;PROD002&#39;, &#39;Wireless Mouse&#39;, &#39;Electronics&#39;, &#39;Accessories&#39;, &#39;TechBrand&#39;, 15.00, 39.99),<br>(&#39;PROD003&#39;, &#39;USB-C Hub&#39;, &#39;Electronics&#39;, &#39;Accessories&#39;, &#39;ConnectPro&#39;, 25.00, 59.99),<br>(&#39;PROD004&#39;, &#39;Monitor 27inch&#39;, &#39;Electronics&#39;, &#39;Displays&#39;, &#39;ViewMax&#39;, 200.00, 399.99),<br>(&#39;PROD005&#39;, &#39;Keyboard Mechanical&#39;, &#39;Electronics&#39;, &#39;Accessories&#39;, &#39;TypeMaster&#39;, 50.00, 129.99),<br>(&#39;PROD006&#39;, &#39;Webcam HD&#39;, &#39;Electronics&#39;, &#39;Accessories&#39;, &#39;ClearView&#39;, 30.00, 79.99),<br>(&#39;PROD007&#39;, &#39;Headphones Wireless&#39;, &#39;Electronics&#39;, &#39;Audio&#39;, &#39;SoundWave&#39;, 80.00, 199.99),<br>(&#39;PROD008&#39;, &#39;Tablet 10inch&#39;, &#39;Electronics&#39;, &#39;Tablets&#39;, &#39;TechBrand&#39;, 250.00, 449.99),<br>(&#39;PROD009&#39;, &#39;Phone Charger&#39;, &#39;Electronics&#39;, &#39;Accessories&#39;, &#39;PowerUp&#39;, 8.00, 24.99),<br>(&#39;PROD010&#39;, &#39;External SSD 1TB&#39;, &#39;Electronics&#39;, &#39;Storage&#39;, &#39;DataVault&#39;, 60.00, 119.99);<br><br>--Insert stores<br>INSERT INTO sales_dw.dim_store (store_id, store_name, city, state, country, region, store_type) VALUES<br>(&#39;STR001&#39;, &#39;NYC Flagship&#39;, &#39;New York&#39;, &#39;NY&#39;, &#39;USA&#39;, &#39;Northeast&#39;, &#39;Flagship&#39;),<br>(&#39;STR002&#39;, &#39;LA Downtown&#39;, &#39;Los Angeles&#39;, &#39;CA&#39;, &#39;USA&#39;, &#39;West&#39;, &#39;Standard&#39;),<br>(&#39;STR003&#39;, &#39;Chicago Central&#39;, &#39;Chicago&#39;, &#39;IL&#39;, &#39;USA&#39;, &#39;Midwest&#39;, &#39;Standard&#39;),<br>(&#39;STR004&#39;, &#39;Houston Mall&#39;, &#39;Houston&#39;, &#39;TX&#39;, &#39;USA&#39;, &#39;South&#39;, &#39;Mall&#39;),<br>(&#39;STR005&#39;, &#39;Seattle Tech Hub&#39;, &#39;Seattle&#39;, &#39;WA&#39;, &#39;USA&#39;, &#39;West&#39;, &#39;Flagship&#39;),<br>(&#39;STR006&#39;, &#39;Online Store&#39;, &#39;N/A&#39;, &#39;N/A&#39;, &#39;USA&#39;, &#39;Online&#39;, &#39;E-commerce&#39;);<br><br>--Generate Sales Transactions<br>--Generate ~300 sales transactions<br>INSERT INTO sales_dw.fact_sales (date_key, customer_key, product_key, store_key, quantity, unit_price, discount_pct, total_amount)<br>SELECT<br>d.date_key,<br>c.customer_key,<br>p.product_key,<br>s.store_key,<br>qty,<br>p.unit_price,<br>disc,<br>(qty * p.unit_price * (1 - disc))::decimal(12,2)<br>FROM (<br>SELECT<br>(20250101 + (i % 365)) as date_key,<br>((i % 10) + 1) as cust_key,<br>((i % 10) + 1) as prod_key,<br>((i % 6) + 1) as str_key,<br>((i % 10) + 1) as qty,<br>((i % 20) / 100.0)::decimal(5,2) as disc<br>FROM generate_series(1, 500) i<br>) gen<br>JOIN sales_dw.dim_date d ON d.date_key = gen.date_key<br>JOIN sales_dw.dim_customer c ON c.customer_key = gen.cust_key<br>JOIN sales_dw.dim_product p ON p.product_key = gen.prod_key<br>JOIN sales_dw.dim_store s ON s.store_key = gen.str_key;</pre><p><strong>Verify Your Data</strong></p><pre>SELECT &#39;dim_date&#39; as table_name, COUNT(*) as rows FROM sales_dw.dim_date<br>UNION ALL SELECT &#39;dim_customer&#39;, COUNT(*) FROM sales_dw.dim_customer<br>UNION ALL SELECT &#39;dim_product&#39;, COUNT(*) FROM sales_dw.dim_product<br>UNION ALL SELECT &#39;dim_store&#39;, COUNT(*) FROM sales_dw.dim_store<br>UNION ALL SELECT &#39;fact_sales&#39;, COUNT(*) FROM sales_dw.fact_sales;</pre><p><strong>Summary</strong></p><p>Congratulations! You’ve successfully:</p><p>✅ Created a managed PostgreSQL 18.1 instance in Snowflake</p><p>✅ Configured network access with ingress rules</p><p>✅ Connected via DBeaver</p><p>✅ Built a star schema data warehouse</p><p>✅ Loaded sample data (365 dates, 10 customers, 10 products, 6 stores, ~300 sales)</p><p>Your PostgreSQL data warehouse is ready!</p><p><a href="https://medium.com/@ratheeshnellikkal/configuring-openflow-on-snowpark-container-services-aecd9bb01f50">In Part 2</a>, we’ll set up Openflow on Snowpark Container Services to prepare for data replication.</p><p><strong>Resources</strong></p><ul><li><a href="https://www.snowflake.com/en/developers/guides/getting-started-with-snowflake-postgres/">Getting Started with Snowflake Postgres</a></li><li><a href="https://docs.snowflake.com/en/user-guide/snowflake-postgres/about">Snowflake Postres documentation</a></li><li><a href="https://docs.snowflake.com/en/user-guide/network-policies">Network Policies for PostgreSQL</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7171f3f10c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Optima: Your Queries Just Got a Major Upgrade]]></title>
            <link>https://medium.com/@ratheeshnellikkal/snowflake-optima-your-queries-just-got-a-major-upgrade-052dd66d75ef?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/052dd66d75ef</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflake-data-warehouse]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 04:18:25 GMT</pubDate>
            <atom:updated>2025-10-07T11:49:59.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFlnJiHlOCCVij6SzcKL_g.png" /><figcaption>image generated by AI</figcaption></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p>Tired of manually tuning your queries and playing detective with query profiles? Snowflake’s new <strong>Optima</strong> feature is here to give your workloads a serious boost, and the best part is, you don’t have to do a thing.</p><p>Think of Optima as an intelligent assistant for your Snowflake workloads. Instead of you spending time analyzing performance, it continuously watches your query patterns and automatically applies the best optimization strategies. This means your queries run faster and more cost-efficiently without you ever lifting a finger.</p><h3>The Brains Behind the Power: Optima Indexing</h3><p>So, how does it work? The magic is in something called <strong>Optima Indexing</strong>.</p><p>Optima constantly analyzes your workloads. When it spots a recurring <strong>point-lookup query</strong> that could be faster — a query that looks up a specific record, like SELECT * FROM users WHERE user_id = 12345—it proactively creates a hidden index to accelerate it.</p><p>These indexes are built and maintained automatically, on a best-effort basis. They’re part of Snowflake’s <strong>Search Optimization Service</strong> under the hood, but with one key difference: you don’t have to manage them. Optima frees you from the burden of figuring out which columns to index or when to create them, making performance tuning truly effortless.</p><h3>No Extra Cost, All the Performance</h3><p>One of the most appealing aspects of Optima is that there are <strong>no extra costs</strong> for the compute or storage used to build or maintain these indexes. This goes back to Snowflake’s founding vision: give customers effortless performance without the need to tune.</p><p><em>There is one important note, however: Optima is only available on Snowflake’s newest and most advanced warehouses, known as </em><a href="https://docs.snowflake.com/en/user-guide/warehouses-gen2"><strong><em>Gen2 warehouses</em></strong></a><em>. This feature is not available on Gen1 or Snowpark-optimized warehouses. For more technical details on how Optima works, you can refer to the official </em><a href="https://docs.snowflake.com/en/user-guide/snowflake-optima?_ga=2.72478867.1257388240.1759607119-1275128174.1744384534&amp;_fsi=18gaZDB0"><em>Snowflake documentation on Optima</em></a><em>.</em></p><h3>A Real-World Example: 15x Faster Queries</h3><p>One customer in the automotive industry saw a massive performance boost thanks to Snowflake Optima. Queries that previously took over 17 seconds to run dropped to just over one second — a <strong>15x acceleration</strong>. This was possible because Optima automatically created hidden indexes, which increased micro-partition pruning from 30% to a phenomenal 96%, significantly reducing the amount of data scanned. This real-world example is highlighted in the <a href="https://www.snowflake.com/en/engineering-blog/intelligent-optimizations-snowflake-optima/">Snowflake Engineering Blog</a>.</p><h3>How to Spot Optima in Your Query Profile</h3><p>When you look at your <strong>Query Profile</strong> tab, open the <strong>Statistics</strong> pane. You’ll see a row labeled <strong>Partitions pruned by Snowflake Optima</strong>. This shows you exactly how many partitions were skipped during query execution thanks to Optima, giving you a clear picture of its impact on performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*iSUvPVeYi8lFzeLxpOotzA.png" /></figure><p>In the example above, Optima Indexing pruned an additional 8,343 of the 10,389 micro-partitions, which is an 80% improvement. Combined with existing metadata, the total pruning rate reached 96%, and the query finished in just 636 milliseconds.</p><p>Optima’s benefits don’t stop there. By making frequently run queries more efficient, it frees up warehouse resources, reducing contention for all other workloads. This means that even queries that aren’t directly optimized by Optima can run faster, leading to an overall improvement in the average job runtime across the entire warehouse.</p><p>With Snowflake Optima, you can stop worrying about manual tuning and get back to what matters. It truly is an intelligent approach to effortless performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=052dd66d75ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Let FLOATS Sink Your Snowflake Migration]]></title>
            <link>https://medium.com/@ratheeshnellikkal/dont-let-floats-sink-your-snowflake-migration-8fb01336f409?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fb01336f409</guid>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 04:36:04 GMT</pubDate>
            <atom:updated>2025-02-28T20:29:42.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Hidden Dangers of Floating-Point in Migration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nueH4C6AkmmBg0LCNbZlw.jpeg" /></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p>In the age of AI , you might wonder why we’re still talking about seemingly basic data types like FLOAT. The truth is, these foundational elements can still trip us up, especially during complex tasks like data migration. I&#39;ve encountered numerous situations where data validation issues during migration or ingestion ultimately traced back to the nuances of floating-point numbers. These issues often require lengthy discussions and explanations to ensure everyone understands the behavior of FLOAT data.</p><p>This article aims to equip you with the knowledge to navigate these nuances effectively when migrating data to Snowflake. By understanding the inherent characteristics of floating-point numbers and their potential pitfalls, you can proactively address challenges and ensure a smoother migration experience.</p><p>So let’s dive in ...</p><p>To set the stage, recall that Snowflake provides a wide array of numeric data types, broadly classified as fixed-point and floating-point.This article delves into the nuances of floating-point data types within Snowflake, their inherent characteristics, and crucial considerations for their effective utilization, especially during data migration.</p><p><strong>Go back to basics- Understanding Snowflake’s Floating-Point Landscape</strong></p><p>Snowflake uses FLOAT to store floating-point numbers. It provides several aliases for this data type, including FLOAT4, FLOAT8, DOUBLE, DOUBLE PRECISION, and REAL. While these variations exist for compatibility and ease of migration, they are all synonymous with FLOAT. A DESCRIBE TABLE operation will consistently reveal the underlying FLOAT storage, regardless of the alias used. <strong><em>This uniformity simplifies data migration efforts by accommodating diverse source system conventions.</em></strong></p><p><strong>Peeling the Onion: IEEE 754, Foundation of Snowflake FLOAT</strong></p><p>Snowflake adheres to the IEEE 754 standard, employing double-precision (64-bit) floating-point representation for FLOAT data. This yields a precision of approximately 15 decimal digits and a dynamic range spanning from approximately 10^-308 to 10^+308. However, it is essential to acknowledge that while adhering to the standard, inherent limitations in binary floating-point representation can lead to slight variations in stored values.</p><p><strong>Exploring the Imprecision of Floating-Point Numbers</strong></p><p>To illustrate this, consider the following SQL code snippet from <a href="https://community.snowflake.com/s/article/Carefully-Choose-when-to-use-FLOAT-data-type">this</a> community document:</p><pre>CREATE TABLE test_float (float_col FLOAT);<br>INSERT INTO test_float VALUES<br>(123.455555555566666666666666666666664902938498984835937597395793579375),<br>(123.4493478377384783747347837473947975937597395797),<br>(123.45),<br>(123.4500),<br>(123.44);</pre><pre>SELECT CAST(float_col AS NUMERIC(38, 20)) FROM test_float ORDER BY 1;</pre><p>Casting the FLOAT values to NUMERIC reveals the inherent approximations resulting from binary storage. The output demonstrates the effects of IEEE 754 rounding:</p><ul><li>123.455555555566653800448: The long 123.45... number was rounded to the closest representable value.</li><li>123.449347837738465886208: The long 123.44... number was also rounded.</li><li>123.440000000000004194304: The 123.44 value was not stored perfectly.</li><li>123.450000000000005767168: The 123.45 and 123.4500 values were also not stored perfectly.</li></ul><p><strong>Why Floating-Point Numbers Sacrifice Precision for Range</strong></p><p>Floating-point numbers excel at representing a wide range of values, much larger than fixed-point types. However, this expansive range comes at a cost: precision.</p><p>Think of it like this: floating-point numbers are stored in a kind of scientific notation, with a base and an exponent. This allows them to handle huge or tiny numbers efficiently. But, just like some fractions can’t be expressed exactly as decimals (think of 1/3 as 0.3333…), many decimal values can’t be perfectly represented in this format.</p><p>For example, using a base of 2, we can easily store the number 4 (as 4x2^0 or 2x2^1). But try representing 0.3 — you’ll always get an approximation, no matter how hard you try.</p><p>This inherent approximation, combined with the fact that the order of operations can sometimes affect the result of floating-point calculations (especially in parallel processing systems like Snowflake), means that you might see slight variations in results.</p><p><strong>Floating-Point Considerations for a Smooth Migration</strong></p><p>Now, let’s explore how the characteristics of floating-point numbers can impact your data migration journey. The inherent nuances of FLOAT data require careful consideration, especially during the crucial data migration and validation phases. Understanding these potential pitfalls can help you avoid unexpected issues and ensure a smoother transition.</p><ul><li><strong>Validation and Tolerance:</strong> When comparing floating-point numbers, it’s crucial to establish a tolerance level. Instead of requiring exact equality, which is often not achievable due to the nature of floating-point representation, the recommendation is to compare for approximate equality. This means considering two numbers equal if they fall within a predefined acceptable difference.</li><li><strong>Convert FLOAT to DECIMAL:</strong> For applications requiring precise decimal representation, the DECIMAL or NUMERIC data types should be preferred.</li><li><strong>Data Transformation:</strong> Employing the ROUND function or casting to fixed-point data types before aggregation can mitigate rounding errors.</li></ul><p><strong>Data Migration and Client Considerations</strong></p><p>During data migration, it is essential to address potential discrepancies arising from varying interpretations of FLOAT data types across different database systems. Additionally, Snowflake client interfaces like Snowsight, snowsql may present rounded values, while connector-based data retrieval will provide the full stored approximation. This can lead to validation challenges that require careful management.</p><p><strong>Understanding the Role of FLOAT Data Types</strong></p><p>FLOAT data types are most appropriate when dealing with data that requires a wide dynamic range and where minor approximations are acceptable. Conversely, they should be avoided in scenarios demanding absolute precision, such as financial calculations, join keys, or any context where data integrity is paramount.</p><p><strong>Conclusion</strong></p><p>Understanding the nuances of floating-point data types in Snowflake is essential for ensuring data integrity and accuracy. By adhering to best practices and employing appropriate mitigation strategies, organizations can effectively leverage Snowflake’s capabilities while minimizing the potential pitfalls associated with floating-point representation.</p><p><strong>References</strong></p><ul><li><a href="https://docs.snowflake.com/en/sql-reference/data-types-numeric#data-types-for-floating-point-numbers">Numeric data types | Snowflake Documentation</a></li><li><a href="https://community.snowflake.com/s/article/Carefully-Choose-when-to-use-FLOAT-data-type">Snowflake Community</a></li><li><a href="https://community.snowflake.com/s/article/Floating-point-data-types-in-Snowflake">Snowflake Community</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fb01336f409" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking the Tree Down]]></title>
            <link>https://medium.com/@ratheeshnellikkal/taking-the-tree-down-7e0aaee76b7c?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e0aaee76b7c</guid>
            <category><![CDATA[newbegingings]]></category>
            <category><![CDATA[christmas]]></category>
            <category><![CDATA[feel-good]]></category>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 13:28:20 GMT</pubDate>
            <atom:updated>2025-01-06T13:28:20.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgx4K53x93IK2kfArxJH0A.png" /></figure><p>The first week of January has arrived, bringing with it a quiet rhythm of transition from the holidays to a new beginning. Today, as it rains outside, I find this weather soothing — a gentle embrace for the soul — and, as a pluviophile, I could spend hours simply watching the rain.<br>There’s a serenity in this moment that invites reflection — a pause before life resumes its usual tempo.</p><p>After a few weeks of indulgent vacation, reality beckons.<br>Tomorrow, schools reopen, and office work resumes.The familiar routines await, creeping in with subtle insistence, reminding me that the world keeps turning.Yet, before I step back into that rhythm, I have one important, although bittersweet, task to complete today: dismantling the Christmas tree and taking down the decorations.</p><p>Taking down the Christmas tree and lights always touches my heart.<br>These decorations represent a season of joy, love, and togetherness.<br>The sparkling snowman family, the twinkling lights encircling the house,<br>and the carefully hung ornaments on the tree — all of it transforms the home into a wonderland of warmth and festivity.<br>Removing them feels like dimming a little magic from our lives.<br>Each strand of lights, each ornament carefully packed away, is a gentle farewell to the season that fills our hearts with hope.</p><p>As I take apart the tree, I can’t help but feel a twinge of sadness.<br>Yet, there’s also a quiet anticipation that carries me through.<br>Christmas, with all its magic and wonder, will come again.</p><p>I think of my daughter’s eager excitement when December rolls around.<br>She’ll run around me, her joy infectious, urging me to put up the tree.<br>Together, we’ll watch her and her little brother place ornaments on the tree, counting the days until Christmas morning and the wonderful presents from Santa.</p><p>It’s in these moments of reflection that I realize taking down the tree is not an end, but a pause.A pause filled with the promise of what’s to come.<br>The anticipation of another season of love, laughter, and light.</p><p>For now, the memories linger, and the joy we felt during the holidays keeps us warm through the quieter months ahead.</p><p>As the rain continues to fall, I feel grateful.<br>Grateful for the moments of magic we create and for the promise that, soon enough, the lights will sparkle again, and the air will once more be filled with the sound of laughter and the scent of pine.Until then, I’ll cherish the rain, the coffee, and the simple beauty of today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e0aaee76b7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential Guardrails for a Smooth Teradata to Snowflake Migration]]></title>
            <link>https://medium.com/@ratheeshnellikkal/essential-guardrails-for-a-smooth-teradata-to-snowflake-migration-f97029b97766?source=rss-2ca96620a433------2</link>
            <guid isPermaLink="false">https://medium.com/p/f97029b97766</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-migration]]></category>
            <category><![CDATA[teradata]]></category>
            <dc:creator><![CDATA[ratheesh nellikal]]></dc:creator>
            <pubDate>Mon, 08 Jul 2024 15:38:25 GMT</pubDate>
            <atom:updated>2024-07-10T14:13:27.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TZLTev8XkahVoxSZOVeCQ@2x.jpeg" /></figure><p><em>Disclaimer: I am a </em><a href="https://www.linkedin.com/in/ratheesh-nellikal-3b426523/"><em>Sr. Solution Architect at Snowflake</em></a><em> . The views expressed here are mine alone and do not necessarily reflect the view of my current, former, or future employers.</em></p><p>After completing one of the largest Teradata to Snowflake migrations in North America and before moving on with the life of a migration architect, I believe it’s important to reflect on the journey we embarked upon. Migrating Teradata workloads to Snowflake was a substantial and complex endeavor, filled with challenges and valuable learning experiences. Despite our recent successful migration, we faced numerous obstacles throughout the process. In this account, I share the insights and lessons I gained, hoping they will provide guidance and support for others embarking on similar transitions.</p><p>Before diving deep into the details, it’s important to understand what we were dealing with. The existing Teradata system managed around 1.5 Petabytes of data (excluding fallback) across 600 databases, with approximately 45,000 objects including tables, views, BTEQs, and stored procedures etc. We had 2,000+ users executing 40 million queries daily. The complexity was heightened by 20 years of technical debt and intricate interdependent data applications. Additionally, it was extremely difficult to access the system during peak hours for data extraction or validation, as most users were locked out to prioritize critical applications.</p><p>Please keep in mind that this article will not delve into the technical details of the migration process. Instead, the focus will be on the essential guardrails that need to be in place to ensure the migration train stays on track. These guardrails are critical for navigating the complexities and challenges of migrating from Teradata to Snowflake, helping to prevent potential pitfalls and ensuring a smooth and successful journey.</p><p><strong>Partner Selection: Cost vs. Capability</strong></p><p>Selecting the right consulting partner for any migration project is critical. It’s important to thoroughly evaluate potential firms to ensure they possess the necessary capabilities and skillsets. A deep understanding of both the source and target systems is essential; without it, the project could face significant challenges. It’s crucial that the team members assigned to the project hold Snowflake certifications and have a proven track record in similar migration endeavors. You can explore the available Snowflake certifications <a href="https://www.snowflake.com/en/resources/learn/certifications/">here.</a> If your current environment is already supported by a partner, leveraging their expertise for the migration could streamline the process and reduce the learning curve associated with onboarding a new partner.</p><p><strong>Migration Approach: Lift and Shift vs. Modernization</strong></p><p>One common mistake we’ve observed among customers is initially estimating the effort and time for a lift-and-shift migration — where minimal changes are made to the current ETL pipeline and reporting tools — only to later attempt significant alterations during the project. It’s natural to see migration as an opportunity to modernize existing systems, and there are often valid opportunities for improvement. However, deviating from the planned lift-and-shift approach to incorporate substantial changes, such as adopting new ETL pipelines or homegrown solutions, can derail the migration project, leading to unforeseen delays and complexities. If you’ve estimated for a lift-and-shift migration, it’s advisable to adhere to that strategy. Conversely, if your goal includes modernizing your tech stack to enhance performance, efficiency, and cost-effectiveness, plan and estimate accordingly from the outset.</p><p><strong>Planning is the key</strong></p><p>A solid, well-defined plan is the foundation of any successful migration. Often, customers rush into the migration process without establishing this crucial groundwork. They may feel pressured to keep everyone busy and avoid downtime, but this approach is misguided. If you find this happening, consider engaging only a small, focused team for the planning phase and ensure you have the right expertise in place. Do not begin the migration without thoroughly planning for data migration, data ingestion, data validation, the ETL pipeline, SIT testing, and the go-live plan. If you have done a migration readiness assessment, leverage its output as a blueprint; this is a good starting point for subsequent planning sessions. Taking the time to do this right is essential; otherwise, you may end up back at the drawing board mid-project, which is far from a pleasant experience. It is also critical to establish high-level milestones with clear timelines to keep the project on track.</p><p><strong>Choosing the Right ETL Tool: Simplifying Migration with Industry Standards</strong></p><p>Choosing the right tool for your ETL pipelines is crucial. Opting for homegrown tools requires careful consideration because industry-standard ETL tools exist for good reasons — they simplify operations. Designing your own toolset involves envisioning support for the myriad features your thousands of ETL jobs currently rely on, which is no easy feat. In contrast, industry-standard tools offer sophisticated capabilities that can greatly facilitate the migration process.</p><p><strong>Importance of Object Inventory</strong></p><p>Maintaining an up-to-date inventory of database objects, ETL jobs, and BI reports is crucial to success. Begin by cataloging all objects and jobs, identifying which ones need to be migrated, and eliminating unnecessary items. During this phase, establish object lineage if it doesn’t already exist. This will help you understand the interdependencies of ETL jobs, which is particularly useful for phased migrations or parallel development, where multiple teams work on separate work streams. Identifying objects and jobs allows you to assign them to the appropriate application teams or work streams. For objects or ETL jobs not belonging to any team, the migration team must devise a strategy (orphan object migration strategy) to migrate them to Snowflake before the actual cutover, facilitating the decommissioning process.</p><p><strong>Call out the Platform Differences</strong></p><p>One crucial step we took was documenting the behavioral differences between the Teradata and Snowflake platforms well in advance. This information was shared with the migration, application, and business teams, covering SQL differences, including SQL function variations, potential workarounds, and the impact of these decisions on different application functionalities. This proactive documentation was particularly helpful during code and ETL conversion, as well as UAT testing. It was also an ideal time to document how specific functionalities differ between the two systems, such as how SORT operations handle null values.</p><p><strong>Ensure Code Conversion Quality</strong></p><p>You should establish a review process to ensure the converted code functions as expected. Reviewing unit test cases and QA validation reports can help build confidence in the conversion process. Poorly converted code can lead to unexpected results or errors in later phases of the migration and can introduce performance or functionality issues. Therefore, it’s important to carefully consider the tools you use for database code conversion.</p><p>If you haven’t finalized any code conversion tools yet, consider taking a look at SnowConvert and its capabilities. This tool proved to be highly effective in reducing the conversion efforts during our migration journey. Feel free to read more about <a href="https://www.snowflake.com/snowflake-professional-services/snowconvert/">SnowConvert by Snowflake</a> and watch an excellent demo showcasing its capabilities by the SnowConvert team <a href="https://www.youtube.com/watch?v=RdjDhHc1NEI">here</a>.</p><p><strong>Effective Ownership and Progress Tracking in Migration to Snowflake</strong></p><p>Ensure that the customer takes active ownership of the migration efforts rather than relying solely on the migration partner. It’s crucial for the customer to provide subject matter experts (SMEs) to support the migration and ensure alignment across all levels of the organization with the common goal and the benefits of transitioning to Snowflake.</p><p>Additionally, implement a transparent system to track the progress of the migration. Monitor ETL conversion, unit testing, QA validations, and the status of defects. A robust tracking process across different phases of migration ensures accurate reporting of activities and statuses to upper management, stakeholders, and anyone else involved.</p><p><strong>A Solid Testing Strategy Makes the Difference</strong></p><p>I cannot stress enough the importance of a robust testing strategy. It’s crucial to have tools and processes in place for data integrity testing during the migration process to ensure that data transferred from the source database to the target database is accurate and complete. Similarly, testing the functionality of migrating ETL applications and processes is essential to ensure they perform correctly on the new platform.</p><p>A practical approach is to validate a few sets of daily files against baselined historical data before initiating full-fledged parallel ETL runs. This preemptive validation helps identify and resolve any issues effectively before scaling up operations.</p><p><strong>Bridging Tables and considerations</strong></p><p>Bridging involves transferring a specific set of tables from the source database to the target database on a daily basis. This data transfer can be incremental or a full refresh, depending on the table type, and must occur immediately after those tables are populated in the source system to support the functionality of a migrated or migrating application in the target system.</p><p>This process becomes particularly critical when the migration occurs in phases or when multiple teams are working on migrating applications in parallel, as it prevents one team’s loading issues from disrupting the progress of others. Therefore, having robust solutions or tools to efficiently move data between environments is essential. Note that this approach may require additional processes to synchronize system-generated IDs across platforms and careful planning for UAT testing and cutover.</p><p>When the go-live happens in phases, the bridging process becomes invaluable, allowing each application to complete the UAT/parallel run phases without waiting for other applications to make the dependent tables available. After UAT and validation, you can then redirect/repoint to the actual tables once the dependent applications are certified on Snowflake. This approach streamlines the UAT and validation process post-transition to the actual tables.</p><p><strong>Engage Business Users Early for Successful Migration</strong></p><p>Engage business users early in the process. Especially if you are redesigning the ETL workflow, involving business users from the start ensures that the redesigned application meets functional requirements. It also helps confirm that any variances in calculations or metrics are within acceptable limits. Waiting until the end, assuming business users will be okay with the variances, can escalate issues and may even prevent final approval for the cutover, jeopardizing your timeline.</p><p>Similarly, identify UAT users in advance, collect UAT queries, and assist in converting these queries to the new platform. Completing rounds of testing and validation before starting UAT can significantly accelerate the migration process.</p><p><strong>Managing Inflight Changes during migration</strong></p><p>Inflight changes are modifications applied to the source system during the migration process. Avoid working in silos, as it’s challenging to implement a complete freeze on the existing system due to business requirements. Establish a tracker to monitor changes occurring in the source system by different application teams. Agree on a process to share the code for inflight changes with the migration team, ensuring these changes are applied to both the source and target systems. This collaboration helps ensure the entire application is successfully migrated to the new platform.</p><p><strong>System Integration Testing (SIT)</strong></p><p>System integration testing (SIT) is crucial for the success of migration projects, especially when applications are developed concurrently or by different teams. It plays a pivotal role throughout the migration journey by ensuring several key benefits.</p><p>One primary advantage of robust SIT is its ability to identify data consistency issues. By verifying that data transformations, mappings, and conversions are executed accurately, and that data integrity constraints are upheld, SIT helps prevent data discrepancies between the source and target systems.</p><p>Additionally, SIT validates system functionality by ensuring that all database objects and ETL processes perform as expected on the new platform. This validation is essential to confirm that the migrated system meets functional requirements and aligns with business needs. As a result, stakeholders, end-users, and management gain confidence that the migrated system operates reliably and securely in its new environment.</p><p><strong>Migration and Performance Considerations</strong></p><p>Snowflake’s unique architecture, with separate storage and compute layers, eliminates resource contention, and its columnar micro-partitions offer a performance boost for most migrating applications. Generally, a large percentage of SQL queries perform the same or better on Snowflake compared to the source system. However, some source SQL queries may run slower on Snowflake.</p><p>Focusing on individual queries is not the optimal approach. Instead, the objective should be to ensure that ETL jobs, end-to-end, run better or at least as well on Snowflake and meet the SLAs. Performance tuning is a mix of art and science, and diverting all attention to it can derail the timeline. Performance-related issues should be added to your backlog and addressed post-migration, with the caveat of addressing the critical issues before go-live. This post-migration hardening phase should include tuning queries, optimizing code, and right-sizing the warehouse.</p><p>As mentioned, if major performance issues are encountered during the development or QA phases, the migration team can do the initial analysis and tuning before passing them to a dedicated platform or performance team. The goal is to address critical performance issues during the SIT/parallel run or before the UAT phase to ensure business users have their data ready on time. This will also help secure approval for go-live from satisfied business users.</p><p><strong>Final Cutover and Decommissioning</strong></p><p>The final cutover and decommission planning phase are crucial for completing the migration project successfully, ensuring minimal disruption to operations, maintaining data integrity, optimizing resources, and complying with security requirements. Proper planning and execution in this phase contribute significantly to the overall success of the database migration project.</p><p><strong>Fail Early</strong></p><p>Be agile and prepared to make adjustments if something isn’t working. If the migration becomes more complicated than anticipated, there should be enough indicators to identify the issues early on. Don’t wait until the end to change course. By identifying and addressing problems early, you increase the chances of meeting your timeline. For instance, if you chose to migrate one application as a pilot and things are not progressing as planned, it’s a clear sign that adjustments are needed.</p><h3>Let’s Move On…</h3><p>While the above points don’t encompass every phase of an end-to-end migration journey, they highlight critical areas that are often overlooked. Focusing on these aspects can significantly enhance the likelihood of a successful migration to the Snowflake platform. By incorporating these lessons learned, migrations can become more efficient, less stressful, and ultimately more successful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f97029b97766" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>