为网络守护程序选择哪个 noSQL 数据库?
我正在编写一个自定义服务器,它应该非常高性能。 它有 100.000-600.000 个连接的客户端,并且存储了大约 1000 万条记录。 数据库将在单个服务器上运行。
服务器代码是通过twisted框架(Python)实现的。 现在我让它使用 MySQL,但我认为 NoSQL 数据库会更高效(没有复杂的查询,许多简单的写入/时间戳更改和许多简单的读取)。
我应该选择哪种 NoSQL 数据库?简单的索引将是一个优点,我希望能够选择从管理系统搜索数据库,从包含特定关键字和类似内容的日志创建组。
我查看了 Cassandra 和 MongoDB,MongoDB 对我来说似乎更容易进入/使用。
感谢您的帮助!
I am writing a custom server, which should be very performant.
It has 100.000-600.000 clients connected, and like 10 million records stored.
Database will run on a single server.
The server code is realized via twisted framework (in python).
Now I had it use MySQL, but I think a NoSQL database would be much more efficient (no complex queries, many simple writes / timestamp changes and many simple reads).
Which NoSQL database should I go for? Easy indexing would be a plus, I want the option to search the database from an administration system, create groups from logs containing a specific keyword and stuff like that.
I had a look at Cassandra and MongoDB, MongoDB seemed easier to get in / use for me.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就纯粹的学习曲线而言,MongoDB 将自己定位为 MySQL 的一个非常友好的替代品。 Cassandra 是一个非常不同的野兽,并且具有更高的学习曲线。也就是说,根据您的描述,两者都有可能解决您的问题。
As far as pure learning curve goes, MongoDB has positioned itself to be a very friendly alternative to MySQL. Cassandra is a very different beast and will have a higher learning curve. That said, both have the potential to solve your problem based upon what you describe.
您的需求非常简单:轻松索引、任意搜索、按关键字分组等——几乎每个 NoSQL 系统都可以工作。这实际上取决于您熟悉的技术。喜欢 C# 吗?然后使用 RavenDB——它甚至可以在您执行查询时自动添加索引。像二郎那样?那你就是个怪胎,但你应该选择 CouchDB。喜欢 JavaScript 和 JSON?使用 MongoDB。
就我个人而言,我真的很喜欢 Mongo,因为它感觉像是 SQL 和 NoSQL 数据库的可爱混合体。您可以对其进行索引(并获得惊人的性能!),这使得它几乎像一个 RDBMS。你还可以像键/值存储一样使用它,像“天空中的巨型哈希表”一样使用它。尽管如此,YMMV。和他们一起玩,看看什么对你有用。
You have pretty simple requirements: easy indexing, arbitrary searches, grouping on keyword, etc -- pretty much every NoSQL system would work. It really comes down to the technologies with which you're comfortable. Like C#? Then go with RavenDB -- it can even automatically add indices as you execute queries. Like Erlang? Then you're a freak, but you should go with CouchDB. Like Javascript and JSON? Go with MongoDB.
Personally I really like Mongo, as it feels like a lovely hybrid of SQL and NoSQL databases. You can index the hell out of it (and get amazing performance!), which makes it almost like a RDBMS. You can also use it like a key/value store, and use it like a "giant hashtable in the sky". Still, YMMV. Play with them and see what works for you.
Cassandra 确实是为多个服务器节点设计的,提供透明的复制。因此,您无法通过单个服务器主机获得最大价值。 Cassandra 也主要是为大规模而设计的(因此牺牲了索引和灵活的查询)。 1000 万条记录实际上并不是很大,因此您可以尝试更灵活但可扩展性较差的方法。
Cassandra is really designed for multiple server nodes, providing transparent replication. So you won't get the best value out of it with a single server host. Cassandra is also designed primarily for large-scale (and sacrifices indexing and flexible queries as a result). 10 million records isn't really very big, so you can afford to try something more flexible but less scalable.