About me Serdar Büyüktemiz @hserdarb altdotnetturkiyeSoftware Developer @ Mavituna Security
Why MongoDB?• Popular • Easy to use nosql• Good for web projects• High performance (No joins and embedding makes reads and writes fast)• High availability (Replicated servers with automatic master failover)• Easy scalability (Automatic sharding)
Connecting to MongoDB• If DB does not exists driver will create one for you• http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial#CSharpDriverTut orial-Connectionstrings• mongodb://[username:password@]hostname[:port][/[database][?options]]
What is BSON?• MongoDB uses BSON as the data storage and network transfer format for "documents".• Short for Binary JSON• http://bsonspec.org/• http://www.mongodb.org/display/DOCS/BSON
Working with POCOs• Things can be really easy for you if you follow these rules for your pocos – Has a public no-argument constructor – Has a public get set property for each value you want to have serialized
A tip for better indexing• Run mongodb with notablescan parameter and be sure your your queries are not making full table scans... – You get exceptions if a query needs a table scan, it gives you a chance to fix your indexes on development time.