简体   繁体   English

用Ruby编写的NoSQL DB?

[英]NoSQL DB written in Ruby?

Was curious, but are any NoSQL DBMS written in Ruby? 很好奇,但是NoSQL DBMS是用Ruby编写的吗?

And if not, would it be unwise to create one in Ruby? 如果不是,那么在Ruby中创建一个是不明智的吗?

Was curious, but are any NoSQL DBMS written in Ruby? 很好奇,但是NoSQL DBMS是用Ruby编写的吗?

In 2007, Anthony Eden played around with RDDB , a CouchDB-inspired document-oriented database. 在2007年, Anthony EdenRDDB一起工作RDDB是CouchDB启发的面向文档的数据库。 He still keeps a copy of the code in his GitHub account. 他仍将代码副本保存在他的GitHub帐户中。

I vaguely remember that at or around the same time, someone else was also playing around with a database in Ruby. 我隐约记得在同一时间或大约同一时间,其他人也在使用Ruby来处理数据库。 I think it was either inspired by or a reaction to RDDB. 我认为这是对RDDB的启发或反应。

Last but not least, there is the PStore library in the stdlib, which – depending on your definition – may or may not count as a database. 最后但并非最不重要的一点是,stdlib中有PStore库 ,根据您的定义,该可能会也可能不会算作数据库。

And if not, would it be unwise to create one in Ruby? 如果不是,那么在Ruby中创建一个是不明智的吗?

The biggest problem I see in Ruby are its concurrency primitives. 我在Ruby中看到的最大问题是其并发原语。 Threads and locks are so 1960s. 线程和锁都那么 20世纪60年代。 If you want to support multiple concurrent users, then you obviously need concurrency, although if you want to build an embedded in-process database, then this is much less of a concern. 如果要支持多个并发用户,则显然需要并发,尽管如果要构建嵌入式的进程内数据库,则不必担心。

Other than that, there are some not-so-stellar implementations of Ruby, but that is not a limitation of Ruby but of those particular implementations, and it applies to pretty much every other programming language as well. 除此之外,还有一些不太好的Ruby实现,但这不是Ruby的限制,而是那些特定的实现,并且它几乎还适用于所有其他编程语言。 Rubinius (especially the current development trunk, which adds Ruby 1.9 compatibility and removes the Global Interpreter Lock) and JRuby would both be fine choices. Rubinius(尤其是当前的开发主干,它增加了Ruby 1.9的兼容性并删除了Global Interpreter Lock)和JRuby都是不错的选择。

As an added bonus, Rubinius comes with a built-in actors library for concurrency and JRuby gives you access to eg Clojure's concurrency libraries or the Akka actors library. 作为额外的好处,Rubinius带有用于并发的内置actor库,而JRuby使您可以访问Clojure的并发库或Akka actors库。

Performance isn't really much of a concern, I think. 我认为性能并不是真正的问题。 Rubinius's Hash class, which is written in 100% pure Ruby, performs comparably to YARV's Hash class, which is written in 100% hand-optimized C. This shows you that Ruby code, at least when it is carefully written, can be just as fast as C, especially since databases tend to be long-running and thus Rubinius's or JRuby's (and in the latter case specifically also the JVM's) dynamic optimizers (which C compilers typically do not have) can really get to work. Rubinius的Hash类(用100%纯Ruby编写)与YARV的Hash类(用100%手工优化的C语言编写)具有相当的性能。这表明,至少在精心编写的情况下,Ruby代码可以与速度与C一样快,特别是因为数据库往往需要长时间运行,因此Rubinius或JRuby(在后者的情况下也专门是JVM)动态优化器(C编译器通常没有 )可以真正起作用。

Ruby is just too slow for any type of DBMS 对于任何类型的DBMS,Ruby都太慢了

c/c++/erlang are generally the best choice. 通常,c / c ++ / erlang是最佳选择。

You generally shouldn't care in what programming language was a DBMS implemented as long it has all the features and is available for use from your application programming language of choice. 只要具有所有功能并且可以从您选择的应用程序编程语言中使用它,您通常就不必在乎用哪种编程语言来实现DBMS。

So, the real question here is do you need one written in Ruby or available for use in Ruby. 因此,这里的真正问题是,您是否需要用Ruby编写或可以在Ruby中使用的代码?

In first case, I doubt you'll find a DBMS natively written in Ruby (any correction of this statement will be appreciated). 在第一种情况下,我怀疑你会发现原生 Ruby写的(这句话的任何修正可以理解的)一个DBMS。

In second case, you should be able to find Ruby bindings/wrappers for any decent DBMS relational or not. 在第二种情况下,您应该能够找到是否与任何体面的DBMS关系相关的Ruby绑定/包装器。

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

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