Using MongoDB vs MySQL with lots of JSON fields?

前端 未结 3 1744
萌比男神i
萌比男神i 2021-02-01 17:53

There is a microblogging type of application. Two main basic database stores zeroed upon are: MySQL or MongoDB.

I am planning to denormalize lot of data I.e. A vote done

3条回答
  •  深忆病人
    2021-02-01 18:42

    I'm not going to comment on the comparisons (I work for 10gen and don't feel it's appropriate for me to do so), however, I will answer the specific MongoDB questions so that you can better make your decision.

    Back-Up

    Documentation here is very thorough, covering many aspects:

    • Block-Level Methods (LVM makes it very easy and quite a lot of folk do this)
    • With/Without Journaling
    • EBS Snapshots
    • General Snapshots
    • Replication (technically not back-up, however, a lot of folk use replica sets for their redundancy and back-up - not recommending this but it is done)

    Until recently, there is no MongoDB equivalent of mylvmbackup but a nice guy wrote one :) In his words

    Early days so far: it's just a glorified shell script and needs way more error checking. But already it works for me and I figured I'd share the joy. Bug reports, patches & suggestions welcome.

    Get yourself a copy from here.

    Restores

    • Formats etc

    mongodump is completely documented here and mongorestore is here.

    mongodump will not contain the indexes but does contain the system.indexes collection so mongorestore can rebuild the indexes when you restore the bson file. The bson file is the actual data whereas mongoexport/mongoimport are not type-safe so it could be anything (techically speaking) :)

    Monitoring

    Documented here.

    I like Cacti but afaik, the Cacti templates have not kept up with the changes in MongoDB and so rely on old syntax so post 2.0.4, I believe there are issues.

    Nagios works well but it's Nagios so you either love or hate it. A lot of folk use Nagios and it seems to provide them with great visiblity.

    I've heard of some folk looking at Zappix but I've never used it so can't comment.

    Additionally, you can use MMS, which is free and hosted externally. Your MongoDB instances run an agent and one of those agents communicate (using python code) over https to mms.10gen.com. We use MMS to view all performance statistics on the MongoDB instances and it is very beneficial from a high-level wide view as well as offering the ability to drill down. It's simple to install and you don't have to run any hardware for this. Many customers run it and some compliment it with Cacti/Nagios.

    Help information on MMS can be found here (it's a very detailed, inclusive document).

提交回复
热议问题