use case for MongoDB to migrate from MySQL
I'm using PHP and MySQL for social network system
I have MySQL table named member_feed , in this table I save feeds for each member, my table structure is :
|member_feed_id | member_id | content_id | activity_id | active
in this table I have more than 120 million record , and every member has set of record.
I do this queries on this table :
1 - select * from member_feed where memebr_id= $memberId
2- update memebr_feed set active = 1 where member_id = $member_id
3- insert into member_feed (member_id, content_id,activity_id,active values(2,3,59,1) )
for each member daily I have at least new 50 feed by beanstalkd system and I have more than 60000 member .
I currently work to migrate from MySQL to MongoDB and I'm new on MongoDB. so I need to convert this table to collection in MongoDB.
is this use cases good for mongodb and good solution for my system to increase system performance?
Well, In mongodb joins between two collection is not available so, my question is where you will store member,content, activity? i believe these should embedded in the member_feed.
Example: member_feed Structure:
{_id:1,member:{_id:2,name:"Anuj"},activity:{details:"xyz"},active:false}
Hope that helps!!!
Thanks
链接地址: http://www.djcxy.com/p/88750.html下一篇: MongoDB从MySQL迁移的用例