Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
cypher in java - a few questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Wujek Srujek  
View profile  
 More options Oct 11 2012, 3:25 am
From: Wujek Srujek <wujek.sru...@gmail.com>
Date: Thu, 11 Oct 2012 09:25:36 +0200
Local: Thurs, Oct 11 2012 3:25 am
Subject: cypher in java - a few questions

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.
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?
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?
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)?

Regards,
wujek


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Oct 11 2012, 3:30 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 11 Oct 2012 09:29:53 +0200
Local: Thurs, Oct 11 2012 3:29 am
Subject: Re: [Neo4j] cypher in java - a few questions
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wujek  
View profile  
 More options Oct 11 2012, 3:37 am
From: wujek <wujek.sru...@gmail.com>
Date: Thu, 11 Oct 2012 00:37:41 -0700 (PDT)
Local: Thurs, Oct 11 2012 3:37 am
Subject: Re: [Neo4j] cypher in java - a few questions

Hi. At this point, I am not concerned at all about the performance of the
application - we need to have something quickly and working, tuning will be
done later, if at all necessary. If this means replacing certain cypher
queries with traversal, so be it - but for now, functionality and time to
market is more important, and here cypher cannot be beaten, I think ;d
How much a performance penalty would you expect, if any, based on your
experience? Twice as slow, 10x as slow? I'm asking as what we are trying to
build is a webapp, and if the penalty is somewhere around 2x, it doesn't
really matter, at least I think so now. When there is nothing more to do
(ha!) and we are bored, we might fine tune it even when not necessary ;d

Thanks for the info about the engine - it is very nice that I don't have to
take care about these things myself.

Regards,
wujek


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »