Python and graph database. Use java lib wrapper or REST api?

别说谁变了你拦得住时间么 提交于 2019-12-11 00:34:42

问题


I want to ask you about the best way to use graph database (Neo4j) in Python. What you think, should I use "neo4j/python-embedded" (neo4j/python-embedded with JPype) or maybe "bulbflow" (bulbflow, with Rexster, Gremlin and REST api)? Is REST api secure and provides high availability (e.g. 500 000+ users)?

Thank you.


回答1:


I think Bulbs against Neo4j Server might be the best combination. Also, you can set up Neo4j in High Availability mode so multiple instances are forming a cluster, http://docs.neo4j.org/chunked/snapshot/ha.html which should take care of your load scenario.




回答2:


You can use Bulbs (http://bulbflow.com/) with Neo4j Server or Rexster:

>>> from bulbs.neo4jserver import Graph
>>> g = Graph()
>>> g.vertices.create(name="James")
>>> g.vertices.create(name="Julie")
>>> g.edges.create(james, "knows", julie)

Or to use Rexster, just change the import:

>>> from bulbs.rexster import Graph
>>> g = Graph()
>>> g.vertices.create(name="James")
>>> g.vertices.create(name="Julie")
>>> g.edges.create(james, "knows", julie)

Note though with Rexster, it supports multiple graph databases so make sure you change the default DB URI in the config:

>>> from bulbs.rexster import Graph, Config
>>> config = Config('http://localhost:8182/graph/neo4jsample')
>>> g = Graph(config)
>>> ...


来源:https://stackoverflow.com/questions/9959502/python-and-graph-database-use-java-lib-wrapper-or-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!