{"templateName":"quickstart-page-template","cssClassNames":"page basicpage summit-page","canonicalLink":"https://www.snowflake.com/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/","robotsTags":[],"allowedRenditionsWidth":["320","480","640","768","960","1200","1440","1920"],"language":"en","title":"Replicate MongoDB Data to Snowflake with Estuary","analyticsPageType":"homepage","analyticsCategory":"general","analyticsSubCategory":"","excludeFromAnalytics":false,":mappedPath":"/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/",":type":"snowflake-site/components/structure/page",":items":{"root":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"markup_editor_1950346551":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-banner":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-header":"aem-GridColumn aem-GridColumn--default--12","responsivegrid":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-footer":"aem-GridColumn aem-GridColumn--default--12","modal_container":"aem-GridColumn aem-GridColumn--default--12","markup_editor":"aem-GridColumn aem-GridColumn--default--12"},":items":{"experiencefragment-banner":{"id":"experiencefragment-9c57757661","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/pushdown-banner/master/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/pushdown-banner/master.xfmodel.json"},"experiencefragment-header":{"id":"experiencefragment-5ff396baf4","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/mega-nav-header/master/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/mega-nav-header/master.xfmodel.json","languageNavPath":"/content/snowflake-site/global/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary.languagenav.json"},"markup_editor_1950346551":{"id":"markup-editor-153806313a","title":" ","cssContent":".snowflake-markdown-table code[class*=language-],.snowflake-markdown-table code[class*=language-],.snowflake-markdown .snowflake-text code[class*=language-],.snowflake-markdown .snowflake-text pre[class*=language-]{background-color:rgba(var(--ui-12-rgb),.5);color:var(--text-01);text-shadow:none;padding:var(--spacing-00);border-radius:var(--spacing-00);font-size:smaller}",":type":"snowflake-site/components/markup-editor","isGSAPEnabled":false},"responsivegrid":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"quickstart_hero":"aem-GridColumn aem-GridColumn--default--12","flexible_column_cont":"aem-GridColumn aem-GridColumn--default--12","markup_editor":"aem-GridColumn aem-GridColumn--default--12"},":items":{"quickstart_hero":{"id":"quickstart-hero-89dcb0764f","quickstartHeroForkRepoLink":{"id":"button-ccc9654477","showOutboundIcon":false,"buttonLink":{"valid":true,"attributes":{"target":"_blank"},"url":"https://github.com/Snowflake-Labs/sfquickstarts/tree/master/site/sfguides/src/replicate-mongodb-data-to-snowflake-with-estuary"},"linkTargetContentType":"GENERIC",":type":"snowflake-site/components/button","linkType":"SNOWFLAKE_EXTERNAL","text":"Fork Repo"},"quickstartHeroBreadcrumbs":[{"title":"Replicate MongoDB Data to Snowflake with Estuary","url":"https://www.snowflake.com/content/snowflake-site/global/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary","currentPage":true},{"title":"Guides","url":"https://www.snowflake.com/content/snowflake-site/global/en/developers/guides","currentPage":false},{"title":"Snowflake for Developers","url":"https://www.snowflake.com/content/snowflake-site/global/en/developers","currentPage":false}],"quickstartHeroTitle":{"lines":["Replicate MongoDB Data to Snowflake with Estuary"],"type":"heading2",":type":"snowflake-site/components/title-v2"},"quickstartHeroAuthor":"Emily Lucek","quickstartHeroFirstSnowflakeFeatureTag":{"tagText":"Ingestion","tagColor":"#29B5E8","tagPath":"/content/cq:tags/snowflake-site/taxonomy/snowflake-feature/ingestion","tagIcon":""},"fragmentPath":"/content/dam/snowflake-site/en/content-fragments/quickstarts/replicate-mongodb-data-to-snowflake-with-estuary",":type":"snowflake-site/components/quickstart/quickstart-hero","isDeveloperGuidesPage":false,"quickstartHeroFirstCertifiedTag":{"tagText":"Partner Solution","tagColor":"#29B5E8","tagPath":"/content/cq:tags/snowflake-site/taxonomy/solution-center/certification/partner-solution","tagIcon":""}},"flexible_column_cont":{"id":"flexible-column-container-b95b50d0d6","propertiesId":"quickstart-template-main-flexible-container","type":"2-column-75-25","alignColumns":"top","containerMaxWidth":"extra-large","topPadding":"none","bottomPadding":"none","spaceBetween":"small","reverseOnMobile":false,"carouselOnMobile":false,"backgroundImageOption":"none","flexible_column_content_container_1":{"layout":"SIMPLE","id":"container-2ecd389bc7",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"contentfragment":{"id":"contentfragment-e9f71f8e1c","paragraphs":["&lt;!-- ------------------------ --&gt;\n","\u003Ch2\u003EOverview\u003C/h2\u003E\n","\u003Cp\u003E\u003Ca href=\"https://www.mongodb.com/\"\u003EMongoDB\u003C/a\u003E is one of the most popular document stores, or NoSQL databases, available today.\nIt can flexibly handle schemas and its JSON document format matches many web developers' needs, so it's a frequent choice for a web application backend.\u003C/p\u003E\n","\u003Cp\u003EHowever, any one database solution can't be everything for everyone. When it's time for analytics, many engineers turn to \u003Ca href=\"https://www.snowflake.com/\"\u003ESnowflake\u003C/a\u003E.\u003C/p\u003E\n","\u003Cp\u003EA data warehouse built with speed and scalability in mind, Snowflake allows users to run queries across vast datasets without impacting production servers.\nSnowflake can unify data, combining and allowing querying on structured and unstructured data.\u003C/p\u003E\n","\u003Cp\u003EMoving data from one place to another is one of those common engineering tasks that has been solved and solved again.\nInstead of reinventing the wheel with custom pipelines each time the need arises, engineers can choose from a host of data pipeline tools, like Estuary.\u003C/p\u003E\n","\u003Cp\u003E\u003Ca href=\"https://estuary.dev/\"\u003EEstuary\u003C/a\u003E provides connectors for low- and no-code pipelines, so engineers can start moving data in a matter of minutes.\nIt's a flexible product with the ability to retrieve data in real-time or in batch workflows (or both in the same pipeline) and allows for detailed data transformation.\u003C/p\u003E\n","\u003Cp\u003EIn this guide, we'll use Estuary to build a full pipeline from MongoDB to Snowflake, exploring aspects of the different systems along the way.\u003C/p\u003E\n","\u003Ch3\u003EPrerequisites\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003EFamiliarity with working with databases\u003C/li\u003E\u003C/ul\u003E\n","\u003Ch3\u003EWhat You'll Learn\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003EHow to set up a MongoDB cluster\u003C/li\u003E\u003Cli\u003EHow to configure source and destination connectors in Estuary\u003C/li\u003E\u003Cli\u003EHow CDC and Snowpipe Streaming combine for real-time data flows\u003C/li\u003E\u003C/ul\u003E\n","\u003Ch3\u003EWhat You'll Need\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003EAn \u003Ca href=\"https://dashboard.estuary.dev/register\"\u003EEstuary\u003C/a\u003E account\u003C/li\u003E\u003Cli\u003EA \u003Ca href=\"https://www.mongodb.com/cloud/atlas/register\"\u003EMongoDB\u003C/a\u003E account\u003C/li\u003E\u003Cli\u003EA \u003Ca href=\"https://signup.snowflake.com/\"\u003ESnowflake\u003C/a\u003E account\u003C/li\u003E\u003C/ul\u003E\n","\u003Cp\u003EFree trial versions are available for all resources. We'll explore specific setup in depth later in this guide.\u003C/p\u003E\n","\u003Ch3\u003EWhat You'll Build\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003EA complete pipeline from MongoDB to Snowflake, with the option for real-time data\u003C/li\u003E\u003C/ul\u003E\n&lt;!-- ------------------------ --&gt;\n","\u003Ch2\u003EInitial MongoDB Setup\u003C/h2\u003E\n","\u003Cp\u003EFor this tutorial, we'll set up a new MongoDB cluster in Atlas and prepare it for connection with Estuary.\nIf you already have a MongoDB database you'd like to use, you can skip cluster creation steps, but note that you will still need to provision configurations like IP allowlisting.\u003C/p\u003E\n","\u003Ch3\u003ECreate a Cluster\u003C/h3\u003E\n","\u003Cp\u003ETo start, \u003Ca href=\"https://account.mongodb.com/account/login\"\u003Elog in to your MongoDB\u003C/a\u003E account.\u003C/p\u003E\n","\u003Cp\u003ESelect the \u003Cstrong\u003ECreate Cluster\u003C/strong\u003E button. You will see a configuration screen:\u003C/p\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-setup.png\" alt=\"MongoDB cluster configuration screen\"\u003E\u003C/p\u003E\n","\u003Cp\u003EOn this screen:\u003C/p\u003E\n\u003Cul\u003E\u003Cli\u003ESelect the free M0 cluster.\n\u003Cul\u003E\u003Cli\u003ENote that you can only have one free Atlas M0 cluster. If you already have a cluster and don't wish to rack up charges, you may use your existing cluster for this tutorial.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EEnsure that the \u003Cstrong\u003EPreload sample dataset\u003C/strong\u003E option is checked.\n\u003Cul\u003E\u003Cli\u003EThis will give us some starting data to transfer to Snowflake.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EOptionally update your provider or region.\n\u003Cul\u003E\u003Cli\u003EMongoDB's pre-selected options should be sufficient for most cases.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003C/ul\u003E\n","\u003Cp\u003EOnce everything is configured, select \u003Cstrong\u003ECreate Deployment\u003C/strong\u003E.\u003C/p\u003E\n","\u003Cp\u003EYou will then move on to a screen with connection options. Here:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003ESelect the \u003Cstrong\u003EShell\u003C/strong\u003E connection option.\n\u003Cul\u003E\u003Cli\u003EWe will not use the \u003Ccode\u003Emongosh\u003C/code\u003E CLI itself, so you can skip the steps listed on the connection screen.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EFind the example CLI command that includes your MongoDB server address.\n\u003Cul\u003E\u003Cli\u003EThis should be something like \u003Ccode\u003Emongodb+srv://your-cluster-name.abc.mongodb.net/\u003C/code\u003E.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003ECopy the server address and save it for later.\n\u003Cul\u003E\u003Cli\u003EWe'll use this information in the next step, &quot;Create a Capture in Estuary.&quot;\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EYou can then close the overlay.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-connection-string.png\" alt=\"MongoDB connection string\"\u003E\u003C/p\u003E\n","\u003Cp\u003EIt may take a few minutes to finish loading the sample dataset. After that, your database will be all set up!\nFeel free to browse your MongoDB collections to become familiar with the generated data structure.\u003C/p\u003E\n","\u003Ch3\u003EAdd a Database User\u003C/h3\u003E\n","\u003Cp\u003EWhile we're still in the MongoDB dashboard, let's set up a couple more items so that creating a capture with Estuary later will be smooth sailing.\u003C/p\u003E\n","\u003Cp\u003EFirst on the list is to create a service account for Estuary access.\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003EOn the lefthand sidebar, find the \u003Cstrong\u003ESecurity\u003C/strong\u003E section and select \u003Cstrong\u003EDatabase &amp; Network Access\u003C/strong\u003E.\u003C/li\u003E\u003Cli\u003EClick the \u003Cstrong\u003EAdd new database user\u003C/strong\u003E button.\u003C/li\u003E\u003Cli\u003EProvide a username and password under \u003Cstrong\u003EPassword Authentication\u003C/strong\u003E.\n\u003Cul\u003E\u003Cli\u003EMake sure to save these details for later.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EUnder \u003Cstrong\u003EDatabase User Privileges\u003C/strong\u003E, add a role to confer at least Read privileges to your user.\u003C/li\u003E\u003Cli\u003EClick \u003Cstrong\u003EAdd user\u003C/strong\u003E.\u003C/li\u003E\u003C/ol\u003E\n","\u003Ch3\u003EConfigure Network Access\u003C/h3\u003E\n","\u003Cp\u003EBy default, MongoDB restricts access to your cluster to certain known IPs.\nSo, besides a user for Estuary, we'll also need to allow incoming traffic from Estuary's IP addresses.\u003C/p\u003E\n","\u003Cp\u003EFor that, we'll first need to retrieve our IP addresses from Estuary.\nEstuary's architecture uses separate control and data planes to facilitate data isolation.\nThis also means that each data plane has its own set of IP addresses.\u003C/p\u003E\n","\u003Cp\u003EWe can look up the relevant IPs from the Estuary dashboard:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003E\u003Ca href=\"https://dashboard.estuary.dev/\"\u003ELog in to your Estuary account\u003C/a\u003E.\u003C/li\u003E\u003Cli\u003ENavigate to the \u003Ca href=\"https://dashboard.estuary.dev/admin/settings\"\u003EAdmin Settings page\u003C/a\u003E (select \u003Cstrong\u003EAdmin\u003C/strong\u003E from the sidebar and then the \u003Cstrong\u003ESettings\u003C/strong\u003E tab).\u003C/li\u003E\u003Cli\u003EScroll down to the \u003Cstrong\u003EData Planes\u003C/strong\u003E table.\n\u003Cul\u003E\u003Cli\u003EThis table lists all available data planes for your account. The best choice is often the data plane whose cloud provider and region most closely match your Snowflake and MongoDB selections.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003ESelect the data plane you intend to use for your pipeline. This opens a modal with additional details.\u003C/li\u003E\u003Cli\u003ECopy the provided IP addresses for that data plane. These addresses are stable.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-data-plane-ips.png\" alt=\"Estuary data plane modal\"\u003E\u003C/p\u003E\n","\u003Cp\u003EBack in the MongoDB dashboard, add these IPs to your access list:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003EFind the \u003Cstrong\u003EIP Access List\u003C/strong\u003E page.\n\u003Cul\u003E\u003Cli\u003EThis will be under the \u003Cstrong\u003EDatabase &amp; Network Access\u003C/strong\u003E section, same as \u003Cstrong\u003EDatabase Users\u003C/strong\u003E.\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EClick the \u003Cstrong\u003EAdd IP address\u003C/strong\u003E button.\u003C/li\u003E\u003Cli\u003EAdd the desired IP to the \u003Cstrong\u003EAccess List Entry\u003C/strong\u003E field.\u003C/li\u003E\u003Cli\u003EOptionally add a comment (such as &quot;estuary&quot;) and \u003Cstrong\u003EConfirm\u003C/strong\u003E.\u003C/li\u003E\u003Cli\u003ERepeat for multiple data plane IPs.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-network.png\" alt=\"MongoDB Network Access\"\u003E\u003C/p\u003E\n","\u003Cp\u003EWith all of that configured, we're done with the MongoDB dashboard for now.\nLet's move back to the Estuary dashboard to capture our MongoDB data and start our pipeline.\u003C/p\u003E\n&lt;!-- ------------------------ --&gt;\n","\u003Ch2\u003ECreate a Capture in Estuary\u003C/h2\u003E\n","\u003Cp\u003ENow that we actually have data to replicate, we can begin our Estuary pipeline.\u003C/p\u003E\n","\u003Cp\u003EEstuary's MongoDB connector uses CDC, or Change Data Capture, to stay up-to-date with your database's data.\nCDC captures a stream of changes as they occur, including insertions, updates, and deletions.\u003C/p\u003E\n","\u003Cp\u003EIn MongoDB, CDC is often implemented using \u003Ca href=\"https://estuary.dev/blog/mongodb-change-data-capture/\"\u003Echange streams\u003C/a\u003E.\nThis is what Estuary will use, on a preferential basis, to follow along with change events.\u003C/p\u003E\n","\u003Cp\u003ECDC on your source in turn allows you to keep downstream systems updated in real time with a complete history of records.\u003C/p\u003E\n","\u003Cp\u003ETo set up your MongoDB source connector in Estuary:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003EBegin from the \u003Ca href=\"https://dashboard.estuary.dev/\"\u003EEstuary dashboard\u003C/a\u003E.\u003C/li\u003E\u003Cli\u003EOn the lefthand sidebar, select \u003Cstrong\u003ESources\u003C/strong\u003E.\u003C/li\u003E\u003Cli\u003EClick the \u003Cstrong\u003ENew Capture\u003C/strong\u003E button.\u003C/li\u003E\u003Cli\u003ESearch for &quot;MongoDB&quot; and select \u003Cstrong\u003ECapture\u003C/strong\u003E.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003EThis will open a configuration screen for the capture.\nHere, make sure to fill out the following required fields in the \u003Cstrong\u003ECapture Details\u003C/strong\u003E and \u003Cstrong\u003EEndpoint Config\u003C/strong\u003E sections:\u003C/p\u003E\n\u003Cul\u003E\u003Cli\u003E\u003Cstrong\u003EName:\u003C/strong\u003E a unique name for your capture.\u003C/li\u003E\u003Cli\u003E\u003Cstrong\u003EData Plane:\u003C/strong\u003E make sure you select the data plane whose IPs you allowlisted in MongoDB.\u003C/li\u003E\u003Cli\u003E\u003Cstrong\u003EAddress:\u003C/strong\u003E the server address you retrieved from MongoDB's connection options screen in the last section.\u003C/li\u003E\u003Cli\u003E\u003Cstrong\u003EUser:\u003C/strong\u003E the username for the MongoDB database user you created in the last section.\u003C/li\u003E\u003Cli\u003E\u003Cstrong\u003EPassword:\u003C/strong\u003E the password for the MongoDB database user you created in the last section.\u003C/li\u003E\u003C/ul\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-source-setup.png\" alt=\"MongoDB capture connector setup in Estuary\"\u003E\u003C/p\u003E\n","\u003Cp\u003EFor this demo, the required fields are all we need.\nTo customize your experience further, you can optionally configure other settings.\nSee \u003Ca href=\"https://docs.estuary.dev/reference/Connectors/capture-connectors/MongoDB/\"\u003EEstuary's documentation\u003C/a\u003E for more on these additional MongoDB capture options.\u003C/p\u003E\n","\u003Cp\u003EWhen your configuration is ready, press the blue \u003Cstrong\u003ENext\u003C/strong\u003E button.\u003C/p\u003E\n","\u003Cp\u003EEstuary will automatically discover available databases and tables in your cluster.\nYou can select from any, or all, of these schemas to replicate.\nChoose one or more you'd like to transfer to Snowflake and then click \u003Cstrong\u003ESave and Publish\u003C/strong\u003E.\u003C/p\u003E\n","\u003Cp\u003EYour selected datasets will start to populate associated Estuary \u003Cem\u003Ecollections\u003C/em\u003E.\nThis is an intermediate step between sources and destinations that allows you to easily replay or backfill data, or combine multiple sources and destinations in your pipeline.\nYou can also select a collection to preview the data it's received so far from your capture.\u003C/p\u003E\n","\u003Cp\u003EWhile this guide won't go into much depth on collections, this would be where you could apply SQL, TypeScript, or Python transformations on your data before storage in your destination.\u003C/p\u003E\n","\u003Cp\u003EIn the next step, we'll finally get to work with Snowflake as we finalize our data pipeline.\u003C/p\u003E\n&lt;!-- ------------------------ --&gt;\n","\u003Ch2\u003ECreate a Snowflake Materialization\u003C/h2\u003E\n","\u003Cp\u003EIt's time for Snowflake to take center stage.\nConnector setup for our materialization will be similar to our capture: we'll first perform some prep on Snowflake's end before completing the connection in Estuary.\u003C/p\u003E\n","\u003Ch3\u003ESet up Snowflake resources\u003C/h3\u003E\n","\u003Cp\u003EOn the Snowflake side:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003EOpen up your Snowflake console.\u003C/li\u003E\u003Cli\u003ECreate a new SQL worksheet: click the \u003Cstrong\u003E+\u003C/strong\u003E button and select to create a new SQL file.\u003C/li\u003E\u003Cli\u003ECopy the following script and paste it into the SQL console. This will set up some resources for your integration, including a service user for Estuary.\u003C/li\u003E\u003C/ol\u003E\n\u003Cpre\u003E\u003Ccode class=\"language-SQL\"\u003Eset database_name = 'ESTUARY_DB';\nset warehouse_name = 'ESTUARY_WH';\nset estuary_role = 'ESTUARY_ROLE';\nset estuary_user = 'ESTUARY_USER';\nset estuary_schema = 'ESTUARY_SCHEMA';\n-- create role and schema for Estuary\ncreate role if not exists identifier($estuary_role);\ngrant role identifier($estuary_role) to role SYSADMIN;\n-- Create snowflake DB\ncreate database if not exists identifier($database_name);\nuse database identifier($database_name);\ncreate schema if not exists identifier($estuary_schema);\n-- create a user for Estuary\ncreate user if not exists identifier($estuary_user)\n  type = service\n  default_role = $estuary_role\n  default_warehouse = $warehouse_name;\ngrant role identifier($estuary_role) to user identifier($estuary_user);\n-- Estuary requires case-sensitive quoted identifiers (e.g. &quot;_meta/op&quot;).\nalter user identifier($estuary_user) set QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;\ngrant all on schema identifier($estuary_schema) to identifier($estuary_role);\n-- create a warehouse for Estuary\ncreate warehouse if not exists identifier($warehouse_name)\n  warehouse_size = xsmall\n  warehouse_type = standard\n  auto_suspend = 60\n  auto_resume = true\n  initially_suspended = true;\n-- grant Estuary role access to warehouse\ngrant USAGE\n  on warehouse identifier($warehouse_name)\n  to role identifier($estuary_role);\n-- grant Estuary access to database\ngrant CREATE SCHEMA, MONITOR, USAGE on database identifier($database_name) to role identifier($estuary_role);\n-- change role to ACCOUNTADMIN for STORAGE INTEGRATION support to Estuary (only needed for Snowflake on GCP)\nuse role ACCOUNTADMIN;\ngrant CREATE INTEGRATION on account to role identifier($estuary_role);\nuse role sysadmin;\nCOMMIT;\n\u003C/code\u003E\u003C/pre\u003E\n\u003Col start=\"4\"\u003E\u003Cli\u003ESelect the drop-down arrow next to the \u003Cstrong\u003ERun\u003C/strong\u003E button and choose to \u003Cstrong\u003ERun All\u003C/strong\u003E.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003ESnowflake will execute the queries, creating a user, schema, database, and warehouse, and granting the proper permissions.\u003C/p\u003E\n","\u003Cp\u003EWe'll then need to set up JWT authentication for our service user.\nFor that, we need to generate a public-private \u003Ca href=\"https://docs.snowflake.com/en/user-guide/key-pair-auth\"\u003Ekey-pair\u003C/a\u003E.\nThe public key will be attached to the Snowflake user while Estuary will hold the private key.\u003C/p\u003E\n","\u003Cp\u003EYou can generate your keys in a terminal using \u003Ccode\u003Eopenssl\u003C/code\u003E:\u003C/p\u003E\n\u003Cpre\u003E\u003Ccode class=\"language-shell\"\u003E# generate a private key\nopenssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt\n# generate a public key\nopenssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub\n# read the public key and copy it to clipboard\ncat rsa_key.pub\n\u003C/code\u003E\u003C/pre\u003E\n","\u003Cp\u003EPaste your public key into an \u003Ccode\u003EALTER USER\u003C/code\u003E statement in Snowflake and run the command:\u003C/p\u003E\n\u003Cpre\u003E\u003Ccode class=\"language-SQL\"\u003EALTER USER identifier($estuary_user) SET RSA_PUBLIC_KEY='MIIBIjANBgkqh...';\n\u003C/code\u003E\u003C/pre\u003E\n","\u003Ch3\u003EMaterialization creation\u003C/h3\u003E\n","\u003Cp\u003EWith all of our Snowflake resources set up, we can then move back to the Estuary dashboard to create the materialization.\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003E\n","\u003Cp\u003EIn the Estuary dashboard, select the \u003Cstrong\u003EDestinations\u003C/strong\u003E page.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003EClick the \u003Cstrong\u003ENew Materialization\u003C/strong\u003E button.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003ESearch for &quot;Snowflake&quot; and select \u003Cstrong\u003EMaterialization\u003C/strong\u003E.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003EAdd a name and data plane for the materialization and fill out required fields in the \u003Cstrong\u003EEndpoint Config\u003C/strong\u003E.\u003C/p\u003E\n\u003Cul\u003E\u003Cli\u003EThe majority of these details will be based on the SQL script you executed. The default values would therefore be:\n\u003Cul\u003E\u003Cli\u003EDatabase: \u003Ccode\u003EESTUARY_DB\u003C/code\u003E\u003C/li\u003E\u003Cli\u003ESchema: \u003Ccode\u003EESTUARY_SCHEMA\u003C/code\u003E\u003C/li\u003E\u003Cli\u003EWarehouse: \u003Ccode\u003EESTUARY_WH\u003C/code\u003E\u003C/li\u003E\u003Cli\u003ERole: \u003Ccode\u003EESTUARY_ROLE\u003C/code\u003E\u003C/li\u003E\u003Cli\u003EUser: \u003Ccode\u003EESTUARY_USER\u003C/code\u003E\u003C/li\u003E\u003C/ul\u003E\n\u003C/li\u003E\u003Cli\u003EYou can find your Snowflake Host URL by retrieving your Snowflake \u003Ca href=\"https://docs.snowflake.com/en/user-guide/admin-account-identifier\"\u003Eaccount identifier\u003C/a\u003E. Your full URL will look something like \u003Ccode\u003Eorgname-accountname.snowflakecomputing.com\u003C/code\u003E.\u003C/li\u003E\u003Cli\u003EMake sure to provide the private key you generated under \u003Cstrong\u003EAuthentication\u003C/strong\u003E.\u003C/li\u003E\u003Cli\u003EYou will also need to select a \u003Cstrong\u003ESnowflake Timestamp Type\u003C/strong\u003E. Unless you've explicitly set a \u003Ccode\u003ETIMESTAMP_TYPE_MAPPING\u003C/code\u003E in Snowflake, you can choose whatever option you'd prefer in Estuary. As a default for this demo, we can go with \u003Ca href=\"https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/#timestamp-data-type-mapping\"\u003E\u003Ccode\u003ETIMESTAMP_LTZ\u003C/code\u003E\u003C/a\u003E.\u003C/li\u003E\u003C/ul\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-destination-setup.png\" alt=\"Snowflake materialization connector setup in Estuary\"\u003E\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003EUnder the \u003Cstrong\u003ESource Collections\u003C/strong\u003E section, find \u003Cstrong\u003ELink Capture\u003C/strong\u003E and click \u003Cstrong\u003EModify\u003C/strong\u003E.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003ESelect your MongoDB capture and click \u003Cstrong\u003EContinue\u003C/strong\u003E.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003EYou will then be prompted to decide what you want your \u003Cstrong\u003EDestination Layout\u003C/strong\u003E to look like. This gives you control over how your schema and tables should appear in Snowflake. Use the Snowflake schema you created: select \u003Cstrong\u003ESet a default schema\u003C/strong\u003E and provide \u003Ccode\u003EESTUARY_SCHEMA\u003C/code\u003E as the name.\u003C/p\u003E\n\u003C/li\u003E\u003Cli\u003E\n","\u003Cp\u003EFinalize your choice with \u003Cstrong\u003ESet source capture\u003C/strong\u003E.\u003C/p\u003E\n\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003EWith the basic configuration set, there are numerous ways to customize the integration further.\nSee \u003Ca href=\"https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/\"\u003EEstuary's documentation\u003C/a\u003E for a full list of options.\u003C/p\u003E\n","\u003Cp\u003EWhile we're here, though, let's take a look at one of the most popular configuration options: using Snowpipe Streaming.\u003C/p\u003E\n","\u003Ch3\u003EUsing Snowpipe Streaming\u003C/h3\u003E\n","\u003Cp\u003EOn the capture side, Estuary is using MongoDB's change streams to enable real-time data movement.\nBut our pipeline isn't going to be real-time unless our destination can ingest that data in real time as well.\u003C/p\u003E\n","\u003Cp\u003ESnowflake's answer to this is Snowpipe Streaming, which offers much lower latency than standard warehouse \u003Ccode\u003ECOPY INTO\u003C/code\u003E commands.\nEstuary can use Snowpipe Streaming to load data into Snowflake; we just need to modify some settings to do so.\u003C/p\u003E\n","\u003Cp\u003EFirst up is the \u003Cstrong\u003ESync Schedule\u003C/strong\u003E.\u003C/p\u003E\n","\u003Cp\u003EBack under the \u003Cstrong\u003EEndpoint Config\u003C/strong\u003E, the Sync Schedule section lets you choose how often you want to load data into your destination.\nBy default, Estuary sets this to 30 minutes to follow a standard batch warehouse cadence.\nTo sync data as fast as possible for real-time data flows, set the \u003Cstrong\u003ESync Frequency\u003C/strong\u003E to 0 seconds (\u003Ccode\u003E0s\u003C/code\u003E) instead.\u003C/p\u003E\n","\u003Cp\u003EBy itself, this still uses Estuary's default \u003Cstrong\u003Emerge updates\u003C/strong\u003E.\nMerge updates reduce documents based on the collection key; with Snowflake, they use \u003Ccode\u003ECOPY INTO\u003C/code\u003E behind the scenes.\u003C/p\u003E\n","\u003Cp\u003ETo change this setting, we'll use \u003Cstrong\u003Edelta updates\u003C/strong\u003E instead.\u003C/p\u003E\n","\u003Cp\u003EIn delta updates mode, changes stream as append-only updates.\nAnd with the Snowflake connector, this streaming mode uses Snowpipe Streaming on the back end.\u003C/p\u003E\n","\u003Cp\u003EReturn to the \u003Cstrong\u003ESource Collections\u003C/strong\u003E section in your materialization.\u003C/p\u003E\n","\u003Cp\u003EWe can set delta updates as the default for newly-added collections or select it on a case-by-case basis if we only want specific tables to use it.\nTo use delta updates for all of our MongoDB collections, we can:\u003C/p\u003E\n\u003Col\u003E\u003Cli\u003EToggle on delta updates as a \u003Cstrong\u003EDefault collection setting\u003C/strong\u003E.\u003C/li\u003E\u003Cli\u003ERemove your linked capture and click \u003Cstrong\u003EX\u003C/strong\u003E in the collections table to remove all associated collections. Delta updates will only be set for \u003Cem\u003Enewly added\u003C/em\u003E collections.\u003C/li\u003E\u003Cli\u003ELink your MongoDB capture again to repopulate your collections.\u003C/li\u003E\u003C/ol\u003E\n","\u003Cp\u003E\u003Cimg src=\"https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-collections-table.png\" alt=\"Materialization collections table in Estuary\"\u003E\u003C/p\u003E\n","\u003Cp\u003EEach of your collections should show the \u003Cstrong\u003EDelta Updates\u003C/strong\u003E checkbox as checked.\u003C/p\u003E\n","\u003Cp\u003EWith that, you're all set to stream your updates to Snowflake in real time using Snowpipe Streaming.\nReview your settings and scroll back to the top of the configuration page to save and publish your materialization.\u003C/p\u003E\n","\u003Cp\u003ECheck back in on Snowflake to start exploring your MongoDB data!\nTry making a change in MongoDB and follow its journey; the change should land in Snowflake near-instantaneously.\u003C/p\u003E\n&lt;!-- ------------------------ --&gt;\n","\u003Ch2\u003EConclusion and Resources\u003C/h2\u003E\n","\u003Cp\u003ECongratulations! You set up a data pipeline to transfer MongoDB data directly to your Snowflake warehouse.\nYou learned a bit about the systems involved, including Estuary, and you got some practice configuring data connectors.\u003C/p\u003E\n","\u003Cp\u003EIn this guide, we mainly focused on default configurations, with some notes on enabling real-time data flows.\nThis sped up our process, but it also means we ended up skipping a lot of the possibilities opened up by advanced configuration.\u003C/p\u003E\n","\u003Cp\u003ESee the related resources below for options on more advanced use cases and information on configuring your pipeline.\u003C/p\u003E\n","\u003Ch3\u003EWhat You Learned\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003EHow to move your MongoDB data to Snowflake\u003C/li\u003E\u003Cli\u003EEnabling real-time data by combining CDC and Snowpipe Streaming\u003C/li\u003E\u003Cli\u003EHow to set up connectors to create your own pipeline in Estuary\u003C/li\u003E\u003C/ul\u003E\n","\u003Ch3\u003ERelated Resources\u003C/h3\u003E\n\u003Cul\u003E\u003Cli\u003E\u003Ca href=\"https://www.mongodb.com/docs/\"\u003EMongoDB docs\u003C/a\u003E\u003C/li\u003E\u003Cli\u003E\u003Ca href=\"https://docs.estuary.dev/reference/Connectors/capture-connectors/mongodb/\"\u003EMongoDB Estuary connector reference\u003C/a\u003E\u003C/li\u003E\u003Cli\u003E\u003Ca href=\"https://docs.snowflake.com/\"\u003ESnowflake docs\u003C/a\u003E\u003C/li\u003E\u003Cli\u003E\u003Ca href=\"https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/\"\u003ESnowflake Estuary connector reference\u003C/a\u003E\u003C/li\u003E\u003Cli\u003E\u003Ca href=\"https://docs.estuary.dev/\"\u003EEstuary docs\u003C/a\u003E\u003C/li\u003E\u003C/ul\u003E"],"description":"","title":"Base Quickstart CF",":type":"snowflake-site/components/contentfragment",":items":{},":itemsOrder":[],"elements":{"quickstartArticleBody":{"dataType":"string","title":"Quickstart Article Body","value":"\u003C!-- ------------------------ --\u003E\n## Overview\n\n[MongoDB](https://www.mongodb.com/) is one of the most popular document stores, or NoSQL databases, available today.\nIt can flexibly handle schemas and its JSON document format matches many web developers' needs, so it's a frequent choice for a web application backend.\n\nHowever, any one database solution can't be everything for everyone. When it's time for analytics, many engineers turn to [Snowflake](https://www.snowflake.com/).\n\nA data warehouse built with speed and scalability in mind, Snowflake allows users to run queries across vast datasets without impacting production servers.\nSnowflake can unify data, combining and allowing querying on structured and unstructured data.\n\nMoving data from one place to another is one of those common engineering tasks that has been solved and solved again.\nInstead of reinventing the wheel with custom pipelines each time the need arises, engineers can choose from a host of data pipeline tools, like Estuary.\n\n[Estuary](https://estuary.dev/) provides connectors for low- and no-code pipelines, so engineers can start moving data in a matter of minutes.\nIt's a flexible product with the ability to retrieve data in real-time or in batch workflows (or both in the same pipeline) and allows for detailed data transformation.\n\nIn this guide, we'll use Estuary to build a full pipeline from MongoDB to Snowflake, exploring aspects of the different systems along the way.\n\n### Prerequisites\n* Familiarity with working with databases\n\n### What You'll Learn \n* How to set up a MongoDB cluster\n* How to configure source and destination connectors in Estuary\n* How CDC and Snowpipe Streaming combine for real-time data flows\n\n### What You'll Need \n* An [Estuary](https://dashboard.estuary.dev/register) account\n* A [MongoDB](https://www.mongodb.com/cloud/atlas/register) account\n* A [Snowflake](https://signup.snowflake.com/) account\n\nFree trial versions are available for all resources. We'll explore specific setup in depth later in this guide.\n\n### What You'll Build \n* A complete pipeline from MongoDB to Snowflake, with the option for real-time data\n\n\u003C!-- ------------------------ --\u003E\n## Initial MongoDB Setup\n\nFor this tutorial, we'll set up a new MongoDB cluster in Atlas and prepare it for connection with Estuary.\nIf you already have a MongoDB database you'd like to use, you can skip cluster creation steps, but note that you will still need to provision configurations like IP allowlisting.\n\n### Create a Cluster\n\nTo start, [log in to your MongoDB](https://account.mongodb.com/account/login) account.\n\nSelect the **Create Cluster** button. You will see a configuration screen:\n\n![MongoDB cluster configuration screen](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-setup.png)\n\nOn this screen:\n\n* Select the free M0 cluster.\n   * Note that you can only have one free Atlas M0 cluster. If you already have a cluster and don't wish to rack up charges, you may use your existing cluster for this tutorial.\n* Ensure that the **Preload sample dataset** option is checked.\n   * This will give us some starting data to transfer to Snowflake.\n* Optionally update your provider or region.\n   * MongoDB's pre-selected options should be sufficient for most cases.\n\nOnce everything is configured, select **Create Deployment**.\n\nYou will then move on to a screen with connection options. Here:\n\n1. Select the **Shell** connection option.\n   * We will not use the `mongosh` CLI itself, so you can skip the steps listed on the connection screen.\n2. Find the example CLI command that includes your MongoDB server address.\n   * This should be something like `mongodb+srv://your-cluster-name.abc.mongodb.net/`.\n3. Copy the server address and save it for later.\n   * We'll use this information in the next step, \"Create a Capture in Estuary.\"\n4. You can then close the overlay.\n\n![MongoDB connection string](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-connection-string.png)\n\nIt may take a few minutes to finish loading the sample dataset. After that, your database will be all set up!\nFeel free to browse your MongoDB collections to become familiar with the generated data structure.\n\n### Add a Database User\n\nWhile we're still in the MongoDB dashboard, let's set up a couple more items so that creating a capture with Estuary later will be smooth sailing.\n\nFirst on the list is to create a service account for Estuary access.\n\n1. On the lefthand sidebar, find the **Security** section and select **Database & Network Access**.\n2. Click the **Add new database user** button.\n3. Provide a username and password under **Password Authentication**.\n   * Make sure to save these details for later.\n4. Under **Database User Privileges**, add a role to confer at least Read privileges to your user.\n5. Click **Add user**.\n\n### Configure Network Access\n\nBy default, MongoDB restricts access to your cluster to certain known IPs.\nSo, besides a user for Estuary, we'll also need to allow incoming traffic from Estuary's IP addresses.\n\nFor that, we'll first need to retrieve our IP addresses from Estuary.\nEstuary's architecture uses separate control and data planes to facilitate data isolation.\nThis also means that each data plane has its own set of IP addresses.\n\nWe can look up the relevant IPs from the Estuary dashboard:\n\n1. [Log in to your Estuary account](https://dashboard.estuary.dev/).\n2. Navigate to the [Admin Settings page](https://dashboard.estuary.dev/admin/settings) (select **Admin** from the sidebar and then the **Settings** tab).\n3. Scroll down to the **Data Planes** table.\n   * This table lists all available data planes for your account. The best choice is often the data plane whose cloud provider and region most closely match your Snowflake and MongoDB selections.\n4. Select the data plane you intend to use for your pipeline. This opens a modal with additional details.\n5. Copy the provided IP addresses for that data plane. These addresses are stable.\n\n![Estuary data plane modal](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-data-plane-ips.png)\n\nBack in the MongoDB dashboard, add these IPs to your access list:\n\n1. Find the **IP Access List** page.\n   * This will be under the **Database & Network Access** section, same as **Database Users**.\n2. Click the **Add IP address** button.\n3. Add the desired IP to the **Access List Entry** field.\n4. Optionally add a comment (such as \"estuary\") and **Confirm**.\n5. Repeat for multiple data plane IPs.\n\n![MongoDB Network Access](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/mongo-network.png)\n\nWith all of that configured, we're done with the MongoDB dashboard for now.\nLet's move back to the Estuary dashboard to capture our MongoDB data and start our pipeline.\n\n\u003C!-- ------------------------ --\u003E\n## Create a Capture in Estuary\n\nNow that we actually have data to replicate, we can begin our Estuary pipeline.\n\nEstuary's MongoDB connector uses CDC, or Change Data Capture, to stay up-to-date with your database's data.\nCDC captures a stream of changes as they occur, including insertions, updates, and deletions.\n\nIn MongoDB, CDC is often implemented using [change streams](https://estuary.dev/blog/mongodb-change-data-capture/).\nThis is what Estuary will use, on a preferential basis, to follow along with change events.\n\nCDC on your source in turn allows you to keep downstream systems updated in real time with a complete history of records.\n\nTo set up your MongoDB source connector in Estuary:\n\n1. Begin from the [Estuary dashboard](https://dashboard.estuary.dev/).\n2. On the lefthand sidebar, select **Sources**.\n3. Click the **New Capture** button.\n4. Search for \"MongoDB\" and select **Capture**.\n\nThis will open a configuration screen for the capture.\nHere, make sure to fill out the following required fields in the **Capture Details** and **Endpoint Config** sections:\n\n* **Name:** a unique name for your capture.\n* **Data Plane:** make sure you select the data plane whose IPs you allowlisted in MongoDB.\n* **Address:** the server address you retrieved from MongoDB's connection options screen in the last section.\n* **User:** the username for the MongoDB database user you created in the last section.\n* **Password:** the password for the MongoDB database user you created in the last section.\n\n![MongoDB capture connector setup in Estuary](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-source-setup.png)\n\nFor this demo, the required fields are all we need.\nTo customize your experience further, you can optionally configure other settings.\nSee [Estuary's documentation](https://docs.estuary.dev/reference/Connectors/capture-connectors/MongoDB/) for more on these additional MongoDB capture options.\n\nWhen your configuration is ready, press the blue **Next** button.\n\nEstuary will automatically discover available databases and tables in your cluster.\nYou can select from any, or all, of these schemas to replicate.\nChoose one or more you'd like to transfer to Snowflake and then click **Save and Publish**.\n\nYour selected datasets will start to populate associated Estuary *collections*.\nThis is an intermediate step between sources and destinations that allows you to easily replay or backfill data, or combine multiple sources and destinations in your pipeline.\nYou can also select a collection to preview the data it's received so far from your capture.\n\nWhile this guide won't go into much depth on collections, this would be where you could apply SQL, TypeScript, or Python transformations on your data before storage in your destination.\n\nIn the next step, we'll finally get to work with Snowflake as we finalize our data pipeline.\n\n\u003C!-- ------------------------ --\u003E\n## Create a Snowflake Materialization\n\nIt's time for Snowflake to take center stage.\nConnector setup for our materialization will be similar to our capture: we'll first perform some prep on Snowflake's end before completing the connection in Estuary.\n\n### Set up Snowflake resources\n\nOn the Snowflake side:\n\n1. Open up your Snowflake console.\n2. Create a new SQL worksheet: click the **+** button and select to create a new SQL file.\n3. Copy the following script and paste it into the SQL console. This will set up some resources for your integration, including a service user for Estuary.\n\n  ```SQL\n  set database_name = 'ESTUARY_DB';\n  set warehouse_name = 'ESTUARY_WH';\n  set estuary_role = 'ESTUARY_ROLE';\n  set estuary_user = 'ESTUARY_USER';\n  set estuary_schema = 'ESTUARY_SCHEMA';\n  -- create role and schema for Estuary\n  create role if not exists identifier($estuary_role);\n  grant role identifier($estuary_role) to role SYSADMIN;\n  -- Create snowflake DB\n  create database if not exists identifier($database_name);\n  use database identifier($database_name);\n  create schema if not exists identifier($estuary_schema);\n  -- create a user for Estuary\n  create user if not exists identifier($estuary_user)\n    type = service\n    default_role = $estuary_role\n    default_warehouse = $warehouse_name;\n  grant role identifier($estuary_role) to user identifier($estuary_user);\n  -- Estuary requires case-sensitive quoted identifiers (e.g. \"_meta/op\").\n  alter user identifier($estuary_user) set QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;\n  grant all on schema identifier($estuary_schema) to identifier($estuary_role);\n  -- create a warehouse for Estuary\n  create warehouse if not exists identifier($warehouse_name)\n    warehouse_size = xsmall\n    warehouse_type = standard\n    auto_suspend = 60\n    auto_resume = true\n    initially_suspended = true;\n  -- grant Estuary role access to warehouse\n  grant USAGE\n    on warehouse identifier($warehouse_name)\n    to role identifier($estuary_role);\n  -- grant Estuary access to database\n  grant CREATE SCHEMA, MONITOR, USAGE on database identifier($database_name) to role identifier($estuary_role);\n  -- change role to ACCOUNTADMIN for STORAGE INTEGRATION support to Estuary (only needed for Snowflake on GCP)\n  use role ACCOUNTADMIN;\n  grant CREATE INTEGRATION on account to role identifier($estuary_role);\n  use role sysadmin;\n  COMMIT;\n  ```\n\n4. Select the drop-down arrow next to the **Run** button and choose to **Run All**.\n\nSnowflake will execute the queries, creating a user, schema, database, and warehouse, and granting the proper permissions.\n\nWe'll then need to set up JWT authentication for our service user.\nFor that, we need to generate a public-private [key-pair](https://docs.snowflake.com/en/user-guide/key-pair-auth).\nThe public key will be attached to the Snowflake user while Estuary will hold the private key.\n\nYou can generate your keys in a terminal using `openssl`:\n\n```shell\n# generate a private key\nopenssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt\n# generate a public key\nopenssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub\n# read the public key and copy it to clipboard\ncat rsa_key.pub\n```\n\nPaste your public key into an `ALTER USER` statement in Snowflake and run the command:\n\n```SQL\nALTER USER identifier($estuary_user) SET RSA_PUBLIC_KEY='MIIBIjANBgkqh...';\n```\n\n### Materialization creation\n\nWith all of our Snowflake resources set up, we can then move back to the Estuary dashboard to create the materialization.\n\n1. In the Estuary dashboard, select the **Destinations** page.\n2. Click the **New Materialization** button.\n3. Search for \"Snowflake\" and select **Materialization**.\n4. Add a name and data plane for the materialization and fill out required fields in the **Endpoint Config**.\n   * The majority of these details will be based on the SQL script you executed. The default values would therefore be:\n      * Database: `ESTUARY_DB`\n      * Schema: `ESTUARY_SCHEMA`\n      * Warehouse: `ESTUARY_WH`\n      * Role: `ESTUARY_ROLE`\n      * User: `ESTUARY_USER`\n   * You can find your Snowflake Host URL by retrieving your Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier). Your full URL will look something like `orgname-accountname.snowflakecomputing.com`.\n   * Make sure to provide the private key you generated under **Authentication**.\n   * You will also need to select a **Snowflake Timestamp Type**. Unless you've explicitly set a `TIMESTAMP_TYPE_MAPPING` in Snowflake, you can choose whatever option you'd prefer in Estuary. As a default for this demo, we can go with [`TIMESTAMP_LTZ`](https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/#timestamp-data-type-mapping).\n\n   ![Snowflake materialization connector setup in Estuary](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-destination-setup.png)\n\n5. Under the **Source Collections** section, find **Link Capture** and click **Modify**.\n6. Select your MongoDB capture and click **Continue**.\n7. You will then be prompted to decide what you want your **Destination Layout** to look like. This gives you control over how your schema and tables should appear in Snowflake. Use the Snowflake schema you created: select **Set a default schema** and provide `ESTUARY_SCHEMA` as the name.\n8. Finalize your choice with **Set source capture**.\n\nWith the basic configuration set, there are numerous ways to customize the integration further.\nSee [Estuary's documentation](https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/) for a full list of options.\n\nWhile we're here, though, let's take a look at one of the most popular configuration options: using Snowpipe Streaming.\n\n### Using Snowpipe Streaming\n\nOn the capture side, Estuary is using MongoDB's change streams to enable real-time data movement.\nBut our pipeline isn't going to be real-time unless our destination can ingest that data in real time as well.\n\nSnowflake's answer to this is Snowpipe Streaming, which offers much lower latency than standard warehouse `COPY INTO` commands.\nEstuary can use Snowpipe Streaming to load data into Snowflake; we just need to modify some settings to do so.\n\nFirst up is the **Sync Schedule**.\n\nBack under the **Endpoint Config**, the Sync Schedule section lets you choose how often you want to load data into your destination.\nBy default, Estuary sets this to 30 minutes to follow a standard batch warehouse cadence.\nTo sync data as fast as possible for real-time data flows, set the **Sync Frequency** to 0 seconds (`0s`) instead.\n\nBy itself, this still uses Estuary's default **merge updates**.\nMerge updates reduce documents based on the collection key; with Snowflake, they use `COPY INTO` behind the scenes.\n\nTo change this setting, we'll use **delta updates** instead.\n\nIn delta updates mode, changes stream as append-only updates.\nAnd with the Snowflake connector, this streaming mode uses Snowpipe Streaming on the back end.\n\nReturn to the **Source Collections** section in your materialization.\n\nWe can set delta updates as the default for newly-added collections or select it on a case-by-case basis if we only want specific tables to use it.\nTo use delta updates for all of our MongoDB collections, we can:\n\n1. Toggle on delta updates as a **Default collection setting**.\n2. Remove your linked capture and click **X** in the collections table to remove all associated collections. Delta updates will only be set for _newly added_ collections.\n3. Link your MongoDB capture again to repopulate your collections.\n\n![Materialization collections table in Estuary](https://www.snowflake.com/content/dam/snowflake-site/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary/estuary-collections-table.png)\n\nEach of your collections should show the **Delta Updates** checkbox as checked.\n\nWith that, you're all set to stream your updates to Snowflake in real time using Snowpipe Streaming.\nReview your settings and scroll back to the top of the configuration page to save and publish your materialization.\n\nCheck back in on Snowflake to start exploring your MongoDB data!\nTry making a change in MongoDB and follow its journey; the change should land in Snowflake near-instantaneously.\n\n\u003C!-- ------------------------ --\u003E\n## Conclusion and Resources\n\nCongratulations! You set up a data pipeline to transfer MongoDB data directly to your Snowflake warehouse.\nYou learned a bit about the systems involved, including Estuary, and you got some practice configuring data connectors.\n\nIn this guide, we mainly focused on default configurations, with some notes on enabling real-time data flows.\nThis sped up our process, but it also means we ended up skipping a lot of the possibilities opened up by advanced configuration.\n\nSee the related resources below for options on more advanced use cases and information on configuring your pipeline.\n\n### What You Learned\n- How to move your MongoDB data to Snowflake\n- Enabling real-time data by combining CDC and Snowpipe Streaming\n- How to set up connectors to create your own pipeline in Estuary\n\n### Related Resources\n- [MongoDB docs](https://www.mongodb.com/docs/)\n- [MongoDB Estuary connector reference](https://docs.estuary.dev/reference/Connectors/capture-connectors/mongodb/)\n- [Snowflake docs](https://docs.snowflake.com/)\n- [Snowflake Estuary connector reference](https://docs.estuary.dev/reference/Connectors/materialization-connectors/Snowflake/)\n- [Estuary docs](https://docs.estuary.dev/)\n","multiValue":false,":type":"text/x-markdown"},"quickstartArticleLogoImage":{"dataType":"string","title":"Quickstart Article Logo Image","multiValue":false,":type":"text/plain"}},"elementsOrder":["quickstartArticleBody","quickstartArticleLogoImage"],"isDeveloperGuidesPage":false,"model":"snowflake-site/models/quickstart-article"},"flexible_column_cont":{"id":"flexible-column-container-87d789f014","type":"2-column-75-25","alignColumns":"top","containerMaxWidth":"extra-large","topPadding":"none","bottomPadding":"none","spaceBetween":"none","reverseOnMobile":false,"carouselOnMobile":false,"backgroundImageOption":"none","flexible_column_content_container_1":{"layout":"SIMPLE","id":"container-a92addccd7",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"quickstart_last_modi":{"id":"quickstart-last-modified-20dcc3f4cc","icon":{"id":"icon","icon":"calendar",":type":"snowflake-site/components/icon","appliedCssClassNames":"snowflake-icon-blue"},"lastModifiedDatePrefix":"Updated","lastModifiedDate":"2026-08-05",":type":"snowflake-site/components/quickstart/quickstart-last-modified","appliedCssClassNames":"snowflake-responsive-component-top-padding-small"},"text":{"id":"text-340240d23f","additionalClasses":"qs-disclaimer-text","text":"\u003Cp\u003E\u003Cspan style=\"color: #666;\"\u003EThis content is provided as is, and is not maintained on an ongoing basis. It may be out of date with current Snowflake instances\u003C/span\u003E\u003C/p\u003E\r\n","richText":true,":type":"snowflake-site/components/text","appliedCssClassNames":"snowflake-responsive-component-top-padding-small"}},":itemsOrder":["quickstart_last_modi","text"]},"flexible_column_content_container_2":{"layout":"SIMPLE","id":"container-a8af6bab85",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{},":itemsOrder":[]},":type":"snowflake-site/components/flexible-column-container","isBlogPage":false,"isActiveTOC":false}},":itemsOrder":["contentfragment","flexible_column_cont"]},"flexible_column_content_container_2":{"layout":"SIMPLE","id":"container-ba5c57971f",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"quickstart_table_of_":{"layout":"SIMPLE","id":"container-ce533d205c","isDeveloperGuidesPage":false,":type":"snowflake-site/components/quickstart/quickstart-table-of-content/quickstart-table-of-content-container",":items":{"quickstart_table_of_":{"id":"quickstart-table-of-content-ca995a9213","headings":["\u003Ch2\u003EOverview\u003C/h2\u003E","\u003Ch2\u003EInitial MongoDB Setup\u003C/h2\u003E","\u003Ch2\u003ECreate a Capture in Estuary\u003C/h2\u003E","\u003Ch2\u003ECreate a Snowflake Materialization\u003C/h2\u003E","\u003Ch2\u003EConclusion and Resources\u003C/h2\u003E"],"fragmentPath":"/content/dam/snowflake-site/en/content-fragments/quickstarts/replicate-mongodb-data-to-snowflake-with-estuary",":type":"snowflake-site/components/quickstart/quickstart-table-of-content"},"quickstart_button":{"id":"quickstart-button-adbc4f5456","fragmentPath":"/content/dam/snowflake-site/en/content-fragments/quickstarts/replicate-mongodb-data-to-snowflake-with-estuary",":type":"snowflake-site/components/quickstart/quickstart-button","appliedCssClassNames":"snowflake-responsive-component-top-padding-none"}},":itemsOrder":["quickstart_table_of_","quickstart_button"]}},":itemsOrder":["quickstart_table_of_"]},":type":"snowflake-site/components/flexible-column-container","isBlogPage":false,"isActiveTOC":false},"markup_editor":{"id":"markup-editor-6cca03b002","title":"Page CSS","cssContent":"#quickstart-template-main-flexible-container{padding:24px}#quickstart-template-main-flexible-container \u003E .snowflake-flexible-column-container-items{grid-template-columns:1fr 0}.qs-disclaimer-text p \u003E span{font-size:15px !important}@media (min-width:768px){#quickstart-template-main-flexible-container{padding:24px 32px}#quickstart-template-main-flexible-container \u003E .snowflake-flexible-column-container-items{grid-template-columns:7fr 3fr;gap:48px}}@media (max-width:767px){#quickstart-template-main-flexible-container \u003E .snowflake-flexible-column-container-items{gap:0}}@media (min-width:1024px){#quickstart-template-main-flexible-container{padding:0 92px 48px 92px}#quickstart-template-main-flexible-container \u003E .snowflake-flexible-column-container-items{gap:117px}}",":type":"snowflake-site/components/markup-editor","isGSAPEnabled":false}},":itemsOrder":["quickstart_hero","flexible_column_cont","markup_editor"],":type":"wcm/foundation/components/responsivegrid"},"modal_container":{"layout":"SIMPLE","id":"container-b946069350",":type":"snowflake-site/components/modal/modal-container",":items":{},":itemsOrder":[]},"experiencefragment-footer":{"id":"experiencefragment-34e8d5e1e8","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/footer/master/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/footer/master.xfmodel.json"},"markup_editor":{"id":"markup-editor-dd5aa6b675","title":"Quickstarts Overrides","cssContent":".snowflake-markdown blockquote{padding:24px 32px;background:#f6f9fa;border:1px solid #29b5e8;border-radius:16px}.snowflake-markdown .snowflake-image-container img{width:auto !important;max-width:100%}.snowflake-markdown .snowflake-text ol{padding-left:20px !important}.snowflake-markdown .snowflake-text li{margin:0 0 12px 0 !important}.snowflake-markdown h3.snowflake-markdown-h3{font-size:20px !important;font-family:Texta,sans-serif !important}@media (min-width:768px){.snowflake-markdown h3.snowflake-markdown-h3{font-size:28px !important}}",":type":"snowflake-site/components/markup-editor","isGSAPEnabled":false}},":itemsOrder":["experiencefragment-banner","experiencefragment-header","markup_editor_1950346551","responsivegrid","modal_container","experiencefragment-footer","markup_editor"],":type":"wcm/foundation/components/responsivegrid"}},":itemsOrder":["root"],":hierarchyType":"page",":path":"/content/snowflake-site/global/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary","isPasswordProtected":false,"analyticsContentTags":["snowflake-site:taxonomy/solution-center/certification/quickstart"],"analyticsEnabled":true,"coveoConfig":{"searchHub":"snowflake.com","organizationId":"snowflakecomputingproduction8neljofn","apiKey":"xx335921a6-2a0a-40f2-a167-e390b4766c3d","pipeline":"snowflake.com"},"analyticsDebugMode":false,"analyticsData":{"excludeFromAnalytics":false,"subCategory":"","pageType":"homepage","templateName":"quickstart-page-template","siteName":"snowflake","pageUrl":"/content/snowflake-site/global/en/developers/guides/replicate-mongodb-data-to-snowflake-with-estuary","language":"en","category":"general","pageName":"Replicate MongoDB Data to Snowflake with Estuary","contentTags":["snowflake-site:taxonomy/solution-center/certification/quickstart"]},"locale":"en"}
  