Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intro to MongoDB (Updated)
Search
20spokes
October 24, 2012
Technology
2
78
Intro to MongoDB (Updated)
20spokes
October 24, 2012
Tweet
Share
More Decks by 20spokes
See All by 20spokes
Start Your Startup: The Essential Steps to Launch Your Idea
ryan_fischer
1
80
Intro to MongoDB
ryan_fischer
2
240
MongoDB and Ruby on Rails
ryan_fischer
2
170
Geospatial Indexing with MongoDB
ryan_fischer
3
110
Other Decks in Technology
See All in Technology
【LT会登壇資料】TROCCO新コネクタ「スマレジ」を活用した直営店データの分析
kazari0425
1
170
VGGT: Visual Geometry Grounded Transformer
peisuke
1
620
Getting to Know Your Legacy (System) with AI-Driven Software Archeology (WeAreDevelopers World Congress 2025)
feststelltaste
1
180
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
55
22k
セキュアな社内Dify運用と外部連携の両立 ~AIによるAPIリスク評価~
zozotech
PRO
0
100
ソフトウェアテストのAI活用_ver1.25
fumisuke
1
560
American airlines ®️ USA Contact Numbers: Complete 2025 Support Guide
airhelpsupport
0
390
Sansanのデータプロダクトマネジメントのアプローチ
sansantech
PRO
0
230
衛星運用をソフトウェアエンジニアに依頼したときにできあがるもの
sankichi92
1
230
microCMSではじめるAIライティング
himaratsu
0
120
Delegating the chores of authenticating users to Keycloak
ahus1
0
180
CDK Toolkit Libraryにおけるテストの考え方
smt7174
1
450
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
The World Runs on Bad Software
bkeepers
PRO
69
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
For a Future-Friendly Web
brad_frost
179
9.8k
Site-Speed That Sticks
csswizardry
10
700
A Tale of Four Properties
chriscoyier
160
23k
Transcript
MongoDB 101 Ryan Fischer @ryanfischer20
What you will hear What is NoSQL Available NoSQL Databases
Intro to MongoDB
What is NoSQL
Fancy Answer NoSQL is a class of database management system
identified by its non-adherence to the widely-use relational database management system
My Answer It’s not SQL
Does not use SQL as its query language May not
give full ACID guarantees Distributed architecture Typically optimized for reading and writing operations
Advantages
Traditional Scaling Bigger is better! (or so they thought) Increase
the size and power of the server
Scaling with NoSql Scale horizontally! Distribute across multiple servers More
economical using lower-cost servers
What is Sharding Allows MongoDB to scale horizontally Evenly distributes
chunks of data Performed per collection
None
Goodbye Schemas Flexible data models Easy to add/change data structures
Disadvantages
Goodbye Schemas Flexible data structures Application dependent on integrity
NoSQl is Still Young Does not reduce administration (at least
not yet) Lack of expertise Lack of projects expanding on NoSQL
NoSQL Databases Cassandra MongoDB CouchDB Redis Riak Neo4j
How is it used?
NoSQL out in the Wild Analytics - takes advantage of
read/write optimizations Logging Large Scale Projects
MongoDB
What is MongoDB Document Oriented Storage Replication & Auto-Sharding Document-based
queries similar to SQL Atomic Updates Map/Reduce
Document Oriented No schemas!! No joins for high performance and
scalability embed documents JSON-Style storage
High Performance Stores a lot of data in memory Embedding
documents increase read and writes Allows indexing
Availability and Scalability Replicated servers with automatic master failover Auto-sharing
across servers Consistent reads distributed over replicated servers
Atomic Modifers In place updating documents Does not replace entire
document Ideally suited for write heavy applications
Storing data Data is grouped by collections Collection contains documents
of key-value pairs Values can be rich including arrays and documents Stored as BSON - Binary Serialized Document Notation
Querying Javascript console allows for functions Returns a cursor -
lazy load of results Queries expressed as JSON Documents auto-assigned ObjectId
Advantages Active community including 10Gen Driver support for most languages
Many new features to come
Disadvantages No inherit transaction support Scaling sometimes isn’t simple Multiple
servers recommended Object modeling can be complex
The big data loss debate Internet flame war history Mongo
performs one write at a time - global lock Stored in memory Replication - fail over
Examples Interactive time! Goto to https://gist.github.com/2719591 for examples
Embed vs Referenced Relationships for models Object Models - Think
differently When in doubt store in different collection
Mongo Object Mappers for Ruby MongoMapper Mongoid Mongo ODM MongoModel
Mongoid Advantages Excellent Documentation Active Community Compatibility with other projects
Similar API to ActiveRecord Uses ActiveValidation Version library
Compatible Gems Devise - Authentication solutions for Rails Carrierwave -
Simple and flexible way to upload files from Ruby. Supports GridFS Geocoder - Complete geocoding solution for Rails Mongoid-Rspec - RSpec matchers and macros for Mongoid
Mongoid Document class Team include Mongoid::Document include Mongoid::Timestamps field :name,
type: String field :city, type: String field :location, :type => Array validates :name, :city, :presence => true end
The End Follow me - @ryanfischer20
None