Steps to build this project:
-
The project already contains a customized version of Northwind database. Inside the folder
/src/db
you can find folders/localdbX
which represents remote local data warehouses. The tables within localdbX represents region-wise local data. -
This project uses
make
for build automation. Please make sure you havemake
installed already in your system.For Windows: install chocolatey and then run
choco install make
For Ubuntu 18.04 and above: Run
sudo apt install make
-
Download or clone this repository. Download
-
Extract and nagivate to
/tpsql
. -
To prepare the environment run
make prepare
. This will install all the dependencies to run this project. -
To run the servers: As there are 6 regional databases we wish to run 6 multiple servers. Open up 6 terminals and run
make run-dw PORT=500x
in each of them. Replacex
with0 ... 5
. Here we are runnning 6 servers on ports5000 5001 5002 5003 5004 5005
. -
To run the aggregator: Open up another terminal window and run
make run-agg
. -
Now run the client using
make run-client
. -
Now we can execute some queries in the client.
-
Some sample queries include:
select a.CategoryName from Categories a inner join Products b on a.CategoryID = b.CategoryID where b.Discontinued='N' order by b.ProductName
select OrderID,sum(UnitPrice*Quantity*(1-Discount)) as Subtotal from order_details group by OrderID
select productID,productName,categoryID from products
-
Observations: Navigate to
/src/tmp
and we can find the partial output of all the taskmanagers. The number of task managers that ran until completion will provide us partial outputs in.csv
format.The folder
/src/out/finalq
contains some files. The csv file which is contained in the folder has the final output of the query. -
If you wish to clean all the temporary files run
make clean
. -
After cleaning the project if you wish to run again the run
make init
first to initialize the repo and then follow Steps 1 ... 9.
Known Issues:
Don't put spaces between commas and column names in select clause. Write select column1,column2,column3...