为什么很多nosql存储都是用java编写的?

发布于 2025-01-05 03:16:28 字数 260 浏览 1 评论 0原文

据我所知,很多nosql存储都是用java编写的,例如HBase,Cassandra。但根据我的经验,很多高性能的服务器程序都是用c/c++编写的(例如Apache、Opensips等),为什么这样的java实现的程序在生产使用中能够表现良好?是因为Java代码很容易阅读吗?用java实现的维护和分布式系统扩展性很好吗?

BTW,我知道用Java写代码肯定效率更高,但是正如有人说的,在大公司实现速度不是问题,因为一旦实现并重构几轮,程序就可以运行得很好,所以时间成本从长远来看并不高。

As far as I know, many nosql stores are written in java, for example HBase, Cassandra. But according to my experience, many high performance server program are written in c/c++ (e.g. Apache, Opensips, etc.), why can such java-implementing program behave well in production use?Is it because that Java code is easy to read and maintain and distributed system implemented in java scales well?

BTW, I know that writing code in Java is sure more productive, but as someone said, implementation speed is not a question in big company, because once implemented and refactor for several rounds, the program can run very well, so the cost of time is not high for from a long term view.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2025-01-12 03:16:29

如果您点击右侧“相关”部分中的第一个链接(为什么 Cassandra 用 Ja​​va 编写),您将找到答案。

简短摘要:

  • 它是独立于平台的。
  • Java 代码不一定比 C/C++ 慢很多,有时甚至更快(见下文)
  • Java 从一开始就内置了线程支持 - 对于任何平台
  • 安全/安全(没有缓冲区溢出、核心转储……)

< “根据定义,C/C++ 比 Java 更快”的神话只是一个神话。查看这个问题作为反例。

If you follow the first link (Why was Cassandra written in Java) in the "Related" section on the right, you will find answers.

Short summary:

  • It is platform independent.
  • Java code is not necessarily much slower than C/C++, sometimes even faster (see below)
  • Java has built in threading support right from the start - for any platform
  • Security/Safety (no buffer-overflows, core dumps, ...)

EDIT The "C/C++ is faster than Java by definition" myth is just that - a myth. Look at this question for a counter example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文