Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db

4,153 views
4,059 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,153
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db

  1. 1. Tikal Fuse Day Access layer implementation (C#) based on MongoDB Session leaders: Michael Lvov & Igor Zelmanovich
  2. 2. Agenda <ul><li>Session ambition   </li></ul><ul><li>Session prerequisites </li></ul><ul><li>Motivation </li></ul><ul><li>MongoDB - document-oriented database </li></ul><ul><li>MongoDB Dot.Net driver </li></ul><ul><li>C# examples: Create DB and Insert data </li></ul><ul><li>C# examples: Queries </li></ul><ul><li>BlogEngine.NET </li></ul>
  3. 3. Session ambition   <ul><li>Implement Data Access layer based on MongoDB and integrate it into BlogEngine.NET project </li></ul>
  4. 4. Session prerequisites  <ul><li>Visual Studio 2008 </li></ul><ul><li>MongoDB server (http://www.mongodb.org/display/DOCS/Downloads) </li></ul><ul><li>MongoDB C# driver (http://github.com/samus/mongodb-csharp/downloads) </li></ul><ul><li>BlogEngine.NET (v 1.6) source code and binaries from CodePlex (http://blogengine.codeplex.com/releases/view/39387) </li></ul><ul><li>Github account for getting write access to repository </li></ul>
  5. 5. Motivation  <ul><li>Modern projects need to manipulate with huge data amount, as result the necessity of high scalability and  high performance is very actual and always grows </li></ul><ul><li>RDBMS databases cannot supply ultimate solution and alternative concepts like in NoSQL systems look very interesting </li></ul><ul><li>Key-value stores like Google Big Table or Cassandra that provide fast and extremely large-scale solution but you can forget the comfort work with SQL queries like in RDBMS databases.     </li></ul>
  6. 6. MongoDB - document-oriented database <ul><li>Document-oriented databases combine between advantages of DBMS databases and key-values stores </li></ul><ul><li>MongoDB is a scalable, high-performance, schema-free document-oriented DB, supports dynamic queries in JSON-style format, indexes, replication, sharding, MapReduce. </li></ul><ul><li>Development by commercial company as open-source project written in C++. There are a lot of documentation, tutorials and samples on project site.  </li></ul><ul><li>Interface based on native drivers that exist for most environments: C, C++,Java,Python,Ruby... </li></ul>
  7. 7. MongoDB Dot.Net driver <ul><li>Mongodb-csharp </li></ul><ul><li>Open-source project </li></ul><ul><li>Written in C# </li></ul><ul><li>Support Mono </li></ul><ul><li>LINQ support </li></ul>
  8. 8. C# examples: Create DB and Insert data <ul><li>Mongo mongo = new Mongo(); </li></ul><ul><li>mongo.Connect(); </li></ul><ul><li>IMongoCollection postsTbl = mongo.getDB(&quot;BlogDB&quot;).GetCollection(&quot;Posts&quot;); </li></ul><ul><li>Document post = new Document(); </li></ul><ul><li>post[&quot;Tittle&quot;] = &quot;Tittle1&quot;; </li></ul><ul><li>post[&quot;Timestamp&quot;] = DateTime.Now; </li></ul><ul><li>postsTbl.Insert(post); </li></ul>
  9. 9. C# examples: Queries <ul><li>Document spec = new Document(); </li></ul><ul><li>spec[&quot;Tittle&quot;] = &quot;Tittle1&quot;; </li></ul><ul><li>Document myPost = postsTbl.FindOne(spec); </li></ul><ul><li>or with LINQ </li></ul><ul><li>IMongoQuery query = postsTbl.AsQueryable(); </li></ul><ul><li>var docs = query.Where(doc => doc[&quot;Tittle&quot;] == &quot;Tittle 1&quot;); </li></ul>
  10. 10. BlogEngine.NET <ul><li>Open source .NET blogging project </li></ul><ul><li>Very easy to setup and customize </li></ul><ul><li>Layers separation </li></ul><ul><li>DataAccess customization – only implement well-defined data provider interface </li></ul>
  11. 11. Q & A

×