我考虑在我的新 Doctrine 2.0 项目中使用 ODM/ORM/混合 ODM 和 ORM 实体。什么时候应该使用 ORM(MySQL InnoDB),什么时候应该使用 ODM(MongoDB)?我应该将它混合在一个项目中吗?
我的应用程序的伪结构(类似 Google 阅读器):
- 用户 { id、登录名、密码、电子邮件 }
- 频道{ ID,网址}
- 条目 { id、channelId、标题、正文、日期 }
- entryValue { entryId, userId, value }
- userFriend { user1Id, user2Id }
最受欢迎的功能:
- getValuesOfNewsByUsers(newsId, [userIdArray])
- getEntriesByUserWithMinValue(userId, minValue)
- areFriends(user1, user2)
- getEntryValues(userId, [entryIdArray])
我应该为entry和entryValue表中的数十亿行做好准备。