简体   繁体   English

要CouchDB还是不要?

[英]To CouchDB or not to?

Note: (I have investigated CouchDB for sometime and need some actual experiences). 注意:(我已经调查了CouchDB一段时间并需要一些实际经验)。

I have an Oracle database for a fleet tracking service and some status here are: 我有一个用于车队跟踪服务的Oracle数据库,这里的一些状态是:

  1. 100 GB db 100 GB db
  2. Huge insertion/sec (our received messages) 巨大的插入/秒(我们收到的消息)
  3. Reliable replication (via Oracle streams on 4 servers) 可靠的复制(通过4台服务器上的Oracle流)
  4. Heavy complex queries. 繁重的复杂查询。

Now the question: Can CouchDB be used in this case? 现在的问题是:在这种情况下可以使用CouchDB吗?

Note: Why I thought of CouchDB? 注意:为什么我想到CouchDB?

  1. I have read about it's ability to scale horizontally very well. 我已经读过它能够非常好地水平扩展的能力。 That's very important in our case. 这在我们的案例中非常重要。
  2. Since it's schema free we can handle changes more properly since we have a lot of changes in different tables and stored procedures. 由于它是无模式的,因此我们可以更正确地处理更改,因为我们在不同的表和存储过程中进行了大量更改。

Thanks 谢谢

Edit I: I need transactions too. 编辑I:我也需要交易。 But I can tolerate other solutions too. 但我也可以容忍其他解决方案。 And If there is a little delay in replication, that would be no problem IF it is guaranteed. 如果复制有一点延迟,那么如果有保证就没问题。

You are enjoying the following features with your database: 您正在享受数据库的以下功能:

  1. Using it in production 在生产中使用它
  2. The data is naturally relational (related to itself) 数据自然是关系的(与自身相关)
  3. Huge insertion rate (no MVCC concerns) 巨大的插入率(没有MVCC问题)
  4. Complex queries 复杂的查询
  5. Transactions 交易

These are all reasons not to switch to CouchDB. 这些都是切换到CouchDB的原因。

Of course, the story is not so simple. 当然,故事并非如此简单。 I think you have discovered what many people never learn: complex problems require complex solutions. 我想你已经发现了许多人从未学过的东西:复杂的问题需要复杂的解决方案。 We cannot simply replace our database and take the rest of the month off. 我们不能简单地更换我们的数据库,并在休息一个月。 Sure, CouchDB (and BigCouch) supports excellent horizontal scaling (and cross-datacenter replication too!) but the cost will be rewriting a production application. 当然,CouchDB(和BigCouch)支持出色的水平扩展(以及跨数据中心复制!),但成本将重写生产应用程序。 That is not right. 那是不对的。

So, where can CouchDB benefit you? 那么,CouchDB在哪里可以让您受益?

I suggest that you begin augmenting your application with CouchDB applications. 我建议您开始使用CouchDB应用程序扩充您的应用程序。 Deploy CouchDB, import your data into it, and build non mission-critical applications. 部署CouchDB,将数据导入其中,并构建非任务关键型应用程序。 See where it fits best. 看看它最适合的地方。

For your project, these are the key CouchDB strengths: 对于您的项目,这些是CouchDB的关键优势:

  1. It is a small, simple tool—easy for you to set up on a workstation or server 它是一个小巧,简单的工具 - 您可以轻松地在工作站或服务器上进行设置
  2. It is a web server. 它是一个Web服务器。 It integrates very well with your infrastructure and security policies. 它与您的基础架构和安全策略非常好地集成。
    • For example, if you have a flexible policy, just set it up on your LAN 例如,如果您有灵活的策略,只需在LAN上进行设置即可
    • If you have a strict network and firewall policy, you can set it up behind a VPN, or with your SSL certificates 如果您有严格的网络和防火墙策略,则可以在VPN后面或使用SSL证书进行设置
  3. With that step done, it is very easy to access now. 与该步骤完成的,这是容易,现在访问。 Just make http or http requests. 只需发出http或http请求。 Whether you are importing data from Oracle with a custom tool, or using your web browser , it's all the same. 无论您是使用自定义工具从Oracle导入数据,还是使用Web浏览器 ,都是一样的。
  4. Yes! 是! CouchDB is an app server too! CouchDB也是一个应用服务器! It has a built-in administrative app, to explore data, change the config, etc. (like a built-in phpmyadmin). 它有一个内置的管理应用程序,用于探索数据,更改配置等(如内置的phpmyadmin)。 But for you, the value will be building admin applications and reports as simple, traditional HTML/Javascript/CSS applications. 但对您而言,价值在于将管理应用程序和报告构建为简单的传统HTML / Javascript / CSS应用程序。 You can get as fancy or as simple as you like. 你可以随心所欲或简单。
  5. As your project grows and becomes valuable, you are in a great position to grow, using replication 随着您的项目的发展和变得有价值,您可以使用复制来增长
    • Either expand the core with larger CouchDB clusters 使用更大的CouchDB集群扩展核心
    • Or, replicate your data and applications into different data centers, or onto individual workstations, or mobile phones, etc. (The strategy will be more obvious when the time comes.) 或者,将您的数据和应用程序复制到不同的数据中心,或者复制到个人工作站或移动电话等。(到时候,策略会更加明显。)

CouchDB gives you a simple web server and web site. CouchDB为您提供了一个简单的 Web服务器和网站。 It gives you a built-in web services API to your data. 它为您的数据提供了内置的 Web服务API。 It makes it easy to build web apps. 它使构建Web应用程序变得容易。 Therefore, CouchDB seems ideal for extending your core application, not replacing it. 因此,CouchDB似乎是扩展核心应用程序而不是替换它的理想选择。

I don't agree with this answer.. 我不同意这个答案..

I think CouchDB suits especially well fleet tracking use case, due to their distributed nature. 我认为CouchDB适合特别好的车队跟踪用例,因为它们具有分布式特性。 Moreover, the unreliable nature of gprs connections used for transmitting position data, makes the offline-first paradygm of couchapps the perfect partner for your application. 此外,用于传输位置数据的gprs连接的不可靠性使得couchapp的离线优先模式成为您应用的完美搭档。

For uploading data from truck, Insertion-rate can take a huge advantage from couchdb replication and bulk inserts, especially if performed on ssd-based couchdb hosting . 对于从卡车上传数据,插入速率可以从couchdb复制和批量插入中获得巨大优势,尤其是在基于ssd的couchdb托管上执行时

For downloading data to truck, couchdb provides filtered replication, allowing each truck to download only the data it really needs, instead of the whole database. 为了将数据下载到卡车,couchdb提供过滤复制,允许每辆卡车只下载它真正需要的数据,而不是整个数据库。

Regarding complex queries, NoSQL database are more flexible and can perform much faster than relation databases.. It's only a matter of structuring and querying your data reasonably. 关于复杂查询,NoSQL数据库更灵活,并且执行速度比关系数据库快得多。这只是合理构建和查询数据的问题。

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

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