Re: [Neo4j] java.lang.OutOfMemoryError: PermGen space

2011-08-12 Thread Tatham Oddie
messages.log extract available here: 
http://dl.dropbox.com/u/5216304/20110812-neo4j-messages.log


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Tatham Oddie
Sent: Friday, 12 August 2011 3:57 PM
To: Neo4j user discussions (user@lists.neo4j.org)
Subject: [Neo4j] java.lang.OutOfMemoryError: PermGen space

Howdy,

We've started experiencing reasonably consistent java.lang.OutOfMemoryError 
exceptions.

We're using neo4j-community-1.4.M04-windows.zip, running on Windows 7 x64 for 
development + Windows Azure for production.

Graph access is exclusively via REST. We perform basic CRUD operations and 
Gremlin queries.

The server spins up like so:

12/08/11 2:39:43 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
Starting Neo Server on port [5102] with [80] threads available
12/08/11 2:39:43 PM org.neo4j.server.database.Database INFO: Using database 
at C:\AzureTemp\neo4j-db
12/08/11 2:39:47 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted 
discovery module at [/]
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
server plugin CypherPlugin
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
server plugin GremlinPlugin
12/08/11 2:39:48 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted 
REST API at [/db/data/]
12/08/11 2:39:48 PM org.neo4j.server.modules.ManagementApiModule INFO: 
Mounted management API at [/db/manage/]
12/08/11 2:39:48 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted 
webadmin at [/webadmin]
12/08/11 2:39:48 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting 
static content at [/webadmin] from [webadmin-html]
12/08/11 2:39:50 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
Server started on [http://192.168.10.151:5102/]

Then, after a relatively small number of queries (sub 500? still confirming 
more details), we get this:

Exception in thread RMI RenewClean-[192.168.10.151:31174] 
java.lang.OutOfMemoryError: PermGen space
Exception in thread Statistics Gatherer java.lang.OutOfMemoryError: 
PermGen space

Java.exe is still running, and consuming around 180MB of RAM (with another 3GB 
of physical memory still available on the system). REST API returns 500s and 
the WebAdmin is unavailable.

My questions:

1) Is this just that we've got a configuration setting wrong? In my very 
limited knowledge of Java, I know we can reconfigure the size, but this seems 
to indicate a potentially larger issue.

2) What should I do to gather more information to help diagnose this?


--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie If you're 
printing this email, you're doing it wrong. This is a computer, not a 
typewriter.

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] java.lang.OutOfMemoryError: PermGen space

2011-08-12 Thread Michael Hunger
please update to 1.4.1 the this goes away

and change your gremlin queries to use variables instead of concatenating 
values into the query string

thanks
Michael

mobile mail please excuse brevity and typos

Am 12.08.2011 um 07:56 schrieb Tatham Oddie tat...@oddie.com.au:

 Howdy,
 
 We've started experiencing reasonably consistent java.lang.OutOfMemoryError 
 exceptions.
 
 We're using neo4j-community-1.4.M04-windows.zip, running on Windows 7 x64 for 
 development + Windows Azure for production.
 
 Graph access is exclusively via REST. We perform basic CRUD operations and 
 Gremlin queries.
 
 The server spins up like so:
 
12/08/11 2:39:43 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
 Starting Neo Server on port [5102] with [80] threads available
12/08/11 2:39:43 PM org.neo4j.server.database.Database INFO: Using 
 database at C:\AzureTemp\neo4j-db
12/08/11 2:39:47 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted 
 discovery module at [/]
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
 server plugin CypherPlugin
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
 server plugin GremlinPlugin
12/08/11 2:39:48 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted 
 REST API at [/db/data/]
12/08/11 2:39:48 PM org.neo4j.server.modules.ManagementApiModule INFO: 
 Mounted management API at [/db/manage/]
12/08/11 2:39:48 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted 
 webadmin at [/webadmin]
12/08/11 2:39:48 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting 
 static content at [/webadmin] from [webadmin-html]
12/08/11 2:39:50 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
 Server started on [http://192.168.10.151:5102/]
 
 Then, after a relatively small number of queries (sub 500? still confirming 
 more details), we get this:
 
Exception in thread RMI RenewClean-[192.168.10.151:31174] 
 java.lang.OutOfMemoryError: PermGen space
Exception in thread Statistics Gatherer java.lang.OutOfMemoryError: 
 PermGen space
 
 Java.exe is still running, and consuming around 180MB of RAM (with another 
 3GB of physical memory still available on the system). REST API returns 500s 
 and the WebAdmin is unavailable.
 
 My questions:
 
1) Is this just that we've got a configuration setting wrong? In my very 
 limited knowledge of Java, I know we can reconfigure the size, but this seems 
 to indicate a potentially larger issue.
 
2) What should I do to gather more information to help diagnose this?
 
 
 --
 Tatham Oddie
 au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie
 If you're printing this email, you're doing it wrong. This is a computer, not 
 a typewriter.
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Indexing - Rest Api

2011-08-12 Thread Romiko Derbynew
Hi,

I am planning to extend the .Net client that we use for CRUD operation and now 
add indexing support. I am keen to go the route of AutoIndexing, so we just 
query the index and it automatically gets create. Just a few questions.

*   Configuration File: Autoindexing enabled here is related to 
automatically indexing all nodes and relationships?
*

If I want to add a node to an index following the guidelines, what convention 
should be used for the Key/Value naming? Imagine we have nodes of type 
Customers, and we have 1 customers, what sort of key/value would we set for 
each customer, as I would guess that all properties are indexed for the node? 
Would it be perhaps a unique auto increment number for example that is in no 
way related to the data node?
e.g.
Example request
*

POST http://localhost:7474/db/data/index/node/favorites/key/the%20value
*   Accept: application/json
*   Content-Type: application/json
http://localhost:7474/db/data/node/0

*   Also, how can we control the properties/fields to index when we add a 
node to an index with the RestApi, I would imagine we would not want to index 
all fields on a node via the auto indexing feature?

Our plan is to use Lucene Search Queries so we can do funzzy searches, however, 
we would like to leverage autoindexing but have the option to choose exactly 
what fields we want to index on a node when we add nodes to indexes.

Thank You.

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] some questions : unique property and Rest

2011-08-12 Thread Michael Hunger

 1.Does Neo4J support *unique property*  (Node/Relationship)?

Right now there is no native support for that, you have to implement it on your 
own - define the properties that are unique and then write an getOrCreateNode 
method and/or endpoint that exposes the following things:
- query the index for the property
- if it returns something return it
- open tx
- grab write lock on a dedicated lock node (e.g. by removing an non-existing 
property)
- query the index for the property
- if it returns something return it
- if not create the node and add it to the index
- close tx

It might be added to Neo4j at a later time in the form of a unique index type 
(or differently).

 2.How can I wrap a Node in a MyClass and using it with Rest services?

what do you mean by with rest-services ? 
If you mean something like object graph mapping in the server - you might the 
existing language bindings to map objects to the graph using unmanaged 
extensions (Spring Data Graph, jo4neo) or the (J)ruby-script-extensions 
(neo4j.rb).

 3.Can I use in MyClass some JPA annotaions?
So if you want to have some cross-store persistence (graph + JPA) then you 
should look into Spring Data Graph as this supports that mode explicitely.


Cheers

Michael
 
 shlomib
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/some-questions-unique-property-and-Rest-tp3248352p3248352.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] neo4j spatial and postgis

2011-08-12 Thread chen zhao
Hi,

I very interested in neo4j spatial . but I do not know how to import the
spatial data.

My data are stored in postgis. I read the document 
http://wiki.neo4j.org/content/Spatial_Data_Storage; and 
http://wiki.neo4j.org/content/Importing_and_Exporting_Spatial_Data,but I
yet do not know to to import data from postgis or import shapfiles.

Could you provide some detail information?

Please advice.

zhao
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Database error

2011-08-12 Thread sometime
After I installed the base (1.4 community) - I felt it necessary to fill
existing data (users of the system and relations between them). Total users
about 1.6 million and 4.5 million links. 
I wrote a robot, using REST-requests and creates the necessary link between
the top two. 
After I ran it and measured the rate of filling databases - according to my
calculations, the robot had to work 2-3 days. That suits me and I left it
running. 
But after about 4 hours, when the copy already around 200 000 relations -
error occurred and the database is not working.
Here's from the log:

8/8/11 3:02:54 PM org.neo4j.server.NeoServerBootstrapper INFO: Neo4j Server
shutdown initiated by kill signal
Unable to close logical log
java.io.FileNotFoundException:
/path_to_neo4j/data/graph.db/nioneo_logical.log.active (No such file or
directory)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.init(Unknown Source)
at java.io.RandomAccessFile.init(Unknown Source)
at
org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.setActiveLog(XaLogicalLog.java:1478)
at
org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.close(XaLogicalLog.java:692)
at
org.neo4j.kernel.impl.transaction.xaframework.XaContainer.close(XaContainer.java:109)
at
org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.close(NeoStoreXaDataSource.java:248)
at
org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource.stop(NioNeoDbPersistenceSource.java:69)
at org.neo4j.kernel.GraphDbInstance.shutdown(GraphDbInstance.java:293)
at
org.neo4j.kernel.EmbeddedGraphDbImpl.shutdown(EmbeddedGraphDbImpl.java:349)
at
org.neo4j.kernel.EmbeddedGraphDatabase.shutdown(EmbeddedGraphDatabase.java:125)
at org.neo4j.server.database.Database.shutdown(Database.java:111)
at
org.neo4j.server.NeoServerWithEmbeddedWebServer.stopDatabase(NeoServerWithEmbeddedWebServer.java:275)
at
org.neo4j.server.NeoServerWithEmbeddedWebServer.stop(NeoServerWithEmbeddedWebServer.java:226)
at org.neo4j.server.Bootstrapper$1.run(Bootstrapper.java:157)
8/8/11 3:02:57 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO:
Starting Neo Server on port [7474] with [40] 

threads available
8/8/11 3:02:57 PM org.neo4j.server.database.Database INFO: Using database at
/path_to_neo4j/data/graph.db
8/8/11 3:02:59 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted
discovery module at [/]
8/8/11 3:02:59 PM org.neo4j.server.plugins.PluginManager INFO: Loaded server
plugin CypherPlugin
8/8/11 3:02:59 PM org.neo4j.server.plugins.PluginManager INFO: Loaded server
plugin GremlinPlugin
8/8/11 3:02:59 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted REST
API at [/db/data/]
8/8/11 3:02:59 PM org.neo4j.server.modules.ManagementApiModule INFO: Mounted
management API at [/db/manage/]
8/8/11 3:02:59 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted
webadmin at [/webadmin]
8/8/11 3:02:59 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting static
content at [/webadmin] from [webadmin-html]
8/8/11 3:03:01 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO:
Server started on [http://our_site:7474/]
8/8/11 3:04:46 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO:
Starting Neo Server on port [7474] with [40] 
threads available
8/8/11 3:04:46 PM org.neo4j.server.database.Database INFO: Using database at
/path_to_neo4j/data/graph.db
8/8/11 3:04:46 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted
discovery module at [/]
8/8/11 3:04:47 PM org.neo4j.server.plugins.PluginManager INFO: Loaded server
plugin CypherPlugin
8/8/11 3:04:47 PM org.neo4j.server.plugins.PluginManager INFO: Loaded server
plugin GremlinPlugin
8/8/11 3:04:47 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted REST
API at [/db/data/]
8/8/11 3:04:47 PM org.neo4j.server.modules.ManagementApiModule INFO: Mounted
management API at [/db/manage/]
8/8/11 3:04:47 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted
webadmin at [/webadmin]
8/8/11 3:04:47 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting static
content at [/webadmin] from [webadmin-html]
8/8/11 3:04:48 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO:
Server started on [http://our_site:7474/]
8/8/11 3:24:31 PM org.neo4j.server.NeoServerBootstrapper INFO: Neo4j Server
shutdown initiated by kill signal
8/8/11 3:24:33 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO:
Starting Neo Server on port [7474] with [40] 
threads available

etc. - The same errors
but after 20 minutes have gone there are errors (strange errors):

8/11/11 1:39:43 AM org.neo4j.server.rrd.ScheduledJob WARNING: 
java.lang.IllegalArgumentException: Bad sample time: 1313012383773. Last
update time was 1313012383773, at least one 
second step is required
at org.rrd4j.core.RrdDb.store(Unknown Source)
at org.rrd4j.core.Sample.update(Unknown Source)
at 

Re: [Neo4j] Database error

2011-08-12 Thread Jim Webber
Did your robot use the REST batch API or the normal REST API?

Jim
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Enhanced API wiki page

2011-08-12 Thread Niels Hoogeveen





Hi Peter,

I have given your criticism that the API is too heavy to grasp some more 
thought.

I do agree with your assessment that it is heavy to grasp, but don't really 
know how to make it simpler. 
N-ary edges (Hyperrelationships) are complex beasts compared to Relationships 
as defined in the standard Neo4j API. 
In another post I already showed how BinaryEdge, as a one-on-one mapping of 
Relationship in standard Neo4j API, 
is only one of 16 possible two-sided Edges. 

This added complexity automatically translates into having to deal with more 
classes. 

Instead of just Nodes, Relationships and RelationshipTypes, we now have to deal 
with: 
Vertices, Edges, EdgeTypes, Connectors and ConnectorTypes. 

For the n-ary case, there is no other way to deal with this. Of course we could 
give things a different name, 
as I have done a couple of times now, but no matter how you slice it, when you 
want to create an n-ary edge, 
you will have to provide the vertices to connect. 
Not only do you have to provide these vertices, it is also imperative you tell 
where on the edge to place those vertices.

This is relatively simple in the case of a BinaryEdge, where we use the method 
Vertex#createEdgeTo(Vertex, RelationshipType). 
We only have two Vertices we want to add to the Edge, one of them connecting to 
the StartConnector, 
the other connecting to the EndConnector. So in this particular case the choice 
of Connector can be  made implicitly. 

With arities  2 no such implicit choice of Connector can be made, and with 
that the entire machinery comes into play. 
We will need something akin to EdgeType, because that determines the type of 
Connectors available to an Edge. 
We need something akin to a Connector, otherwise we don't know were on the Edge 
to create a connection. 
We also need something akin to an EdgeElement, otherwise we can't create an 
Edge in a legal state. 
I don't think it's smart to allow the user to create a ternary edge, where only 
one or two sides are connected, 
just like it's not allowed to create a Relationship in the standard API with 
one dangling side.

I am totally open to renaming things, but I don't think it is possible to 
really reduce the number of entities involved. 
As to the names chosen: Connection, Connector, ConnectorType and ConnectionMode 
follows a neat pattern. 
There is a Connection, something between a Vertex and an Edge, which is made to 
a Connector on that Edge. 
That connector has a type, which defines the Mode of that connector/connection. 
Initially Connector was named EdgeRole, but that didn't allow the same naming 
pattern. 
It's possible to have EdgeRole, EdgeRoleType and EdgeRoleMode, but there is no 
proper variation on the word EdgeRole 
that can be used for the denotation of the connection between a Vertex and an 
Edge.

Instead of Connection, Connector, ConnectorType, ConnectorMode, 
we could use Association, Associator, AssociatorType, AssociatorMode, but I 
don't know if that makes things simpler.

The term EdgeElement is not all the descriptive and I am very much open to 
suggestions for a better name. 
It's a class we need when creating n-ary edges. There needs to be some method 
that creates an Edge, 
which should have a signature: createEdge(EdgeType, 
SomethingThatAssociatesVerticesWithAConnectorType...);

I have chosen the name EdgeElement instead of 
SomethingThatAssociatesVerticesWithAConnectorType, 
but I am not all that happy with that name either. 

Altogether, n-ary edges are more general than Relationships and with that users 
of the API 
need to get acquainted with a couple of more concepts that are left implicit 
with standard Relationships. 
It's simply impossible to generalize Relationships to n-ary edges without 
revealing the underlying complexity.

The Wiki page as I have set up now, may need to do more explaining of concepts. 
It may be that I moved too quickly, that's the down-side of a one-man-project. 
Things that have become self-evident to me over time may be difficult to grasp 
for someone new to this model.  
So, if there are people that see value in having support for n-ary edges in an 
API on top of Neo4j, 
please help me out with some of the documentation. A fresh look on things may 
be helpful to explain things better.

Niels
 From: peter.neuba...@neotechnology.com
 Date: Thu, 11 Aug 2011 20:46:59 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Enhanced API wiki page
 
 Nils,
 interesting approaches! However, IMHO the API is still too heavy to
 grasp with ConnectorType, EdgeElement, EdgeType and Edge being
 involved in creating connections between facts. Is anyone seeing a
 more fluent/concise approach to this?  Also, did you have some ideas
 about how to traverse or query these hyperedges?
 
 Cheers,
 
 /peter neubauer
 
 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer
 
 

[Neo4j] LMAX Disruptor Concurrency Model

2011-08-12 Thread McKinley
I wanted to bring this article the attention of Neo4j engineers. I'm sure
many of you have already seen it. The LMAX concurrency system seems to have
a few peculiar limitations, but also very specific attention to real
hardware limitations. Perhaps their approach to concurrency might have some
benefit for Neo4j.

http://martinfowler.com/articles/lmax.html

http://code.google.com/p/disruptor/

Thanks,

McKinley
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Heroku Beta: Neo4j - A Rails Example?

2011-08-12 Thread Michael Hunger
The point is: You don't want to run your webapp in your database.

A customer facing rails3 app is an webapp with lots of javascript, UI, images, 
views etc which also has to be scaled to many instances.

On the other hand it needs data to work with. The source of the data is a 
database in this cause a graph database.

But it is much better to talk to your database in terms of your domain (e.g. 
users, blog posts comments) instead of nodes and relationships. So you 
basically cut of that lower layer that talks directly to the graph database 
(and which is very performance sensitive) and move it over to the db. 

Then you can define the typical use-cases you need for your webapp to render a 
page and have the domain level endpoints in your database server that provide 
the _domain level_ data for this rendering process in this granularity and size.

HTH

Michael

P.S: And without a frontend (just having the user management system-domain 
model running on the graph) (in the neo4j-server in our case) doesn't help you 
because you don't have to show anything to anyone (no UI).
Am 12.08.2011 um 22:02 schrieb Sasha Agafonoff:

PPS: I move this discussion to the users list as others probably want to chime 
in.


 Hi Michael,
 
 Thanks for your email!  I am keen to use neo4j.rb rather than neography.  The 
 process set out in your example for setting up a back-end neo4j server on 
 Heroku seems pretty straightforward, and I think I understand how I can 
 define domain models and deploy them that way.  I think with a bit of effort 
 I could work out how to build something as a Rails front end to work with 
 this, but with my limitations as a coder I don't think I'll do a fantastic 
 job of it.
 
 Where I'm struggling is in understanding why I'd need to write two separate 
 apps (backend-frontend) and not be able to write a single app built in the 
 same way as the Rails Project Template 
 (http://neo4j.rubyforge.org/guides/rails3.html) that Andreas has made 
 available on GitHub.  Using that template, I could get rolling with a user 
 management system and domain model very quickly.  
 
 Andreas: not sure if you have any suggestions about bridging this gap?  Maybe 
 I'm missing something simple...? 
 
 Cheers, Sasha
 
 On 11 August 2011 18:27, Michael Hunger michael.hun...@neotechnology.com 
 wrote:
 Sasha,
 
 our rails(3) experience is rather limited. We can ask Andreas if he can come 
 up with something, but I can't make any promises.
 
 On the frontend web-app side you're free to do whatever rails stuff you want 
 anyway.
 
 On the server side we'd like to encourage really tight, persistence centric 
 REST-applicaitions that talk on a domain level to the frontend-webapp that 
 runs on Heroku.
 
 So for a backend rails-REST-app it would perhaps best to look for a good 
 rails3-REST-App example and create something similar, just that it uses 
 neo4j.rb instead of the built-in ActiveRecord for persistence. 
 Expose useful domain level endpoints to the frontend webapp and use that one 
 to drive the persistence layer running in the Neo4j Server.
 
 If you don't want to use server-side JRuby code, you're limited to a wrapper 
 like neography for the interaction with the graph database.
 
 If you'd like to invest time and effort we would be more than happy to 
 integrate it (with attribution) into the documentation.
 
 Thanks for your suggestions.
 
 Michael
 
 P.S. have you seen the general rails3 docs for heroku, I haven't looked into 
 them that much, so I don't know how much one could borrow from there.
 
 
 Am 12.08.2011 um 00:18 schrieb Sasha Agafonoff:
 
 Hiya,
 
 I'm really pleased to see support kicking off for neo4j on heroku - it's got 
 me interested in picking up my old peoplemap project and doing a full Rails 
 3-based reboot with the latest version of Andreas' neo4j.rb library.  I've 
 joined the beta program, but I'm finding the learning curve pretty 
 challenging...
 
 The documentation at http://devcenter.heroku.com/articles/neo4j is really 
 awesome, but it's all centered around two Sinatra-based approaches to 
 accessing the heroku-hosted neo4j instances.  The big challenge for me is in 
 working out how to take this (very fine) material and translate it into a 
 Rails 3 context.  
 
 I will be the first to admit to many limitations as a coder (possibly due to 
 too many years wasted in sales) but I suspect that there will/may be 
 others... :-)
 
 Any chance of getting even a very simple Rails 3 example up on this page as 
 well?  I think that with just a little more guidance in how to get something 
 configured and running, I could probably go and build something a bit more 
 developed that could contribute to the beta program and advancing neo4j more 
 generally!
 
 Cheers, Sasha

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user



Re: [Neo4j] Heroku Beta: Neo4j - A Rails Example?

2011-08-12 Thread Michael Hunger
Sasha you can clone the example github repo (that's also mentioned in the docs):

https://github.com/tbaum/script-extension-example

Remove the .git directory and add it as a new repo to your github account.

Feel free to change whatever you'd like (Gemfile, code, whatever).

Michael

Am 12.08.2011 um 23:00 schrieb Sasha Agafonoff:

 Hi Michael,
 
 That's all very helpful and makes a huge amount of sense.  Thanks very much 
 for committing your time to replying - I appreciate you making the effort!
 
 I'd be really grateful for any suggestions from the group/list as to getting 
 started on writing a Rails 3 front end to leverage the backend database.  
 Perhaps if anyone else has started using the Heroku Add-on and they are able 
 to do so, they could share a basic template (perhaps on GitHub) so I could 
 get a better sense of how to get the plumbing working... :-)
 
 Cheers, Sasha
 
 On 12 August 2011 16:31, Michael Hunger michael.hun...@neotechnology.com 
 wrote:
 The point is: You don't want to run your webapp in your database.
 
 A customer facing rails3 app is an webapp with lots of javascript, UI, 
 images, views etc which also has to be scaled to many instances.
 
 On the other hand it needs data to work with. The source of the data is a 
 database in this cause a graph database.
 
 But it is much better to talk to your database in terms of your domain (e.g. 
 users, blog posts comments) instead of nodes and relationships. So you 
 basically cut of that lower layer that talks directly to the graph database 
 (and which is very performance sensitive) and move it over to the db. 
 
 Then you can define the typical use-cases you need for your webapp to render 
 a page and have the domain level endpoints in your database server that 
 provide the _domain level_ data for this rendering process in this 
 granularity and size.
 
 HTH
 
 Michael
 
 P.S: And without a frontend (just having the user management system-domain 
 model running on the graph) (in the neo4j-server in our case) doesn't help 
 you because you don't have to show anything to anyone (no UI).
 Am 12.08.2011 um 22:02 schrieb Sasha Agafonoff:
 
 PPS: I move this discussion to the users list as others probably want to 
 chime in.
 
 
 Hi Michael,
 
 Thanks for your email!  I am keen to use neo4j.rb rather than neography.  
 The process set out in your example for setting up a back-end neo4j server 
 on Heroku seems pretty straightforward, and I think I understand how I can 
 define domain models and deploy them that way.  I think with a bit of effort 
 I could work out how to build something as a Rails front end to work with 
 this, but with my limitations as a coder I don't think I'll do a fantastic 
 job of it.
 
 Where I'm struggling is in understanding why I'd need to write two separate 
 apps (backend-frontend) and not be able to write a single app built in the 
 same way as the Rails Project Template 
 (http://neo4j.rubyforge.org/guides/rails3.html) that Andreas has made 
 available on GitHub.  Using that template, I could get rolling with a user 
 management system and domain model very quickly.  
 
 Andreas: not sure if you have any suggestions about bridging this gap?  
 Maybe I'm missing something simple...? 
 
 Cheers, Sasha
 
 On 11 August 2011 18:27, Michael Hunger michael.hun...@neotechnology.com 
 wrote:
 Sasha,
 
 our rails(3) experience is rather limited. We can ask Andreas if he can come 
 up with something, but I can't make any promises.
 
 On the frontend web-app side you're free to do whatever rails stuff you want 
 anyway.
 
 On the server side we'd like to encourage really tight, persistence centric 
 REST-applicaitions that talk on a domain level to the frontend-webapp that 
 runs on Heroku.
 
 So for a backend rails-REST-app it would perhaps best to look for a good 
 rails3-REST-App example and create something similar, just that it uses 
 neo4j.rb instead of the built-in ActiveRecord for persistence. 
 Expose useful domain level endpoints to the frontend webapp and use that one 
 to drive the persistence layer running in the Neo4j Server.
 
 If you don't want to use server-side JRuby code, you're limited to a wrapper 
 like neography for the interaction with the graph database.
 
 If you'd like to invest time and effort we would be more than happy to 
 integrate it (with attribution) into the documentation.
 
 Thanks for your suggestions.
 
 Michael
 
 P.S. have you seen the general rails3 docs for heroku, I haven't looked into 
 them that much, so I don't know how much one could borrow from there.
 
 
 Am 12.08.2011 um 00:18 schrieb Sasha Agafonoff:
 
 Hiya,
 
 I'm really pleased to see support kicking off for neo4j on heroku - it's 
 got me interested in picking up my old peoplemap project and doing a full 
 Rails 3-based reboot with the latest version of Andreas' neo4j.rb library.  
 I've joined the beta program, but I'm finding the learning curve pretty 
 challenging...
 
 The documentation at