Сохранение / синхронизация графика Facebook в NoSQL (MongoDB)

Я создаю приложение, которое должно иметь возможность расширять данные графа facebook.

Я новичок в NoSQL хранилище, и мне нужна помощь.

Используя api графа, я могу вернуть пользователя, так как я хочу, чтобы мое приложение могло расширять несколько поставщиков социальных графов, я перемещаю все полученные ключи facebook в facebook подмножество массивов.

[User] => Array
    (
        [_id] => 4dd50c139bcb233c0c000000
        [name] => Foo Bar
        [first_name] => Foo 
        [last_name] => Bar
        [username] => fbar
        [location] => Array
            (
                [id] => 110774245616525
                [name] => Paris, France
            )

        [gender] => male
        [email] => fbar@gmail.com
        [timezone] => 2
        [locale] => fr_FR
        [facebook] => Array
            (
                [id] => 12345678
                [link] => http://www.facebook.com/foobar
                [verified] => 1
                [updated_time] => 2011-05-16T17:30:23+0000
                [picture] => https://graph.facebook.com/12345678/picture
            )

        [created] => MongoDate Object
            (
                [sec] => 1305807891
                [usec] => 0
            )
    )
  • Это хорошая практика?

Тогда я беру его друзей, I don't know if i should register each friend as separate users and try to use references, or if i can just add a Friend subset.

  • What would have the best performance and the easiest to keep in sync ?

     [User] => Array
     ( 
     [Friend] => Array
     (
     [0] => Array
     (
     [id] => 12345678
     [name] => Foo Bar
     )
    
     [1] => Array
     (
     [id] => 12345678
     [name] => Foo Bar
     )
    
     [2] => Array
     (
     [id] => 12345678
     [name] => Foo Bar
     )
    
  • Problem rise to another level with FriendLists, how should i store them ?? embed everything (and have a ton of duplicates in my User) or use reference ? How should i do that ?

I read : http://www.mongodb.org/display/DOCS/Trees+in+MongoDB which is quite helpfull... But i'm still unsure what i should do.

Thanks a lot.

5
задан Community 22 September 2017 в 18:01
поделиться