|
C O U R S E L E C T U R E MongoDB Introduction Notes taken on June 4, 2014 by Edward Tanguay |
doesn't store in tables
stores in JSON documents
MongoDB is a JSON document store
MongoDB data looks a lot more like the data you have in your programs than relational data does
two documents don't need to have the same schema as two SQL rows do
where does MongoDB fit in the world?
scalability and performance
scalable and has good performance, but offers little functionality
not known for being particularly scalable: easy to scale up but not easy to scale out (use commodity hardware)
MongoDB strikes the balance between these two
what is missing from MongoDB which classic RDBMS have?
each document is stored in a collection
the reason is: joins is one of the items which scales particularly poorly when you try to scale out
sounds bad, but you often don't need them in applications which use MongoDB
because documents are hierarchicals, you get some of this functionality
and it also is the case in real-world RDBMS scenarios that you do not have transactions between separate databases anyway
what is included in MongoDB which RDBMS have?
although these are challenging to get them to perform well on a system which is horizontally scalable
browser --> layout engine --> JavaScript engine
Firefox --> Gecko --> SpiderMonkey
Safari --> WebKit --> Nitro
Chrome --> WebKit --> V8
2013: Chrome --> Blink --> V8
Opera --> Presto --> Carakan
2013: Opera --> Blink --> V8
Internet Explorer --> Trident --> Chakra
Google Chrome (2013: discontinued using it)
Opera (2013: phased it out)
April 2013: Google forked from WebKit
even before the split, Chrome never used WebKit in same way as Safari, e.g. Chrome ignored WebKit's JavaScriptCore and used V8 instead
July 2013: Opera switched to Blink
1995: Brendan Eich, Netscape
SpiderMonkey name has remained the same but modern engine is unrecognizable from 1995 engine
JIT compilers for SpiderMonkey
translates SpiderMonkey bytecode into a control flow graph
default engine in Firefox since version 18
developed entirely in Java
separate from the SpiderMonkey
Google Chrome's V8 engine
converts JavaScript into classes
works in compiled and interpreted mode
intended for server-side applications
no built-in support for web browser objects
Apple forked KJS (Konqueror) to create JavaScriptCore for WebKit (layout engine)
2008 WebKit gets SquirrelFish
SquirrelFish Extreme, Nitro, Nitro Extreme, compiles JavaScript directly to machine code (like V8)
JavaScriptCore source code resides in the WebKit source tree
2008 with Chrome 2, in response to Nitro
compiles JavaScript to native machine code
intended to be used both in a browsers, e.g. Chrome and Chromium (open source web browser project from which Google Chrome draws its source code, the browsers share the majority of code and features)
goal for Chrome is to be a "a tabbed window manager, or shell for the web, as opposed to it being a traditional browser application"
as of Internet Explorer 9
uses GPU for 3D graphics and video
MongoDB from 10,000 feet
any client sending requests, e.g. consuming REST API
C++ program that you control using V8 JavaScript
all code for it are written in JavaScript
server responds to requests from clients
this application needs to store persistent data, that is where MongoDB comes in
application server acts as client and communicates with MongoDB server which is listening for requests
has similarities with node.js
C++ application that you control with V8
makes requests to MongoDB
debugging your application
handles all the connections, fail over
provides API which handles the communication to MongoDB