What is the best alternative to Thrift API with Cassandra 3.X or AWS managed Cassandra? - spring

Thrift API seems to be no longer supported with higher versions of Cassandra as well as AWS managed Cassandra.
Could someone please let me know what would be the best alternate option to go with?
Our application is built on Spring framework, tightly coupled with Thrift based data models at this point. So, trying to understand if there is any similar API design that could be used. Our plan is to migrate the application to AWS and use managed Cassandra on AWS.

You should absolutely be using CQL. Modern versions of Spring [Boot|Data] use and work very well with the CQL native binary protocol.
Here's a repo we built with Spring Boot that uses Spring Data underneath for access to DataStax Astra DB (managed Serverless Cassandra-as-a-Service). It should be a decent guide for you to see how the repositories and data objects are annotated, built and used.
https://github.com/datastaxdevs/workshop-ecommerce-app

To add to Aaron's response, enterprises definitely needed to get off Thrift years ago. The drivers based on Thrift API have not been maintained for 5-7 years or more so it is a massive risk to your organisation to still be using it. For example, Nate McCall (who was the Cassandra project Chair until this year) retired the Hector client in 2015 in preference for CQL. Netflix did the same for Astyanax in 2016.
For a bit of background, CQL was introduced in Apache Cassandra 0.8 all the way back to 2011 (CASSANDRA-1703) as a replacement for Thrift. It quickly evolved to CQL2 in Cassandra 1.0.
Cassandra 1.2 added CQL3 in 2012 (CASSANDRA-3761) and support for CQL2 was dropped and replaced by CQL3 in C* 2.0 in 2013 (CASSANDRA-5585). C* 2.2 stopped using Thrift in 2015 (CASSANDRA-8358, CASSANDRA-9319).
5 years after CQL was first introduced, Cassandra 4.0 completely removed Thrift in 2016 (CASSANDRA-11115). This should convince any enterprise to migrate to CQL. There hasn't been support for the Thrift API for at least 6 years and this alone should motivate organisations to get off it.
CQL has been around for 10 years now so you shouldn't have any concerns with its maturity. Cheers!

Here is an example of using Amazon Keyspaces with Spring Boot. It uses CQL and the latest drivers. Although spring is suppose to be an abstraction, you will most likely need to refactor your code.
https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/java/datastax-v4/spring

Related

Are there any good alternatives to Apache Ignite as an In-Memory Data Grid used together with Spring as a distributed cache?

We have a solution which uses the Apache Ignite-provided In-Memory Data Grid as a distributed cache. For newer projects, we ended up using Spring, and as such we wished homogenize our software ecosystem and using Spring for the first solution as well. In addition, we do not use all the features of Ignite to excuse its use (discovery, caching).
Since we currently only use a limited subset of features from Ignite, we are basically looking for a self-managed application-level distributed cache solution (similar to what Ignite provides). This means that dedicated caching infrastructure like Redis, Memcached, etc. is not what we want.
I've researched the topic somewhat and found that there are some possible alternatives like:
Tayzgrid - Last update seems to be quite some time ago, not sure if still actively maintained
Druid - Still incubating, and I have also read that new releases being somewhat broken was not that uncommon
Hazelcast - Seems like the best choice given its maturity and the existence of Spring Data Hazelcast, though I am unsure what the level of support is here.
Has anyone has experience with integrating one of the above IMDGs (aside from Ignite) with Spring Cache? Any pointers in the right direction would be greatly appreciated.
You can use Redisson - Redis Java client with features of
In-Memory Data Grid. It also implements Spring Data support. Here is the documentation.
Hazelcast has official support for Spring Data Hazelcast and also this module has many users as now. I can also suggest you to have a look at the resources below:
Using Hazelcast with Spring Data
Getting Started with Microservices Using Hazelcast IMDG and Spring Boot

Making a simple invoice web app with Spring but which technologies is advisable?

I am going to teach myself some Java EE and making a simple web portal where people can generate their own invoices(pdf lib is needed). Not asking about any code but can you give advice (examples) which technologies I can make use of through the process? I have decided to use "Spring MVC" as the framework + java/Kotlin as a compiler. Some database + server + email+ some micro services?, are needed but which can it be? Thank you!
If you are trying to implement microservices, i prefer spring boot which has embedded tomcat with additional services, and for database you can use open source mysql
if you are also planning for UI stuff and new to it prefer basic Html,css and Bootstrap
If I am there here are my choices. All these choices are based on my past 4 complete end to end web application project experience.
Spring Boot
Using spring boot create micro services. As it has in built tomcat it will be easy to deploy any environment, either local laptop or on premise server or cloud server.
JPA with Hibernate
If you are looking for free you can choose MYSQL. As it has strong community support
almost all the issues you are going to face would have been asked and answered already under stack overflow or somewhere else in the internet. Another think is as you chose JPA you can switch to any database easily.
React
As of now the simplest and one of the fastest ui framework. Also it has strong user support. You can find answer to almost all questions you will have on internet.
Apart from all, you can extend any of these technologies. Happy Coding!!!
You may want to consider using Jaspersoft for generating your pdf files:
https://www.jaspersoft.com/reporting-software
https://community.jaspersoft.com/wiki/introduction-jaspersoft-studio
There may undoubtedly be other solutions out there, but this is the one I'm most used to.

Migrating from Apache Cassandra 2.2 to Oracle Coherence Oracle 12

I am looking for a migration path for a Java-based project which uses Apache Cassandra 2.2 to Oracle Coherence 12 – and Oracle 12 backend.
The existing application uses CQL to interact with a 3 node Cassandra cluster.
Elswhere we specifically do not use any ORM (e.g. Hibernate/JPA) but use JDBC to interact with the database directly.
Yes, Cassandra is free while the Oracle solution is quite expensive but this is outside the scope of this question.
Any technical suggestions are welcomed.
You have a couple of options depending on your use case.
If you are using the SQL to interact with Cassandra for standard request/response interactions and need to migrate it to use Oracle DB which would require the least code changes and still use a standard approach would be to use an Object Relational Mapping (ORM) tool like Hibernate/JPA and use Coherence as the L2 cache (personally I like MyBatis since you have complete control over the SQL code. You may be able to use this Coherence integration with MyBatis ).
If you have other applications/ops users updating the database directly and need those changes to be available to your application then you will need to implement a CacheStore (use your favorite ORM here if you like) to save updates to the database and use Oracle Golden Gate Hotcache feature to push updates made to the database outside your application to Coherence. Your application will need to be changed to interact with Coherence directly using either their Map interface or using the Coherence Query Language (CQL) which is "SQL like". This approach will have an additional advantage of being able to support any asynchronous use cases you may have as Coherence API supports listening to cache changes (using MapListeners) similar to Cassandra's executeAsync.
I hope this helps.

guava version conflict with HBase 1 and ES 2

I'm having a project using both HBase 1.0.0 (Cloudera version) and Elasticsearch. With the upgrade to ES 2.0 I'm experiencing a problem with guava version. ES 2.0 requires guava version 18.0, but Cloudera requires guava 14.0.1.
No matter what version I define in my dependency management in my parent pom one of the two won't work.
Looking around I see that this problem occurs quite some time (e.g. http://gbif.blogspot.co.at/2014/11/upgrading-our-cluster-from-cdh4-to-cdh5.html)
1) Any ideas on how to solve this problem without any complex re-design of my application?
If not, I'm thinking of doing all the ES-stuff in a separate application. Communicating via messaging (already using AMQ) for indexing. Not sure though how to communicate for search/filter requests (at the moment implemented via Java API).
2) Any other ideas?
3) Any ideas/hints on how to solve the communication issue?
I found this blog post when googling in combination with maven-shade plug-in, so this might be another option.
https://www.elastic.co/blog/to-shade-or-not-to-shade

Should I use Glassfish as an open source app server in the Enterprise to use with Spring or look at other options?

What is the best choice for an open source Enterprise-level application server when using Java 6 and Spring 3.1? Glassfish or JBOSS? Looking for good support e.g. online documentation, features, ease of use and set up, good performance, security, scalability, high availability features etc. that an enterprise would require. Enterprise being a large commercial or government client.
Are you using EJBs? If not, I would recommend jetty. jetty is a very light-weight container for doing most of the exploration/testing you would want to do in a project. Another plus that jetty delivers is that it is configured with only the most basic features enabled/configured by default.
Are you using Maven? If so, I would also recommend jetty-maven-plugin. In the past, I've had some success with using the jetty-maven-plugin for local testing on a previous project.

Resources