Monday, January 9, 2017

Convert from SQL to NoSQL in 60 Seconds

Today, we are launching the 1Schema Database Converter, which you can use to easily convert your existing SQL schema and data to a NoSQL database technology of your choosing.

We built this converter to ease the transition when switching between database technologies.

We want to help you find the technology that works best for your particular application!


What you need to get started:

Before you begin, you will need to export the SQL code for your existing database as a plain text (not binary).

This file must contain all the CREATE TABLE and ALTER TABLE statements necessary to create your Tables, Primary Keys, Unique Constraints, and Foreign Keys.

Also, the file may include data, so long as all data is encoded as INSERT statements and the total size of your file remains under 5 MB. Your data will be transformed and included in your converted database script.

If you need to convert more data than 5 MB will allow, please contact us for help.

If you want to use the same database that we use for this tutorial, download our SQL file:
    SQL Server Demo DB
    PostgreSQL Demo DB


What to think about next:

So you have your SQL schema file... you can now proceed to the 1Schema Converter and convert your file.

However, before doing so, it is worth thinking about how you want to configure the 1Schema Converter so that you get the desired result.

So for each SQL Table, consider how you want the Foreign Keys to be mapped during conversion:

  1. Does the FKEY indicate the "Parent Table", inside which the Current Table should be embedded (aka nested)?
  2. For all other FKEYs, should the list of related IDs from the Current Table be stored in the Parent Table?
  3. EXPERIMENTAL: Should IDs be traversed and cached within the database?
The answer to these questions will directly determine the settings that you should select in the 1Schema Converter.

If these questions are not immediately clear, do not worry, as the default conversion settings will provide you with a solid starting point.


How to use the 1Schema Converter:

You are now ready to use the 1Schema Converter to convert your SQL database:

1) Go to "http://www.1schema.com/DatabaseConverter" and you should see the following page:

  • Select the "SQL Database Type" that corresponds to the source of your input file (for our demo, we will use "Microsoft SQL Server ®")
  • Select the "NoSQL Database Type" that corresponds to the type of output you want (currently, only "MongoDB ®" is implemented)
  • Select the "Schema Conversion Mode" depending on whether you want to use the experimental code to store cached data in the database
  • Select the SQL file that contains your original schema

2) Wait until the grid below populates
3) Use the grid to select your desired settings
4) Scroll to the bottom of the page and click the "Convert Database" button.

5) Download your converted file.

NOTE: Your browser may warn you about downloading JavaScript files. Please download your converted file anyways.

5) Load your converted file into your NoSQL database.

No comments:

Post a Comment