Are there any comrades who are using MongoDB to do the read and write separation?

Source: Internet
Author: User
Tags new set
Are there any comrades who are using MongoDB to do the read and write separation?
How does the PHP extension implement MongoDB read-write separation?

Reply content:

Are there any comrades who are using MongoDB to do the read and write separation?
How does the PHP extension implement MongoDB read-write separation?

Can be a layer of ORM, such as the addition of Select,insert,update orm three methods, pointing to different servers, so that you can easily implement the read separation, you can refer to the thinkphp read separation mechanism

MongoDB has a bit of a pit in the MapReduce query, if there is an out result to the new set this does not know how to deal with it.

A master multiple from a replica set can write master read from by specifying the read_preferences implementation.
Extensions directly specify Read_preferences.

MongoDB does not recommend the use of Master/slave way to do read and write separation, so it is best not to do so, using replica sets bar.

Replica sets replace Master-slave replication for most use cases. If possible, use replica sets rather than Master-slave replication for all new production deployments. This documentation remains to support legacy deployments and for archival purposes only.

If you want to optimize read and write performance, you should try using auto-sharding, which mongos dynamically balances the pressure of each database as a DB proxy.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.