novabyte / diver

A HBase driver for Erlang/Elixir using Jinterface and the Asynchbase Java client to query the database.
Apache License 2.0
49 stars 9 forks source link

Connecting via Apache Phoenix #2

Open alfredbaudisch opened 8 years ago

alfredbaudisch commented 8 years ago

I wonder if diver or at least its base code can be used to connect to Apache Phoenix?

Phoenix is basically a JDBC driver, but JDBC support for Erlang/Elixir seems lacking.

novabyte commented 8 years ago

The current design of the client is heavily tied to the Asynchbase HBase driver but the principles are essentially the same:

  1. Start a JVM instance over an Erlang port.
  2. Link and monitor it.
  3. The JVM instance started should communicate with the BEAM VM over a registered process.
  4. The registered process is used to send commands to the Java code.
  5. These commands could be anything but in this case it's commands to a Java-based driver.

Feel free to canablise the code as much as you need to put something together. I'd love to work on a driver for Apache Phoenix. It's actually something which could be essential to us at Heroic Labs but I can't promise any kind of timeframe.

alfredbaudisch commented 8 years ago

I'll look into that, thank you! Btw, Heroic Labs game backend solution uses HBase + diver?

novabyte commented 8 years ago

We don't use the current public version of the driver. We do use a lot of the communication code with other Java code which we needed to bridge between Erlang and Java. In fact I should probably see if I can refactor the bridge code into something more generic so it can be shared between projects.

alfredbaudisch commented 8 years ago

Awesome. I'm also working on a low latency application with Elixir and I'm still deciding between Cassandra and HBase, where what is holding me on the final decision are the Erlang/Elixir connectors. The Cassandra one seems to have performance issues, so I'll probably go with HBase + diver, or I'll try to implement an Apache Phoenix connector with the tips you provided above.

novabyte commented 8 years ago

@alfredbaudisch What sort of performance issues have you seen in the Cassandra driver? What sort of latency guarantees do you need with your application? Do you have hard realtime requirements?