More Related Content Similar to Build socialsiteinruby Similar to Build socialsiteinruby (20) Build socialsiteinruby3. things to cover
What’s social world going on?
Social data storage in MongoDB
Streaming social data with MQ
Others worthy to mention
7. dev platforms
graph.facebook.com
dev.twitter.com
- documentations
- endpoints, request and response examples
- tools for developers
8. Social Data
id: "209664525731998_247270968638020"
from:
name: "Vanessa Tam"
id: "100000116574145"
to:
data:
-
name: "The House of Dancing Water"
category: "Arts/entertainment/nightlife"
id: "209664525731998"
message: "La=)"
actions:
-
name: "Comment"
link: "http://www.facebook.com/209664525731998/posts/247270968638020"
-
name: "Like"
link: "http://www.facebook.com/209664525731998/posts/247270968638020"
type: "status"
created_time: "2011-08-17T15:02:55+0000"
updated_time: "2011-08-17T15:44:36+0000"
likes:
data:
-
name: "Phoebe Lee"
id: "100002673212002"
count: 199
comments:
data:
-
id: "209664525731998_247270968638020_3569720"
from:
name: "The House of Dancing Water"
category: "Arts/entertainment/nightlife"
id: "209664525731998"
message: "Welcome!"
created_time: "2011-08-17T15:44:11+0000"
-
id: "209664525731998_247270968638020_3569724"
from:
name: "Vanessa Tam"
id: "100000116574145"
message: "okok"
created_time: "2011-08-17T15:44:32+0000"
-
id: "209664525731998_247270968638020_3569725"
from:
name: "Vanessa Tam"
id: "100000116574145"
message: "=)"
created_time: "2011-08-17T15:44:36+0000"
count: 3
9. Why not RDBMS
Scalability
- Horizontally
Flexibility
- Scheme change
12. a lot of more...
Flexibility:
- Schema Free
- Database setting: replication, secondary DB
- Model: data type, collection, _id, associations
- Lazy Cursor
e.g. rubyconftw = RubyConf.where(:location=>“Taiwan”) #cursor created
puts rubyconftw.entries #cursor executed
13. more...
Capped Collection
- logs, messages
- fixed after being created
... ...
14. ODM
MongoMapper
MongoRecord
Mongoid
- Rails 3
- Active Record Style
- Ruby Driver
18. What’s wrong...
Unstable Traffic
- online time
- irregular events
Data Lost
- updated response
- invalid response
Editor's Notes \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n