简体   繁体   English

统一使用MongoDB和MySQL

[英]Using MongoDB and MySQL in unison

Some parts of my web app would work very well with a RDBMS, such as user and URL handling - I want to normalize users, emails, hosts (ie stackoverflow.com), and urls (ie https://stackoverflow.com/questions/ask ) so that updating things in one place update things in all places and to minimize redundancy. 我的Web应用程序的某些部分可以很好地与RDBMS配合使用,例如用户和URL处理-我想规范化用户,电子邮件,主机(即stackoverflow.com)和url(即https://stackoverflow.com/questions) / ask ),以便在一处更新事物在所有位置更新事物,并最大程度地减少冗余。

But some parts of my web app would very well with a document-based database, like Mongo, because they have a lot of components that would work more efficiently as embedded objects. 但是我的Web应用程序的某些部分非常适合基于文档的数据库,例如Mongo,因为它们具有许多可以作为嵌入式对象更有效地工作的组件。

Would it make sense to use MySQL for the relational objects and Mongo for the document objects, or would it be not worth the hassle to have to manage two types of databases? 将MySQL用于关系对象并将Mongo用于文档对象是否有意义,还是不必管理两种数据库就麻烦了? I know that Mongo has references, but I get the idea that it is not really designed and optimized for references. 我知道Mongo有参考,但是我得到的想法是,它实际上并不是为参考设计和优化的。

Thanks! 谢谢!

PS: I read this: Using combination of MySQL and MongoDB and it scratches the edge of what I am asking, but it is really a completely different question. PS:我读到了这篇文章: 使用MySQL和MongoDB的组合,这确实触及了我所问的问题,但这确实是一个完全不同的问题。

We use Mongo and MySQL in unision. 我们统一使用Mongo和MySQL。 Yes there is additional maintenance involved but it is about using the right tool for the right job. 是的,这涉及额外的维护,但这是关于使用正确的工具完成正确的工作。 We use Mongo for a more real-time scenario where we need fast reads and writes and can do without persisting data for long periods of time. 我们将Mongo用于更实时的场景,在该场景中,我们需要快速读写,并且可以长时间不保留数据。 MySQL for everything else. MySQL的其他一切。

That being said, your needs may be unique and you need to figure out the right tool for the job. 话虽如此,您的需求可能是独特的,并且您需要找出适合该工作的工具。

I recently built a system using MySql for as the RDBMS managing users and blogging and MongoDB for searchable attributes. 我最近建立了一个系统,使用MySql作为RDBMS管理用户和博客,使用MongoDB作为可搜索属性。 It works well however keeping data in sync, especially user Id's etc requires a bit of work. 它运作良好,但是要保持数据同步,尤其是用户ID等需要一些工作。 It is a case of basically choosing the right tool for the job. 基本上是为工作选择合适的工具的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM