MongoDB + EventMachine (+ Mongoid)

Hi ruby-talk,

I'm currently maintaining a modular ruby stack depending on MongoDB and want to rewrite some processes to run on EventMachine.

Does anyone have any experience with MongoDB and EventMachine? Specifically in conjunction with Mongoid?

What I've tried so far:
* em-mongo -- Works fine (ran for 2 months now on a staging environment), but doesn't support replica sets and is not Mongoid compatible.
* mongoid (old moped based version) + em-synchrony-moped -- Very hard to tell if it's working (i.e. actually using non-blocking I/O)
* mongoid (current mongoid version) + em-synchrony/mongoid + em-synchrony/mongo -- Dito. Though I'm 99% certain it isn't compatible (em-synchrony code for this is ancient)

I'm happy about any input, since my current conclusion is "Don't use Mongoid + EventMachine". :slight_smile:

cheers,
Rec

I would suggest avoiding EventMachine. It's complex, buggy, not idiomatic
Ruby, and not particularly well-maintained.

···

On Tue, Mar 1, 2016 at 10:08 AM, Recursive Madman <recursive.madman@gmx.de> wrote:

I'm currently maintaining a modular ruby stack depending on MongoDB and
want to rewrite some processes to run on EventMachine.

--
Tony Arcieri

Any tips on how to figure out if a process is doing blocking network I/O at any point (short of strace) would also be very helpful :slight_smile:

···

On 03/01/2016 07:08 PM, Recursive Madman wrote:

Hi ruby-talk,

I'm currently maintaining a modular ruby stack depending on MongoDB and want to rewrite some processes to run on EventMachine.

Does anyone have any experience with MongoDB and EventMachine? Specifically in conjunction with Mongoid?

What I've tried so far:
* em-mongo -- Works fine (ran for 2 months now on a staging environment), but doesn't support replica sets and is not Mongoid compatible.
* mongoid (old moped based version) + em-synchrony-moped -- Very hard to tell if it's working (i.e. actually using non-blocking I/O)
* mongoid (current mongoid version) + em-synchrony/mongoid + em-synchrony/mongo -- Dito. Though I'm 99% certain it isn't compatible (em-synchrony code for this is ancient)

I'm happy about any input, since my current conclusion is "Don't use Mongoid + EventMachine". :slight_smile:

cheers,
Rec

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

@Tony, Just out of curiosity, which evented library would you suggest using
in Ruby instead?

Regards

Carlos Alonso | Software Engineer | @calonso <https://twitter.com/calonso&gt;

···

On 2 March 2016 at 00:09, Tony Arcieri <bascule@gmail.com> wrote:

On Tue, Mar 1, 2016 at 10:08 AM, Recursive Madman <recursive.madman@gmx.de > > wrote:

I'm currently maintaining a modular ruby stack depending on MongoDB and
want to rewrite some processes to run on EventMachine.

I would suggest avoiding EventMachine. It's complex, buggy, not idiomatic
Ruby, and not particularly well-maintained.

--
Tony Arcieri

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Thanks Tony! Not the answer I was hoping for, but I get the point...

···

On 03/02/2016 12:09 AM, Tony Arcieri wrote:

On Tue, Mar 1, 2016 at 10:08 AM, Recursive Madman > <recursive.madman@gmx.de <mailto:recursive.madman@gmx.de>> wrote:

    I'm currently maintaining a modular ruby stack depending on
    MongoDB and want to rewrite some processes to run on EventMachine.

I would suggest avoiding EventMachine. It's complex, buggy, not idiomatic Ruby, and not particularly well-maintained.

--
Tony Arcieri

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

When possible, I'd suggest using threads, e.g. with Celluloid or
concurrent-ruby.

Celluloid also provides asynchronous IO:

···

On Wed, Mar 2, 2016 at 2:26 AM, Carlos Alonso <info@mrcalonso.com> wrote:

@Tony, Just out of curiosity, which evented library would you suggest
using in Ruby instead?