Hi,
Am 11.10.2012 um 09:25 schrieb Wujek Srujek:
> Hi. I've recently started using cyhper and I really like it and would like to introduce it to our (upcoming) application. I have a few question in this regard.
Thanks a lot.
> 1. Does it make sense to replace all traversals done with the API with cyhper queries? This is much more readable and much shorter and the expressiveness can not really be compared - cypher is a clear winner, so I would be tempted to use it everywhere. Are there gotchas?
It depends, by 1.8 cypher has not been performance optimized to be en par with traversals, for 1.9 we're working on that. Best is to compare the performance and use cypher wherever the difference is not critical.
> 2. As far as I know, although I cannot find it in the API, GraphDatabaseService instances are thread safe (is this correct?). How about the ExecutionEngine in java.compat? Can I just create a single instance of it and share between threads, or should I create multiple instances?
Yes it is thread-safe.
> 3. How does caching of queries look like? Do I need to do anything special, or does the engine cache things itself? If I have multiple threads and each has its own ExecutionEngine (if this is required, see above), this would mean I have a few caches. Can such caches be shared in some way (again, only if multiple engines are needed)?
Queries are cached by their query string in the execution-engine itself. So please use parameters to allow the engine to reuse already parsed queries. No need for separate execution-engines.
Please report back on your progress and if you ran into any issue.
HTH
Michael
>
> Regards,
> wujek
>
>
> --
>
>