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
20spokes
October 24, 2012
Technology
100
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
96
Intro to MongoDB
ryan_fischer
2
280
MongoDB and Ruby on Rails
ryan_fischer
2
210
Geospatial Indexing with MongoDB
ryan_fischer
3
120
Other Decks in Technology
See All in Technology
Local CI × GitHub Actions
gogutan
2
220
Getting Started with Google Antigravity
glaforge
0
310
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
180
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
480
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
440
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
280
遠藤な_めぐろLT #38 「社内のAI活用推進」@麻布台_20261009
endonanana
0
140
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
Optunaの最新リリースv5.0について
pfn
PRO
0
120
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
730
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
200
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
GitHub's CSS Performance
jonrohan
1033
470k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
How to build a perfect <img>
jonoalderson
1
6.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
Statistics for Hackers
jakevdp
799
230k
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