Skip to main content

Posts

Showing posts with the label mongoDB

NoSQL v SQL Part 1 - resource usage comparison

To skip my ranting, go to the actual topic, click here . Or you would like to jump to the summary directly. Recently I kept getting advertisement on migrating your SQL database to NoSQL. It's been 5 years since I last deal with database related work, excluding the CRUD on database task. NoSQL was quite new to me then, our platform main database backbone was Oracle DB. I am still not sure how or why we were convinced to have a new subsystem to use MongoDB, but that's the strength of developers, creating a good looking resume profile, and new task opportunities in the company. (I don't say new job opportunities, as we don't hire new DBA to support NoSQL. I forgot, and could be I was not informed, if the DBAs were sent for training to support this. :D) Based on my past experience and study, NoSQL was for a totally different use case. It is for non-structured database, simple design, and ...?? I just did a quick check on my profile, the my M101P: MongoDB for develope...

Basic MongoDB

This post is about setting up MongoDB in Linux. I am using CentOS 7. 1. Adding the mongoDB repository > vi /etc/yum.repos.d/mongodb.repo [MongoDB] name=MongoDB Repository baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc 2. Install MongoDB > yum install mongodb-org 3. Starting MongoDB service > systemctl start mongod.service 4. Use the MongoDB > mongo Voila, you can start to use MongoDB right away. For my project, I am preparing a YouTube database, based on a dataset that I got from YouTube 2 data set . At the mongo shell, I am creating a database called "yt_data" with a DB user that is granted with readwrite access only to this database. > use yt_data > db.createUser( { user: "db_user", pwd: "db_pass", roles: [{ role: "readWrite", db: "yt_data"}] }); Successfully added user: { ...