{"id":15687115,"url":"https://github.com/jexp/cypher_websocket_endpoint","last_synced_at":"2025-05-07T19:09:41.395Z","repository":{"id":7624468,"uuid":"8983754","full_name":"jexp/cypher_websocket_endpoint","owner":"jexp","description":"Fast websocket based Cypher endpoint as Neo4j kernel extension","archived":false,"fork":false,"pushed_at":"2013-10-14T09:42:38.000Z","size":124,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-07T19:08:58.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jexp.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-24T09:18:56.000Z","updated_at":"2019-07-15T20:45:53.000Z","dependencies_parsed_at":"2022-09-05T04:30:58.361Z","dependency_job_id":null,"html_url":"https://github.com/jexp/cypher_websocket_endpoint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fcypher_websocket_endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fcypher_websocket_endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fcypher_websocket_endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fcypher_websocket_endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jexp","download_url":"https://codeload.github.com/jexp/cypher_websocket_endpoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940934,"owners_count":21828769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:43:35.635Z","updated_at":"2025-05-07T19:09:41.327Z","avatar_url":"https://github.com/jexp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remoting Experiments for Neo4j's Cypher using MessagePack and WebSockets\n\n## Usage\n\n* right now queries are hard coded in clients\n\n````\n    ./server.sh [db-dir]\n    node ws-client.js\n````\n\n### Sample Session\n\n````\n    Request\n    {\"query\",\"start n=({ids}) return n\", \"params\": {\"ids\" : [1,2]},\"stats\": true,\"result\":true}\n\n    Response:\n    [\"n\"]\n    [{\"id\":1,\"data\":{\"name\":\"foo\"}}]\n    [{\"id\":2,\"data\":{\"name\":\"bar\"}}]\n    {\"time\": 0, \"rows\": 2, \"bytes\": 100}\n````\n\n## Ideas:\n\nWrite a Cypher only endpoint for Neo4j that uses a fast transport and serialization across multiple client languages.\nCypher Results are streamed from the server. Transaction support. Multithreaded clients and servers\nClient examples in ruby, python, php, c#, c, javascript, java, scala, clojure, erlang\nPublic installation on Heroku for testing\n\n### Serialization\nNodes, Relationships and Paths are converted into maps and lists for serialization recursively\n \n    Node : { id : id, [data : {foo:bar}]}\n    Relationship : { id : id, start: id, end: id, type : \"FOO\",  [data : {foo:bar}]}\n    Path {start: node, nodes: [nodes], relationships [relationships], end: node, lenght: 1}\n\nHeader with Columns, optional Footer with time, bytes, tx-id, error, exception, rows, update-counts for nodes, relationships, properties.\n\n### Compactness\n\n* leave off footer, enable when needed\n* ignore results (fire \u0026 forget)\n\n### Transactions\n\n* provide a \"tx\" parameter with `begin`, `commit`,`rollback`\n* `tx-id` will be reported in footer\n* provie a `tx-id` parameter with the transaction id    \n* transaction will be suspended, resumed per request (if a tx-id is provided) and finished and removed at rollback/commit\n\n## Serialization\n\n* fast, lightweight, portable\n\n### MessagePack\n\n* messagepack-lite (copied sources and fixed some performance issues)\n** original source: https://bitbucket.org/sirbrialliance/msgpack-java-lite\n\n## Transport\n\n* fast, lightweight, portable\n\n### WebSockets\n\n#### Java\n\n* uses netty 4\n\n#### Running as Neo4j Kernel Extension\n\n   The cypher server is now packaged as a Neo4j Kernel Extension. So if you build the jar with mvn package and drop the jar in your neo4j environment\n   either in /server/plugins or your classpath/build repository for embedded development, the extension will be started and listen on port 5555 by default.\n   \n   The server starts by default with 1 Thread, the multiple threads don't work yet with transactions (wrong transactions resumed in the wrong thread) but for \n   non-transactional access the single server works fine. Threads and port can be configured in `neo4j.properties` or in the config-map passed to the database.\n\n````\n   cypher_remoting_address=:5555 # a hostname and port \n   cypher_remoting_threads=1 # number of threads 1 to 10\n````\n\n#### Node.js\n\n* uses \"ws\" npm module\n* simple sample client\n\n## Resources\n\n### Websockets\n\n*\n* Netty:\n* Node.js\n\n### MessagePack\n\n* http://msgpack.org/\n* used msgpack implementation: https://bitbucket.org/sirbrialliance/msgpack-java-lite/overview\n* https://github.com/msgpack/msgpack-java/blob/master/src/test/java/org/msgpack/TestSimpleArrays.java\n* http://blog.andrewvc.com/why-arent-you-using-messagepack discussion: http://news.ycombinator.com/item?id=2571729\n\n### Alternatives:\n* Spread http://www.spread.org/ Spread, a asynchronous messaging protocol\n* Netty: https://netty.io/ high performance NIO server/client, only for Java/JVM\n* Storm (uses ZeroMQ): http://storm-project.net/ Distributed and fault-tolerant realtime computation: stream processing, continuous computation, distributed RPC\n* Thrift: http://thrift.apache.org/ Code generator and RPC middleware for cross-language client-server applications\n* BSON: http://bsonspec.org/\n* Protocol Buffers http://code.google.com/p/protobuf/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjexp%2Fcypher_websocket_endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjexp%2Fcypher_websocket_endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjexp%2Fcypher_websocket_endpoint/lists"}