MongoDb and Windows Azure

18

Transcript of MongoDb and Windows Azure

Page 1: MongoDb and Windows Azure
Page 2: MongoDb and Windows Azure

Grazie aGrazie aSponsor

Page 3: MongoDb and Windows Azure

About me{

"firstName": "Alessandro", "lastName": "Melchiori",

"role": "software architect @ codiceplastico", "contacts": [ {

"type": "email", "value": "[email protected]"},{ "type": "twitter", "value": "@amelchiori"

},{ "type": "blog", "value": "http://blog.codiceplastico.com/melkio"}

]}

Page 4: MongoDb and Windows Azure
Page 5: MongoDb and Windows Azure

What is #mongodb?MongoDB is

a scalable, high-performance, open source, NoSQL database,

written in C++

Page 6: MongoDb and Windows Azure

DEMOSetup

Page 7: MongoDb and Windows Azure

Data modeling• Embedding– you have “contains” relationships

between entities– you have one-to-many relationships

where the “many” objects always appear with or are viewed in the context of their parent documents

Page 8: MongoDb and Windows Azure

Data modeling• Referencing– when embedding would result in

duplication of data but would not provide sufficient read performance advantages to outweigh the implications of the duplication

– to represent more complex many-to-many relationships

– to model large hierarchical data sets

Page 9: MongoDb and Windows Azure

DEMOQueries and indexes

Page 10: MongoDb and Windows Azure

Replication • Database replication ensures

redundancy, backup, and automatic failover

Page 11: MongoDb and Windows Azure

Replication

Member 1PRIMARY

Member 3SECONDAR

Y

Member 2SECONDAR

Y

Member 1DOWN

Member 2PRIMARY

Member 1RECOVERIN

G

Member 1SECONDAR

Y

Page 12: MongoDb and Windows Azure

DEMOReplica set

Page 13: MongoDb and Windows Azure

Sharding • Sharding automatically balances

data and load across machines. Sharding provides additional write capacity by distributing the write load over a number of mongod instances.

Page 14: MongoDb and Windows Azure

DEMOSharding

Page 15: MongoDb and Windows Azure

mongosmongos

Sharding

Config 01

Config 02

Config 03

mongos

shard 01 shard 02 shard 03

client

Page 16: MongoDb and Windows Azure

…and Windows Azure?• Virtual machine (IaaS)• Worker role (PaaS)• MongoLab (SaaS)

Page 17: MongoDb and Windows Azure

DEMOWindows Azure

Page 18: MongoDb and Windows Azure

Q&ATutto il materiale di questa sessione su

http://www.communitydays.it/

#CDays13