Tuesday, October 20, 2015

DB Designs for Music School Online (relational and nosql)

So, I considered two different DB designs for my application.  One is a relational database schema, and the other is a non-relational (noSql) database schema.  Relational databases are like (Oracle, and mySQL), and noSQL is like (MongoDB).

Here is my relational database design ER Diagram.  The arrows point from FK (foreign key) dependencies.  As you can see its a pretty simple database.  Everything is centered around User.


Now I also made a ER Diagram for my noSQL database.  The brackets indicates which attributes hold documents. In cases where the documents will be other documents - that document's structure is outlined.


As you can see there is a vast difference between these two database styles.  The first design , the relational database has multiple tables that are connected by foreign keys.  In the second design we have a schema-less design.  

Personally I prefer the schema-less design because, I think it is easier to maintain.  Also Music School Online is a study on development on the MEAN stack, MEAN means you are using a MongoDB, ExpressJS, AngularJS, NodeJS full-stack framework.  For more info see wikipedia.

But instead of using MongoDB, I am actually going to use AWS's version of MongoDB which is called DynmoDB. The reason being I really like AWS (Amazon Web Services).  They are the best cloud based web services out there.  Plus I can host a small noSQL database there for free or for something like $0.30 a month...yes that is right, 30 cents a month.

Here's a video about Dynamo DB.

October 21, 2015
I ran into some problems with the DynamoDb approach. The only way I could find to use it with my AngularJS application would be to use Amazon's Identity Access Management (IAM) services which requires the user to sign-in using Facebook, Google, or another 3rd party authentication provider. I do not want to require users to login using a third-party authentication so I am going to use the traditional MEAN stack way instead. This involves using MongoDB with Mongoose. More info on this to come.

October 23, 2015
Actually, I couldn't figure out how to get mongodb installed locally on Ubuntu 15 (which is what OS I'm using on my dev machine).  So I signed up for a free managed hosting service at https://mongolab.com. It turns out they are running a mongo db in AWS...(I didn't know you could do that!)

No comments:

Post a Comment