简体   繁体   English

NoSQL数据库(MongoDB)与关系数据库(MySQL)

[英]NoSQL databases (MongoDB) versus relational databases (MySQL)

I've been spending a considerable amount of time learning MongoDB as part of the MEAN stack (I'm new to the MEAN stack), and I feel like I'm just barely starting to get the hang of it. 作为MEAN堆栈的一部分,我花了很多时间来学习MongoDB(我是MEAN堆栈的新手),我觉得我才刚刚开始了解它。 Recently, however, my supervisor at work (who's an experienced programmer) suggested I learn relational databases (it could be that it's used by more companies), and I have taken his suggestion to heart since I'm only a junior developer, and would like to move up soon. 但是最近,我的上司(一位经验丰富的程序员)建议我学习关系数据库(可能被更多的公司使用),因为我只是一个初级开发人员,所以我深信他的建议。喜欢很快就升起来。 My personal goal/project is to build a social networking site where one group of users have the ability to search for another group of users (and most likely charge a membership fee). 我的个人目标/项目是建立一个社交网站,其中一组用户可以搜索另一组用户(并且很可能会收取会员费)。 Would the database matter for a project like this? 数据库对这样的项目有影响吗? I would love to kill two birds with one stone by learning something (and learning it really well) that could be used in my personal project, and in a professional job. 我很乐意通过学习可以(可以很好地学习)可以用于我的个人项目和专业工作的东西,用一块石头杀死两只鸟。

I'm certainly open to learning more than one language, but I need a starting point, so I need something that will help me accomplish my personal goal. 我当然愿意学习多种语言,但是我需要一个起点,因此我需要一些可以帮助我实现个人目标的东西。 Since I've spent a considerable amount of time with JavaScript (as oppose to, say, Python), having to learn relational databases concerns me. 由于我花了很多时间使用JavaScript(例如反对Python),因此必须学习关系数据库使我感到担忧。 Are there any downsides to just sticking to MongoDB? 坚持MongoDB有什么弊端吗?

Thanks in advance! 提前致谢!

The first thing you need is to assess what type of data you are going to deal with (will it be structured, easily represented by tables , or it will be more of the non-structured type). 您需要做的第一件事是评估要处理的数据类型(结构化,易于由表示的数据 ,还是非结构化类型的数据)。

If structured, RDBMS is the way to go. 如果是结构化的,则RDBMS是必经之路。

Incidentally, as far as I know, the first versions of Facebook were implemented using MySQL (the type of DBMS your boss was referring to). 据我所知,Facebook的第一个版本是使用MySQL(您老板所指的DBMS类型)实现的。

Farid, as you're a junior programmer, I'd suggest you to learn as much as possible of both approach. Farid,由于您是初级程序员,所以建议您尽可能多地学习这两种方法。

The knowledge acquired on one of them will also help you getting the most from the other (as they both concern data, how to structure it and how to query it). 从其中一个获得的知识也将帮助您从另一个获得最大的收益(因为它们都与数据有关,如何构造数据以及如何查询数据)。

Also, in the day by day job (unless you specialize only in large sites where scalability is the first concern) you might encounter RDBMS more frequently than NoSQL choices. 另外,在日常工作中(除非您仅专注于首先关注可伸缩性的大型站点),与NoSQL选择相比,遇到RDBMS的频率可能更高。

Both technologies have pro and cons and, unless you know both sides (at least documenting yourself, if not by direct experience) you might go for one solution when the other could have been preferable. 两种技术都有优点和缺点,除非您了解双方(至少要记录自己,如果没有直接经验的话),否则您可能会选择一种解决方案,而另一种解决方案则更可取。

Well, anyone have concern about learn SQL (and use JOIN), but: 好吧,任何人都担心学习SQL(并使用JOIN),但是:
One day, you don't know how, you will use it (or understand it), so perhaps is better take a moment for SQL (it's the most widespread) 有一天,您不知道如何使用它(或理解它),所以也许花一点时间来学习SQL(这是最普遍的)

MongoDB is good if you development a REST service, but if you want make a social network like project, perhaps is better look at Graph database . 如果您开发REST服务,则MongoDB很好,但是如果您要进行类似项目的社交网络,也许最好看一下Graph数据库


Perhaps that video can help, is an overview of SQL vs NoSQL. 视频可能会有所帮助,它是SQL vs NoSQL的概述。

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

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