Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Intro to MongoDB (Updated)
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
20spokes
October 24, 2012
Technology
97
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to MongoDB (Updated)
20spokes
October 24, 2012
More Decks by 20spokes
See All by 20spokes
Start Your Startup: The Essential Steps to Launch Your Idea
ryan_fischer
1
95
Intro to MongoDB
ryan_fischer
2
280
MongoDB and Ruby on Rails
ryan_fischer
2
200
Geospatial Indexing with MongoDB
ryan_fischer
3
120
Other Decks in Technology
See All in Technology
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
170
Claude Code本って、 読む必要あるの?
oikon48
2
420
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
200
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
580
安心して変更できるWebフロントエンドの作り方
pirosikick
4
1.7k
AIネイティブプロダクトで顧客価値を最大化するプロダクトエンジニアとFDEの協働
righttouch
PRO
0
240
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
120
AIオーケストレーションを活用した 開発ワークフローの設計と実践
bqnq
0
150
Screen Lens - 今見てる画面を翻訳する
komagata
0
260
Podは生きているのにGoだけが落ちる:GOGCとGOMEMLIMITで追うInvisible OOM Killの謎
tkc66buzz
1
620
Reactの設計論
uhyo
15
8.5k
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
110
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Mobile First: as difficult as doing things right
swwweet
225
10k
Odyssey Design
rkendrick25
PRO
2
800
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
Code Review Best Practice
trishagee
74
20k
The untapped power of vector embeddings
frankvandijk
2
1.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Faster Mobile Websites
deanohume
310
32k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.8k
Designing for Performance
lara
611
70k
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