Use MySQL switch for MongoDB

I use PHP and MySQL for a social network system

I have a MySQL table called member_feed, in this table I save feeds for each member, my table structure:

|member_feed_id | member_id | content_id | activity_id | active 

I have over 120 million records in this table, and each member has a set of records.

I do these queries in 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 I have at least a new 50th channel with beanstalkd every day and I have more than 60,000 members .

I am currently working to upgrade from MySQL to MongoDB, and I'm new to MongoDB. so i need to convert this table to collection in MongoDB.

Is this usage example good for mongodb and a good solution for my system to improve system performance?

+4
source share
1 answer

Well, in mongodb, the connections between the two collections are not available, so my question is where will you store the member, content, activity? I believe that they should be embedded in member_feed.

Example: member_feed Structure:

 {_id:1,member:{_id:2,name:"Anuj"},activity:{details:"xyz"},active:false} 

Hope this helps !!!

thanks

+1
source

Source: https://habr.com/ru/post/1499909/


All Articles