Hazelcast JCache predicate - hazelcast

Previously I used Hazelcast Java API and was able to do predicate to filter on result return.
Currently, as we are moving towards portability of IMDG, I used JCache API. However, i did not manage to find anything related that will allow me to do predicate/filtering/searching on IMDG cache.
Have anyone done similar thing before?

JCache does not have any Query API. If you used the IMap you would get the same features as in JCache plus Querying.

Related

jCache providers features

So i'm going to use jCache implementation for my J2EE application java 8 and i want to know what is the difference between all the providers and all its features.
Hazecast
ehcache
infinispan
can anyone help me to choose one of them ( in terms of cluster support, easy to use, performance ...) ?
JCache is a specification, so that all implementations behave in the same way regarding the caching features.
However, a key differentiator to evaluate the products is whether you want the cache to be distributed or not. The Open Source version of Hazelcast is distributed, this is not the case for EhCache.
Disclaimer: I work for Hazelcast.

DataStax Graph Native API vs Fluent API

i have tried both the native api and fluent api for datastax graph in java.
i found fluent api more readable since it resembles java's OOP.
Native api has less readability in java since basically strings are being appended to create the entire gremlin script. but on the plus side a single call is made to execute the entire gremlin script
i wanted to know which is the best api to go with in case i need to add a large number of edges and vertices in one transaction and what are the performance issues which can occur in either case
Going forward I would recommend using the Fluent API over the String-based API. While we still support the string-based API in the DataStax drivers, most of our work and improvements will be using the fluent API.
The primary benefits of the Fluent API is that you can use the Apache TinkerPop library directly to form Traversals, it doesn't need to go through the groovy scripting engine (like the String-based API does).
In terms of loading multiple vertices/edges in one transaction, you can do that with Apache TinkerPop, and it will be much more effective than the String-based API because that all doesn't need to be evaluated through the gremlin-groovy engine. Also any future work around batching will likely be done in the Fluent API (via Apache TinkerPop), see JAVA-1311 for more details.

Why is there no built-in HashMapStreamSerializer in Hazelcast?

The Hazelcast documentation provides examples of how we can write our own LinkedListStreamSerializer and HashMapStreamSerializer and it says that support will be added for these in the future.
It looks as though the LinkedListStreamSerializer is in fact supported now, which is great, but not the HashMap one.
I'm wondering if there is any reason why not and should I be concerned about continuing to use the example one from the documentation.
You should be fine with the HashMapStreamSerializer.
It's now tricky to add a new serializer into Hazelcast due backward compatibility - as older clients wouldn't be able to deserialize blobs serialized with the new serializer.

Does Hazelcast support JSON-based objects in cache?

As in the topic: I can't find any good information whether Hazelcast can support storing JSON objects as cache data? If so does it allow to query such objects basing on some JSONPath/JPQL/SQL-like expressions?
I can see that Apache Geode (GemFire) does support such functionality: http://geode-docs.cfapps.io/docs/developing/data_serialization/jsonformatter_pdxinstances.html and I am wondering if the big rival can do the same.
A JSON support has been added in Hazelcast 3.12: https://docs.hazelcast.org/docs/latest/manual/html-single/#querying-json-strings
You can checkout the merged pull request: https://github.com/hazelcast/hazelcast/pull/14307
In Hazelcast 3.6 you have custom extractors -> You could have a JSON extractor and then use in queries. See https://github.com/hazelcast/hazelcast-code-samples/tree/master/distributed-map/custom-attributes as an example.
Hazelcast doesn't have out of the box support for JSON.

datastax driver vs spring-data-cassandra

Hey I am new to Cassandra and I am friendly with Spring jdbc-template.
Can anyone please explain difference between both of them? Also can you suggest which one is good to use ?
thanks.
spring-data-cassandra uses datastax's java-driver, so the decision to be made is really whether or not you need the functionality of spring-data.
Some features from spring data that may be useful for you (documented here):
spring xml configuration for configuring your Cluster instance (especially useful if you are already using spring).
object mapping component.
The java-driver also has a mapping component as well that is worth exploring.
In my opinion if you are already using spring, it is worth looking into spring-data-cassandra. Otherwise, it would be good to start off with just the datastax java-driver.

Resources