MongoDb and Windows Azure

Post on 11-May-2015

240 views 1 download

Tags:

Transcript of MongoDb and Windows Azure

Grazie aGrazie aSponsor

About me{

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

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

"type": "email", "value": "alessandro@codiceplastico.com"},{ "type": "twitter", "value": "@amelchiori"

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

]}

What is #mongodb?MongoDB is

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

written in C++

DEMOSetup

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

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

DEMOQueries and indexes

Replication • Database replication ensures

redundancy, backup, and automatic failover

Replication

Member 1PRIMARY

Member 3SECONDAR

Y

Member 2SECONDAR

Y

Member 1DOWN

Member 2PRIMARY

Member 1RECOVERIN

G

Member 1SECONDAR

Y

DEMOReplica set

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.

DEMOSharding

mongosmongos

Sharding

Config 01

Config 02

Config 03

mongos

shard 01 shard 02 shard 03

client

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

DEMOWindows Azure

Q&ATutto il materiale di questa sessione su

http://www.communitydays.it/

#CDays13