为什么Cassandra是用Java编写的? [英] Why was Cassandra written in Java?
问题描述
有关 Cassandra 的问题
为什么地球上的任何人都会用Java编写一个数据库ENGINE?
我可以理解你为什么要有一个Java接口,但是引擎...
我的印象是,没有比C / C ++更快的速度,数据库引擎不应该比最大速度慢,并且肯定不使用垃圾收集...
任何人都能解释一下,为什么Cassandra可以比在C / C ++代码上运行的普通SQL更快?
编辑:
对不起,为什么在地球上的地狱真的没有对我有任何意义。
我忽略了一个数据库,不像平均花园用户程序,需要只启动一次,然后运行很长一段时间,可能也是唯一的程序,这显然是一个重要的性能差异。
我更多地比较/引用一个无效(温和地)Java税程序,我在写作时使用(或者更喜欢使用)。
事实上,与使用Java进行税务程序不同,使用Java编写专用服务器程序是非常有意义的。
Question about Cassandra
Why the hell on earth would anybody write a database ENGINE in Java ?
I can understand why you would want to have a Java interface, but the engine...
I was under the impression that there's nothing faster than C/C++, and that a database engine shouldn't be any slower than max speed, and certainly not use garbage collection...
Can anybody explain me what possible sense that makes / why Cassandra can be faster than ordinary SQL that runs on C/C++ code ?
Sorry for the "Why the hell on earth" part, but it really didn't make any sense to me.
I neglected to consider that a database, unlike the average garden-varitety user programs, needs to be started only once and then runs for a very long time, and probably also as the only program on the server, which self-evidently makes for an important performance difference.
I was more comparing/referencing to a 'disfunctional' (to put it mildly) Java tax program I was using at the time of writing (or rather would have liked to use).
In fact, unlike using Java for tax programs, using Java for writing a dedicated server program makes perfect sense.
推荐答案
我可以看到以下几个原因:
I can see a few reasons:
- 安全:在Java中比在C ++中(记住缓冲区溢出?)
- 性能:不会更糟。它在启动时确定性更差,但一旦代码启动并运行,这不是一件大事。实际上,你必须记住一个重要的点:Java代码是由VM不断优化的,所以在某些环境下,它会比C ++更快
这篇关于为什么Cassandra是用Java编写的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!