Choosing Apache Cassandra client - java

There is a bunch of different cassandra's clients in now days. Most of them was built on top of Thrift driver and then adopted to use DataStax Java driver. I can name Kundera and Astynax as biggest of them. The last one has only a beta support for the Java driver. And there is an Achilles client that build on top of DataStax Java driver and supports all new Cassandra features. It's a little bit younger and I know nothing of it's use cases in production. But it looks very promising.
So I'm new in NoSQL world ask you to give me a hint - with client to use with new project? Suppose it will be a big solution with 33 nodes Cassandra cluster and a lot of different kinds of queries to db.
Thank you in advance.

If the platform you're on has a client from DataStax, use that. The DataStax drivers for the jvm and .NET (and possibly others) are quite polished, support all available features, and deal with connection complexity internally very nicely. In addition, if you're looking to do Spark analytics, the DataStax Spark connector is the only option supporting good locality, and it uses the DataStax java driver internally.

Related

Migrating from Neo4J to DataStax Graph DB (DSE)

We have developed custom and proprietary Software for Route Optimization,
using Neo4J as our Graph DB. We also developed few plugins and unmanaged Extensions in Java, that implement specific Business Logic whenever search is done on the Graph. Since we are facing severe Performance Issues with Neo4J, we are considering to migrate our proprietary Software from Neo4J to DataStaX DSE 5.0 Graph. But would like to evaluate DSE Graph initially.
We have few specific questions
regarding Migration Path from Neo4J --> DataStax Graph DB
How to migrate data from Neo4J to DataStax Graph DB?
What are the changes we need to make in Neo4J Cypher Code in our Application so that it will work on DataStax DSE Graph DB?
We have developed some Plugins/Unmanaged Extensions in Neo4J using Java which have lots of core business rules incorporated into Neo4J. Our business logic code in Java gets called whenever Neo4J searches/traverses graph database. Does DataStax DSE Graph support something similar to plugins and/or unmanaged Extensions?
We would like to see what it takes to migrate our existing Neo4J Java code to DataStax DSE Graph code. We need to determine the level of effort would involved to do this exercise before we could be up and running on DataStax DSE Graph.
This might help: http://www.tinkerpop.com/docs/3.0.0.M1/#neo4j-gremlin
You can essentially connect to your Neo4J instance via the gremlin console, get the data you'd like, and write it out to a file that can be loaded into DSE Graph. That looks something like
graph.io(IoCore.gryo()).writeGraph("tinkerpop-modern.kryo");
See: http://www.tinkerpop.com/docs/3.0.0.M1/#gremlin-kryo
There's a lot to your question, especially around design, that can't be accurately answered in a StackOverflow post since a lot of it is specific to your use case. I suggest reaching out to DataStax directly for those questions, they'll be happy to help. That being said, I will be upfront with you, Neo4J and DSE Graph are very different systems. As such, you may have to rethink schema design as well as application code design.
If you're already familiar with Cassandra, that helps quite a bit around the architecture side. Even so, I do recommend checking out some of the free training around DSE Graph, specifically: https://academy.datastax.com/courses/ds330-datastax-enterprise-graph

How to get Java to access Cassandra 1.0.10

Can anyone recommend a good way to create scripts in java that will work with an older Cassandra 1.0.10 database? I'm having trouble finding stuff online. Is thrift a type of driver?
Thanks!
Apache Thrift is way to connect to the Cassandra RPC server 1).
In the Cassandra source three there is a file /interface/cassandra.thrift which is an interface description file (IDL) that can be fed to the Apache Thrift compiler in order to generate Java code. By means of this Java code you will be able to access Cassandra. The whole process is described in more detail in the Cassandra wiki.
However, it is recommended to use a more high-level client library instead, because the raw Cassandra API is quite complex. You'll find the existing libraries, such as Hector, much more handy for your task.
1) Some more details about Thrift can be found in this answer.

Tarantool Java Connector

Do you know a way to connect Java and the Tarantool key/value storage? On the Tarantool web-site I can see connectors for C, Ruby, PHP, etc., but no connector for Java.
I know that Tarantool supports the Memcached protocol (with a lot of Java clients for it), but I need a native Tarantool protocol connector for Java.
At this point a full-featured driver is ready, check out http://github.com/tarantool/tarantool-java
The other answer is slightly outdated, so I feel that this topic needs an update about the current situation.
There are two Java drivers present for Tarantool as of 2021:
An "old" tarantool-java, marked as deprecated, since it does not support vShard cluster, Cartridge, Tarantool 2.x+ features like new UUID and decimal types, has some problems with API and architecture and is out of maintenance for a long time. However, as of now, it's the one that supports JDBC interface, so you may choose it for connecting to a single Tarantool node via JDBC.
A "new" cartridge-java, which is currently actively developed and maintained, and provides a foundation for other necessary connector modules like cartridge-springdata and cartridge-spark. This driver uses Netty for the transport layer, the official MsgPack library for serialization, and provides support for single Tarantool nodes, vShard cluster, Cartridge and new Tarantool 2.x+ features. This driver is compatible with 1.10 Tarantol series too.
So, for all cases except JDBC for a single Tarantool node (currently), I'd recommend using cartridge-java.

How to start developing a database application using Oracle + Net Beans

I have thought of creating my first database application for one of my projects using Oracle and Java. I have chosen Netbeans as my development environment. I have a few questions to getting started.
This will be a data intensive (yet still for a college project) database application. I do not need 1000 user concurrency or any other very advanced features but basic stuff such as triggers, stored procedures etc. Will the 11g "Express" (XE) suffice for my requirements?
Do i need any Java to Oracle bridge (database connectivity driver eg. ODBC etc) for Netbeans to connect to the oracle database? If yes, what are they? Does Netbeans support Oracle databases natively?
Any easy to follow guide on how do I connect to the database and insert/retrieve/display data on a J2SE application? (I know that i should Google this but if there's any guide previously followed by anyone and is considered easy, it would be greatly appreciated.)
There are several different ways to access databases using Java. I'm assuming you are wanting to use JDBC, which is included in all recent JDK's. There are other layers on top of JDBC like Hibernate that may make things cleaner for larger applications, but may also be too steep a learning curve if you have a project to complete and submit.
To answer your questions in order:
I think it's highly likely that Oracle 10g Express Edition will do what you need for a college project. It's pretty much the 10g Standard Edition with a 4GB limit on data size.
You will need a JDBC driver to access the database from Java. It comes with XE, and is installed in <XE client install dir>/jdbc/lib/ojdbc14.jar
Sun have an introduction to JDBC here.

Is there a "best" or most popular database for standalone Java app?

Is there a "best" or more popular database for standalone Java app?
I'm currently writing by hand, but I would like to know what is commonly done, if there is something that is commonly done.
update: talking about small app (may grow, but its small for now)
I would suggest using something like SQLite with SQLiteJDBC.
It also sounds like HyperSQL and Derby (which ships with certain Java versions) are popular choices.
Java 6 ships with Derby (renamed JavaDB). It can be used in memory or server mode.
HyperSQL (HSQLDB) is also popular.
For development purposes, I often use the Hypersonic SQL Database (HSQLDB). It's fast and lightweight, and good enough to get started.
For a bigger application, I'd go for Derby, which supports more options.
The main competitors - HyperSQL (HSQLDB), JavaDB (Derby) and SQLite (not java-based) were mentioned.
There are a few other options:
db4o - object database
FirebirdSQL - not java-based.
Jackrabit - a content repository (not RDBMS) supporting embedded mode.
HSQLDB is a well-established option.
JavaDB comes with the development kit
apart all those mentioned here, one can also go for H2 database which is light and can be used in-memory or in server mode.
For a SQL option, you could try MySQL, SQL Server, PostgreSQL, or Oracle. Those seem to be the most popular among Java developers.
If you want something NoSQL, MongoDB is the most popular choice with Java developers based on StackOverflow data from 2022.
You can find more information on the metrics used to make that determination in this article.

Categories

Resources