PostgreSQLからMongoDBへ
Upcoming SlideShare
Loading in...5
×
 

PostgreSQLからMongoDBへ

on

  • 5,035 views

原宿のセレクトショップアシストオンの通販サイトを、インフラの交換を含めてMongoDBかする際のあれこれ。

原宿のセレクトショップアシストオンの通販サイトを、インフラの交換を含めてMongoDBかする際のあれこれ。

Statistics

Views

Total Views
5,035
Views on SlideShare
3,025
Embed Views
2,010

Actions

Likes
2
Downloads
29
Comments
0

19 Embeds 2,010

http://d.hatena.ne.jp 923
http://doryokujin.hatenablog.jp 471
http://basuke.blogspot.com 218
http://basuke.blogspot.jp 131
http://www.basuke.com 124
http://blog.basuke.com 107
http://webcache.googleusercontent.com 19
https://twitter.com 5
http://www.techgig.com 2
http://basuke.blogspot.tw 1
http://www.linkedin.com 1
http://cc.bingj.com 1
http://timprx.appspot.com 1
http://static.slidesharecdn.com 1
http://dev.daikoku-ya.org 1
resource://brief-content 1
http://paper.li 1
http://translate.googleusercontent.com 1
http://basuke.blogspot.com.tr 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

PostgreSQLからMongoDBへ PostgreSQLからMongoDBへ Presentation Transcript

  • PostgreSQLMongoDB CTO @basuke
  • not onlybut also
  • http://www.assiston.co.jp/•• ~1000• 30~80 PV
  • •••• Google
  • ••••
  • MongoDB ( )
  • • PostgreSQL 7.4 => 8.1• PHP 4.3 => 4.4 => 5.1•
  • • MongoDB 1.6.3• PHP 5.3• Lithium••
  • Lithium• http://lithify.me/• 5.3• CakePHP• MongoDB / CouchDB• ↑ RDB w
  • PHP MongoDB • Lithium • pecl mongo •
  • Item::find(all, array( conditions => array( category => $tag, visible => true, ), order => array( position=>DESC, id => DESC), ));
  • $item_collection->find(array( category => $tag, visible => true, )).sort(array( position=>-1, id => -1), ));
  • • mongoimport / mongoexport • JSON • JSON• PHP••
  • • mongoimport -d assiston -c items --drop --file items.dump {"no" : 123456, "items" : [{"at" : 1285679232000}}
  • Mongo Extended JSON• http://www.mongodb.org/display/DOCS/Mongo +Extended+JSON• $binary, $date, $oid• $date milliseconds • PHP 32bit int
  • • • PHP JSON• TIMESTAMP json_encode • 2010-12-10 17:20:21 => 1291969221 • 1291969221 sec => "||date:1291969221000||" • JSON • "||date:1291969221000||" => Date(1291969221000)
  • • PHP w • Python OK • pgmongo
  • 1: atomic•• ••
  • CREATE TABLE ORDERS ( id SERIAL PRIMARY KEY, total INTEGER NOT NULL, { ... no: integer,); total: integer, items: [CREATE TABLE ORDER_ITEMS ( { price: integer, ...}, id SERIAL PRIMARY KEY, ] order_id INTEGER ... REFERS TO ORDERS, } price INTEGER NOT NULL, ...);
  • 2:• ObjectID•• function(seqname) { return db.sequences.findAndModify({ query:{_id:seqname}, update: {$inc: {val:1}}, upsert: true, new: true}).val; }• db.system.js • db.eval("return sequence(abc)")
  • 3: mongo on github• https://github.com/mongodb/mongo/tree/ master/jstests• MongoDB JavaScript
  • Thank you.http://basuke.com/