mongodb相较mysql的优劣势_php – MongoDB或MySQL的优点/缺点

We have users that can have MANY different properties, literally

hundreds of settings, and I’m not a fan of MySQL tables that wide. I

really like Mongo for this.

We have different types of forms, each can have completely

different fields. Right now, we have a list of forms with generic

data, then join the relevant table for additional data. I would have

all of these fields in one distinct document with Mongo, and I could easily add fields without worrying.

从你的帖子我明白你的最终目标是处理用户&包含不同模式(也称为模式)的表单.我相信mongodb是一个正确的选择.

We have fees, notes, history on each form. I like how in MySQL they

are in a different table, and I can get history by form or by user –

same as notes.

没问题,您可以使用不同的文档(或根据大小的嵌入式文档) – 16 mb是文档的最大大小)来处理这个没有任何问题.所以你可以有这样的模式

Form

- form field1

- form field1

- id of the fees doc

- id of the notes doc

- id of the history doc

或(嵌入文档)

Form

- form field1

- form field2

- embedded fees doc

- fees field1

- fees field2

- embedded notes doc

- notes field1

- notes field2

Our policy is pretty much keep ALL data, even deleted or pre-edited data… forever. >Should I be worried about hitting a size limit? We’re probably talking 100gb by the end of >2013

您将存储尽可能多的数据,已经有production deployments存储数据超过太字节.

Is it a bad idea for my first Mongo project to be a somewhat major bit

of software? Is it something I can learn as I go?

是的,如果您要使用mongodb,而无需原型设计您的应用程序模型.我会推荐实现(原型)一个最小的应用程序集(如在mysql中吸收的功能),并学习基础知识,看看你的舒适程度如何.

I like the case insensitivity of MySQL column names for quick and dirty things.

Mongo强制区分大小写,因为这是BSON的性质(以及JSON)键值对.

In MySQL, I break things out to different tables. Is it fine, in

Mongo, to put data together that CAN be separated? Example: username,

email, phone, license1 => [num,isValid],

mongo超过其他sql数据存储的主要优点是,您可以在同一文档(16 MB大小)内存储相同信息.如果您不确定数据的大小或某些部分是否在增长,那么您可以将该部分分割成另一个.由于您对查询的问题感到担忧,因此会大大减少请求数量.

Is there any problems with doing a HYBRID setup, where user data is is

Mongo, and form data is in MySQL?

不,绝对不是,其实我目前正在运行mongodb以及mysql(仅用于交易).但是如果您不处理任何交易,您可以坚持使用mongodb.

We have to run a lot of reports, are there limitations on this in

Mongo? For example, would I run into problems looking for every form

from the past 40 days with a fee over $10, with the fees in each row

totaled up, sorted by the age of the user who filled it out?

不,我没有看到任何限制.实际上,它非常快速的处理查询与适当的索引.但是,有一些事情你不能像常规连接一样做,而是可以使用map / reduce来处理报告的数据.

Is MongoDB supported by any “cloud” providers? AWS does a lot for

MySQL, but it looks like I’d be on my own for Mongo

Mongohq,Mongolab是一些专门管理的mongo托管服务.另外redhat openhift& vmware cloundfoundry为mongo提供托管平台,您可以查看mongo hosting center了解更多信息

希望这可以帮助

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值