Mongo db使ってみよう

1,682 views

Published on

大阪 #8

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
1,682
On SlideShare
0
From Embeds
0
Number of Embeds
421
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mongo db使ってみよう

  1. 1. MongoDB使ってみよう 大阪#8 2012/01/28
  2. 2. 自己紹介織田 信亮(おだ しんすけ)大阪で開発者していますSQLWorld の代表ですhttp://d.hatena.ne.jp/odashinsuke/Twitter:@shinsukeoda
  3. 3. MongoDB ってなに?http://www.mongodb.org/ Document指向のDB Master - Slave レプリケーション 自動 Sharding BSON (JSON っぽい) Server-side JavaScript
  4. 4. SQL Server との比較 (用語)http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SQL Server MongoDB database database table collection row BSON document column BSON field primary key _id field
  5. 5. 環境構築http://www.mongodb.org/display/DOCS/Quickstart+Windows zip ダウンロード C:datadb に解凍 C:datadb...binmongod.exe 実行
  6. 6. コンソールから実行http://www.mongodb.org/display/DOCS/Quickstart+Windows C:datadb...binmongo.exe 実行 help show dbs show collecions db.createCollection(“foo”) db.foo.insert( { “id”:1, “name”:t est”}) db.foo.find()
  7. 7. C# から実行http://www.mongodb.org/display/DOCS/CSharp+Language+Center Visual Studio でプロジェクト作成 Package Manager Console(NuGet ) で Install-Package mongocsharpdriver
  8. 8. using System;using MongoDB.Driver;using MongoDB.Bson;public class Class1 { public static void Main(string[] args) { var server = MongoServer.Create(); var db = server.GetDatabase("test"); var foo = db.GetCollection("foo"); var item = new BsonDocument { { "id", 2 }, { "name", "bar" } }; foo.Insert(item); foreach (var d in foo.FindAll()) { Console.WriteLine(d); } }}
  9. 9. 何に使うの?http://www.mongodb.org/display/DOCS/Use+Cases イベントログ Content Management System(CMS) … ASP.NET providers http://takepara.blogspot.com/2011/11/asp.html http://takepara.blogspot.com/2011/11/apache- bench100001000-n-1000-c-8.html http://takepara.blogspot.com/2011/12/mongodb.html http://nuget.org/packages/MongoDB.Web

×