Steps to build this project:
-
The project already contains a customized version of Northwind database. Inside the folder
/src/dbyou can find folders/localdbXwhich represents remote local data warehouses. The tables within localdbX represents region-wise local data. -
This project uses
makefor build automation. Please make sure you havemakeinstalled already in your system.For Windows: install chocolatey and then run
choco install makeFor 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=500xin each of them. Replacexwith0 ... 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.ProductNameselect OrderID,sum(UnitPrice*Quantity*(1-Discount)) as Subtotal from order_details group by OrderIDselect productID,productName,categoryID from products
-
Observations: Navigate to
/src/tmpand 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.csvformat.The folder
/src/out/finalqcontains 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 initfirst 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...