Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not in love with MongoDB, DocumentDB is Azure only. Finally a (great) document database option for me (I work in a .NET shop). Kudos to you guys.

But... but... what's with that C# API? It doesn't look like typical C# at all.



Slava @ RethinkDB here.

You might want to look at https://github.com/mfenniak/rethinkdb-net (this is an alternative C# driver with a different API). We'd love to get an official C# driver in soon, so if the community has suggestions on how to improve the API (and which driver feels more idiomatic), we're all ears!


From a quick glance, this one you just posted feels way more idiomatic than the Java port.

The ultimate idiomatic thing to do would be to expose rethink as an IQueryable<T>, but implementing it can get hard/tricky.

https://msdn.microsoft.com/library/System.Linq.IQueryable


That would be amazing, but potentially also misleading.

My 2 cents for Slava & co: The idea of IQueryable<T> is that it implements all LINQ "operators" (a weird LINQ term; they're just methods on an interface) just like IEnumerable<T> does it on in-memory data structures. But internally IQueryable<T> implementations typically build an SQL query instead.

So IQueryable<T> is designed for a use case somewhere halfway between an SQL query builder and an ORM.

I don't know ReQL well enough, so you'll have to assess this yourselves: If you can map all or most LINQ operators into ReQL, then you have to do the effort and implement IQueryable, it's too awesome an opportunity to let go.

But if the match is only, say, 50%, plus there's a couple of things Rethink can do that isn't easy to express with LINQ, I'd strongly recommend not implementing it at all, but designing your own, C#-flavored, query interface that just resembles the LINQ operators wherever possible (e.g. use "Where" instead of "filter").

Thing is, developers expect that anything they do on an IQueryable is transformed into a single gigantic query and optimized and executed once, on the database. Maybe Rethink can't guarantee the same performance characteristics, simply because it's no relational SQL-ish database. It would have to implement certain parts of IQueryable in client-side memory just to be compatible. Do that, and you'll end up fooling a lot of developers and they'll have a hard time finding out where their speed went. The other option is runtime NotImplementedExceptions for all unsupported methods, which really is just as unfriendly.


Thanks guys, that helps a lot!


If you're in C#, the best NoSQL database for you is RavenDB[0].

First class LINQ support. Transactions. Full text search. Blazing fast. Open source. And it creates and maintains indexes for you based on your app's queries; database machine learning that keeps your app fast.

Disclaimer: I'm a bit biased, as I've contributed to RavenDB. But it really is a great document database. I use it on nearly every project, personal and professional.

[0]: http://ravendb.net


I like RavenDb, but correct me if I'm wrong, but it isn't free?

http://ravendb.net/buy


It's free for open source projects.


From the little I know about C#, the LINQ (IQueryable?) interface is very well designed/used -- maybe some work could be done to look into exposing that sort of API?

I can at least say that the C# API looks extremely consistent with rethink in other languages.


>the LINQ (IQueryable?) interface is very well designed/used

It's very well designed/used if someone else does the heavy lifting of creating the data provider for you. Speaking as someone who has done it, writing your own IQueryable LINQ provider is a serious hassle, though fortunately it only has to be done once. If it's something you really wanted, I would try to lean on RethinkDB to do it rather than implementing it yourself.


Oh that's what I meant -- RethinkDB is thoroughy open source though, so I'm sure if someone in the community found the time to do it, the rdb devs would give it a look and improve the code, and possibly merge.


Well, they are looking for people to help out, if you have time and can invest in it you could be one of the contributors I'm sure. Otherwise I'm sure with Windows being a platform for it someone will come along and work on either a new driver (API) or improve the existing one.


> Brian [Chavez] based his C# library on our own official Java driver, which we released in December.

I'm guessing it's close to a line-for-line port, so Chavez kept all the Java style conventions.


Not all of them, but yeah, it's close. The main issue with 3rd party libraries is keeping them up to date with the official drivers. The way this driver is written, updates can be automated


Had you looked into ravendb at all?


RavenDb?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: