Edit

Share via


Tutorial: Configure Microsoft Fabric open mirrored databases

In this tutorial, you configure an Open mirrored database in Fabric. This example guides you to create a new open mirrored database and learn how to land data into the landing zone. You'll get proficient with the concepts of open mirroring in Microsoft Fabric.

Important

This feature is in preview.

Prerequisites

  • You need an existing capacity for Fabric. If you don't, start a Fabric trial.
    • The Fabric capacity needs to be active and running. A paused or deleted capacity will affect Mirroring and no data will be replicated.
  • During the current preview, the ability to create an open mirrored database via the Fabric portal is not available in all Fabric capacity regions.

Create a mirrored database

In this section, we provide a brief overview of how to create a new open mirrored database in the Fabric portal. Alternatively, you could use the Create mirrored database REST API together with the JSON definition example of open mirroring for creation.

  1. Use an existing workspace or create a new workspace. From your workspace, navigate to the Create hub. Select Create.
  2. Locate and select the Mirrored Database card.
  3. Enter a name for the new mirrored database.
  4. Select Create.
  5. Once an Open mirrored database is created via the user interface, the mirroring process is ready. Review the Home page for the new mirrored database item. Locate the Landing zone URL is in the details section of the mirrored database home page.

Screenshot from the Fabric portal showing the Landing zone URL ___location in the Home page of the mirrored database item.

Start replicating data

Once you've created a mirrored database, start uploading your CSV or parquet files. You can upload your initial data and future changed data sets using the Fabric portal or programmatically via the OneLake.

Upload via the Fabric portal

To upload initial data and/or incremental changed data for open mirroring:

  1. Select the Upload files on the home page of the mirrored database.

    Screenshot from the Fabric portal of the Upload Files options on the home screen of an open mirrored database.

  2. On the Upload files page, upload a Parquet or CSV file using the upload dialog in the Fabric portal.

    Important

    The file name of the Parquet or CSV file needs to match the format and filename documented. For more information, see Open mirroring landing zone requirements and format.

  3. On the Preview data page, you can see a preview of the data you are about to upload. Provide the Table name a name and specify Primary key column(s). Select Create table.

  4. Once uploaded, your data immediately starts to replicate into OneLake. After a few minutes, in the Explorer, you can view the files that have been replicated in OneLake by selecting a file from Uploaded files or a table in Tables in OneLake.

  5. From the Replication status in the Explorer, you can see how many rows have been replicated and any errors associated with the data you are mirroring into OneLake.

  6. If you have changed data in a Parquet or CSV format for existing tables in your mirrored database, you can upload or drag and drop these change files. The changes are automatically reflected in OneLake.

Write change data into the landing zone using other mechanisms

Your application can now write initial load and incremental change data into the landing zone URL, which is your specific open mirroring path to the OneLake.

Start mirroring process

  1. The Configure mirroring screen allows you to mirror all data in the database, by default.
    • Mirror all data means that any new tables created after Mirroring is started will be mirrored.
    • Optionally, choose only certain objects to mirror. Disable the Mirror all data option, then select individual tables from your database. For this tutorial, we select the Mirror all data option.
  2. Select Mirror database. Mirroring begins.
  3. Wait for 2-5 minutes. Then, select Monitor replication to see the status.
  4. After a few minutes, the status should change to Running, which means the tables are being synchronized. If you don't see the tables and the corresponding replication status, wait a few seconds and then refresh the panel.
  5. When they have finished the initial copying of the tables, a date appears in the Last refresh column.
  6. Now that your data is up and running, there are various analytics scenarios available across all of Fabric.

Monitor Fabric Mirroring

Once mirroring is configured, you're directed to the Mirroring Status page. Here, you can monitor the current state of replication.

For more information and details on the replication states, see Monitor Fabric mirrored database replication.