๐
Prepared Course Material for Survey of Database Systems, on a quick runthrough of Big Data concepts using MongoDB (a NoSQL database) and Hive (an OLAP SQL access tool)
First, make sure to have Docker installed (based on your operating system). Install is through here! After you have Docker installed, make sure it's running fine by issuing the commands docker -v
and docker-compose -v
Docker will then handle spinning up services and filling up databases with data for us!
After, cd
into the folder where this project is under. Simply run docker-compose up
and it will spin up the containers for you automagically!
You can graphically access the contents of the MongoDB database on <localhost|dockerport>:8081
-
To access Hive and execute SQL commands, run:
-
docker exec -i -t hive bash
, which allows us to access the Hive Docker container's shell -
hive -f /hive_init/init.sql
, which runs the initialization SQL script (which creates the databases, tables and loads the CSV data of our databases). For fun, check out thehive/hive_init.sql
file in this repository for more information -
hive
, which then opens up the Hive CLI from within the Hive Docker container -
Run whatever SQL you want to execute and see the outputs!
-
-
To access MongoDB and execute MongoDB queries:
-
docker exec -i -t mongo bash
, which allows us to access the MongoDB Docker container's shell -
chmod +x /mongo_init/stripCRonefile.sh && ./mongo_init/stripCRonefile.sh
, which runs the shell script that fixes the Windows problem of file endings for us. On the prompt, provide the filename/mongo_init/init.sh
-
chmod +x /mongo_init/init.sh && ./mongo_init/init.sh
, which runs the initialization shell script (creates the MongoDB databases, collections and loads the JSON data of our databases). For fun, check out themongo/init.sh
file in this repository for more information -
Go to your browser, navigate to
<localhost|dockerport>:8081
-
See your data and execute queries as you please
-