Start by example

This section will guide you how to try PartitionDB out by using examples. The purpose is to let you have an up and running database ready to work with, in no time.

Each example creates a slightly different configuration using a script you can copy, paste and run on your machine. Each example is followed by a reference script that is showing how to use the database configuration that was created.

Once you see how simple the process is, you will continue by choosing whether to start from scratch or start migrating your database.

Create a Gate and children DBs

This script will result in the creation of a gate (TwoWestGate) with 3 children DBs to represent a bank’s branches. Just copy and run it.

After running the script, a gate will be created under the name TwoWestGate and 3 children DBs SunsetDB, VeniceDB, WilshireDB.

The below script is querying the new databases that you just created. These are some operations for your reference (obviously, you will write the queries that are of your interest):

Create a Gate, children DBs and GlobalDB

Now lets say we need a global database for some branches that don’t require a dedicated machine for themselves, The following script will generate the exact same platform that was created until this point, with the addition of a globalDB

The script below gives examples for manipulations that can be done on the configuration that contains also a GlobalDB:

Create a Gate, children DBs, GlobalDB and CommonDB

In the following configuraion we need a database that contains a common table so that other partitions could Access it, cut down on duplicate sets of data and make maintenance super easy.
Again, it’s the same script as before with just an added CommonDB

As before, here is a script that uses the configuration that we created:

Create a Gate, children DBs, GlobalDB, CommonDB and StandAloneDB

Now let’s say we need a private database to serve as a log DB, or as a sensitive data storage

Here is the same script as before with an added StandAloneDB:

The database now with the StandAloneDB looks like that:

And here is a script that uses the configuration that we created:

What’s next

Now that you understand how to create the different types of database, it’s time to create your own database, or migrate your existing database to PartitionDB.