-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmongo_sql.html
More file actions
125 lines (117 loc) · 7.05 KB
/
mongo_sql.html
File metadata and controls
125 lines (117 loc) · 7.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Make Anything | Will Lynch - Projects</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="background">
<div class="row">
<div class="col-sm-12">
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Make Anything</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li><a href="projects.html">Projects</a></li>
<li><a href="contact.html">Contact</a></li>
<li class="active"><a href="blog_feed.html">Blog</a></li>
</ul>
<!--social nav links -->
<ul class="nav navbar-nav navbar-right" id="social">
<li><a href="http://twitter.com/wlynch16" class="twit">Twitter</a></li>
<li><a href="http://facebook.com/wlynch91" class="fbook">Facebook</a></li>
<li><a href="http://github.com/lynch16" class="ghub">Github</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div>
</div> <!--navbar row-->
<div class="container">
<div class="row shadow" id="blog">
<div class="col-sm-9">
<h3>Thoughts on MongoDB vs SQL </h3>
<p>When first tasked with building a Ruby on Rails application using MongoDB, I was a little nervous since Flatiron only covered SQL. If you’re not familiar with the difference, SQL (Structured Query Language) databases consist of essentially a table wherein each row is a different object and each column an attribute. This requires having to manage expanding the table for each new attribute via migrations. Additionally, each object will have a column for every attribute, even if that attribute is nil. </p>
<p>MongoDB on the other hand uses documents to create and save objects. Each object is it’s own document, and each attribute of that object is a line within the document. Objects can be referenced or embedded in other objects to achieve belongs to and has many relationships. Unlike SQL, these objects only have attributes that they have been assigned, which saves memory on large datasets.</p>
<p>After using MongoDB, I prefer it well above SQL. It is so much easier to make changes to large datasets and create has_many_and_belongs_to relationships. No more need to create join tables just to create relationships. Also, the CLI comes with built in functions to backup and restore from backup which are easy to incorporate into Ruby on Rails via cron jobs. I’m glad to see that more companies are heading away from SQL databases.</p>
</div>
<div class="col-sm-3">
<h4>Archives</h4>
<ul>
<li><a href="why_code.html">Why I'm learning to code</a></li>
<li><a href="climate_api_blog.html">Building my first ruby gem</a></li>
<li><a href="sinatra_assessment.html">Building a web app through Sinatra</a></li>
<li><a href="rails_assessment.html">Building a web app on Rails</a></li>
<li><a href="jquery_assess.html">Expanding Rails with JQuery</a></li>
</ul>
</div>
</div> <!--main blog content row-->
</div> <!--master container-->
</div><!--background-->
<div class="light-grey">
<div class="container">
<div class="row" id="details">
<div class="col-sm-4 border">
<h3>Contact</h3>
<p>
email: <a href="mailto:will.lynch91@gmail.com">will.lynch91@gmail.com</a>
</p>
</div>
<div class="col-sm-4 block_links border">
<h3>Links</h3>
<p>
<a href="contact.html">Contact</a>
<a href="projects.html">Projects</a>
</p>
</div>
<div class="col-sm-4 block_links">
<h3>Follow</h3>
<p>
<div id="hide">
<a href="http://twitter.com/wlynch16">Twitter</a>
<a href="http://facebook.com/wlynch91">Facebook</a>
<a href="http://github.com/lynch16">Github</a>
</div>
<div id="social">
<a href="http://twitter.com/wlynch16" class="twit">Twitter</a>
<a href="http://facebook.com/wlynch91" class="fbook">Facebook</a>
<a href="http://github.com/lynch16" class="ghub">Github</a>
</div>
</p>
</div>
</div><!--details row-->
</div> <!--container-->
</div> <!--light-grey-->
<footer>
© 2016 William Lynch
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>