MongoDB:在服务器上还是在客户端上处理更可取? [英] MongoDB : What is preferable , process on server or on client?

查看:45
本文介绍了MongoDB:在服务器上还是在客户端上处理更可取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 MongoDB 的 .NET 驱动程序.我的问题很:

I work this the .NET driver for MongoDB. My question is quite :

什么是可取的以及为什么:

What is preferable and why :

在MongoDB服务器上使用javascript处理数据

process data using javascript on the MongoDB server

将 thd 数据加载到客户端并使用驱动程序方法完成所有工作?

load thd data to client and do all the work using the driver methods ?

推荐答案

如果可能,您应该避免使用 JavaScript 在 mongodb 服务器上处理数据.原因是 JavaScript 引擎是单线程的.这意味着一次只能有一个线程运行 JavaScript 引擎.可以想象,如果您有多个客户端连接到 mongodb,这将极大地影响性能——所有这些请求都将被序列化.

You should avoid processing data on the mongodb server using JavaScript if at all possible. The reason is that the JavaScript engine is single-threaded. This means that only one thread can be running the JavaScript engine at one time. As you can imagine, this will greatly impact performance if you have multiple clients connecting to mongodb -- all of these request will be serialized.

这篇关于MongoDB:在服务器上还是在客户端上处理更可取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆