Date
May 31, 2024
Topic
Snowflake
How to Build a Data App on Snowflake: A Guide by Cogwise
Thinking of building a data app? Snowflake offers a robust platform to get started. At Cogwise, we've leveraged Snowflake's powerful features to help numerous clients build data-intensive applications. Here's a step-by-step guide to creating a data app on Snowflake, highlighting some of the best practices and tools available.

What is a Data App?

Data apps, also known as connected applications, are applications that connect directly to your data warehouse to perform data-intensive services. These apps enable real-time data processing and analysis, providing users with valuable insights and functionality without needing to move data across different platforms.‍

Building a Data App on Snowflake

There are several methods to build a data app on Snowflake, each with its unique advantages. Here, we'll explore three primary approaches: using Snowflake External Functions, leveraging Snowflake Data Share, and creating warehouse-agnostic data apps.

1. Serverless Data App (Snowflake External Functions)

Snowflake External Function-as-a-Service (SEFaaS)

One of the most seamless ways to build a data app is by using Snowflake External Functions. This method leverages serverless functions, such as AWS Lambda, to interact with Snowflake without requiring additional infrastructure. Here's how it works:

  1. Set Up External Functions: Define and register your external functions in Snowflake, linking them to your serverless function (e.g., AWS Lambda).
  2. Trigger Functions: Use Snowflake SQL queries to trigger these external functions, allowing them to process data and return results directly to Snowflake.
  3. Security: Implement security measures, such as encrypting data before it reaches the external function, to ensure data protection.

Example Use Case: Affinio has successfully built AI/ML apps on customer data for marketing purposes using this model.

2. Data App via Snowflake Data Share

Snowflake Data Share is ideal for established SaaS managed-apps already using Snowflake. This method allows seamless data sharing between Snowflake accounts, enabling both data consumption and provision without needing ETLs.

  1. Data Sharing Setup: Configure Snowflake Data Share to allow secure data sharing between accounts.
  2. Data Processing: Develop your app to consume customer data from Snowflake and provide processed data, events, or analytics back to the customer.
  3. Integration: Utilize Snowflake’s robust sharing capabilities to integrate data seamlessly into your app’s workflow.

Example Use Case: SIEM replacements like Hunters and Customer Data Platforms (CDPs) like Simon Data use this model for enhanced data processing and sharing.

3. Warehouse-agnostic Data App

For a more flexible approach, consider building a warehouse-agnostic data app. This method allows your app to interact with various data warehouses, not just Snowflake.

  1. Architecture Design: Architect your solution to be compatible with multiple data warehouses. Use SEFaaS or Snowflake Data Share as a starting point.
  2. Additional Data Store: Implement a data store for staging or caching data to handle low-latency requests efficiently. Options include data lakes, OLTP databases, in-memory databases, or headless BI services.
  3. Deployment Strategy: Decide on the deployment model—single-tenant, multi-tenant, or hybrid. Address infrastructure ownership and management questions to ensure scalability and security.

Example Use Case: MessageGears uses a data lake for its Message product and an OLTP database with in-memory caching for its Engage API.

Tools and Technologies

Streamlit

Snowflake’s acquisition of Streamlit has simplified the development of data apps. Streamlit allows you to turn Python scripts into shareable web apps quickly, making it an excellent tool for building interactive data applications.‍Snowflake MarketplaceLeverage the Snowflake Marketplace to find and integrate third-party data and solutions into your app. This platform enhances your app's capabilities by providing access to a wide range of datasets and applications.

Future of Data Apps

The market for data apps is rapidly evolving, with increasing adoption of modern data stack tools. Building your data app on Snowflake now gives you a competitive edge, allowing you to capitalize on this trend and disrupt your industry.

Conclusion

Snowflake provides a versatile and powerful platform for building data apps. Whether you choose to use Snowflake External Functions, Data Share, or create a warehouse-agnostic app, Snowflake’s features and tools can help you develop robust, scalable, and efficient data applications.

At Cogwise, we're excited to help you navigate this journey. If you’re building a data app, let us know! We’d love to learn more about your project and share insights on leveraging Snowflake to its fullest potential.

For more information or assistance with your data app development, contact us at Cogwise. Let's build something amazing together.