For the last 3 decades relational databases have ruled the development landscape. Whenever a developer needed to store significant amounts of data they turned to their trusty RDBMS. However, like everything in the development world, the reign of the RDBMS is being threatened by a new set of database leaders shouting the NoSQL mantra. MongoDB is one of the leaders on the frontline of the NoSQL revolution, and it is quickly gaining a large following and challenging relational databases for control of the cloud.
This presentation was given at ThatConference.com 2014
7. Agenda
• NoSQL Overview
• Getting Started
• Reliability and Scalability
• MongoDB for .Net Devs
DNN / Proprietary and Confidential. All Rights Reserved.7
8. Why NoSQL?
DNN / Proprietary and Confidential. All Rights Reserved.8
9. NoSQL != No SQL
DNN / Proprietary and Confidential. All Rights Reserved.9
Relational DB Document DB
11. DNN / Proprietary and Confidential. All Rights Reserved.11
Key-Value
Document
Graph
Wide Column
NoSQL Neighborhoods
12. 12 DNN / Proprietary and Confidential. All Rights Reserved.
D E M O
Getting Started
13. Reliable and Scalable
ReplicaSets
• Master-Slave
• Auto-failover
• Write to primary
• Read primary
or secondary
Sharding
• Distribute
reads/writes
• Shard key is
critical
• Each shard can
be a replica set
DNN / Proprietary and Confidential. All Rights Reserved.13
14. Replica Sets
DNN / Proprietary and Confidential. All Rights Reserved.14
Primary
Secondary Secondary
15. Replica Sets
DNN / Proprietary and Confidential. All Rights Reserved.15
Primary
Secondary Primary
16. Replica Sets
DNN / Proprietary and Confidential. All Rights Reserved.16
Secondary
Secondary Primary
17. 17 DNN / Proprietary and Confidential. All Rights Reserved.
D E M O
Replica Sets
18. Sharding
DNN / Proprietary and Confidential. All Rights Reserved.18
MongoS
MongoD
(ReplicaSet)
MongoD
(ReplicaSet)
MongoD
(ReplicaSet)
19. Sharding
DNN / Proprietary and Confidential. All Rights Reserved.19
MongoS
MongoD
(ReplicaSet)
MongoD
(ReplicaSet)
MongoD
(ReplicaSet)
MongoD
(Config Cluster)
20. MongoDB for .Net Devs
• Idiomatic Drivers
› C, C++, C#, Go, Java, Node.js, Perl, PHP, Python, Ruby, Scala
• C#
› Your classes or BSON Documents
› Custom CRUD API (prior 1.8) or use LINQ (1.8+)
› BSON Documents for Aggregation framework
DNN / Proprietary and Confidential. All Rights Reserved.20
21. 21 DNN / Proprietary and Confidential. All Rights Reserved.
D E M O
MongoDB for .Net
RDBMS designed to run on single machine – naturally leads to scale up
Cloud is designed to run applications on multiple commodity machines
NoSQL originated with Google and Amazon from the need to be able operate in the cloud
RDBMSs focus on normalized tables and relationships
NoSQL dbs focus on performance, so denormalize data and minimize relationships
Schemaless – Misnomer - Schema not enforced by db. Schema must be managed by application
Eventually Consistent – Initial write is fast. Updating indexes and replicating data takes time.
Cloud friendly – The Cloud is optimized for scale-out. So are NoSQL dbs. Replication and sharding designed to take advantage of scale out.
Key-value – Single index, one or more values. Often optimized for use as distributed cache.
Column Store – Data is stored on disk by column rather than by row. Allows for large number of columns in a record. Queries often pull small subset of columns.
Document store – Data stored as single document or object. Most