Your SlideShare is downloading. ×
NYC Neo4j Meetup 003 Slides:  Realistic Neo4j with Ruby (Part 1)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

NYC Neo4j Meetup 003 Slides: Realistic Neo4j with Ruby (Part 1)

367

Published on

Using Neo4j with Ruby and Neography. …

Using Neo4j with Ruby and Neography.

Code examples here: https://github.com/seenickcode/nycneo4j-sinatra-example-1

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
367
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Meetup Jan 29th, 2014 Realistic Neo4j: Neo4j + Ruby (part 1) 1
  • 2. Neo4j Quick Review • Benefits of a Graph Database – Super fast when querying complex, highly connected data – Schema-less and Efficient storage of Semi Structured Information – Fast deep traversal instead of slow SQL queries that span many table joins – Very natural to express graph related problems with traversals (recommendation engine, shortest parth etc..) source: http://neo4j.rubyforge.org/guides/why_gra ph_db.html
  • 3. Neo4j Quick Review • Graph Database – A graph database is a database that uses graph structures with nodes, edges, and properties to represent and store data (Wikipedia) • Node – An entity in the database typically representing a “thing” • Relationship – A one way link between two nodes • Node/Relationship Property – A key-value pair that can be attached to a node or relationship – example: { “name” : “Nicholas” } • Label – A “tag” that can be attached to a node in order to make querying faster and more convenient 3
  • 4. Example node node property: value property: value property: value relationship type label name: ‘Joe’ age: 27 label :UPLOADS filename: ‘cat.png’ on: 2013-11-18 :User :Photo 4
  • 5. Example :User :FOLLOWS name: ‘Joe’ age: 27 weight: 10 name: ‘Jane’ bday: 19800115 :FOLLOWS :PHOTO weight: 2 filename: ‘cat.png’ :LIKES name: ‘Joe’ age: 27 on: 20131118 5
  • 6. Queries are Traversals start end 6
  • 7. What Are Our Options? • Java – Kind of heavyweight. Bit more complex to host. But good for control and optimizing queries. • Ruby – Neo4j.rb • Uses JRuby which is still Java under the hood. – Neography • Uses Neo4j’s RESTful HTTP web services • Not as fast as other options, but simple and easier to deploy and host • Other Options – Node.js, Python, PHP, .NET, Go, etc – http://www.neo4j.org/develop/drivers 7
  • 8. Our Example Today • Why Ruby? – Simple, popular, easy to learn. • Why Not X Instead of Ruby? • Why Neography? – Communicates with Neo4j via HTTP, simply point your code to a Neo4j server and get started – Downside: not the best documentation or examples for newcomers (hence this meetup) – https://github.com/maxdemarzi/neography • Why aren’t we looking at a Rails example? • Thoughts on ActiveRecord 8
  • 9. Today (part 1) We’ll Cover • Writing Code That: – creates nodes for Users – creates relationships for Users – using indexes • Writing a Few Tests To Demonstrate • (No webpages, Sorry , Keeping it Simple) 9
  • 10. Technologies We’ll Cover • Neo4j – Download, start and make sure Neo4j is running – Checkout the Data Browser at http://localhost:7474 • Ruby – Ruby is a programming language we will use to talk to the Neo4j server – Install Ruby: https://www.ruby-lang.org/en/installation – Run `ruby –v` to make sure it is installed properly • Sinatra – A simple framework for writing Ruby web applications or web service APIs – Remember, use whatever language and framwork you like. Sinatra is just an example. – (more information: http://www.sinatrarb.com) – (great intro: http://www.slideshare.net/knaveofdiamonds/web-simplicity-ruby-sinatra-rack ) 10
  • 11. Finding Help – https://github.com/seenickcode/nycneo4j-sinatraexample-1/tree/master/meetup-003-sinatra-example1 – Neography – http://maxdemarzi.com/2012/01/04/getting-startedwith-ruby-and-neo4j/ – https://github.com/neo4j-contrib/neo4j-herokuseeds/tree/master/ruby/sinatra-neography 11
  • 12. Thanks for Coming • @seenickcode • nicholas.manning@gmail.com for questions • Next time we’ll expand on this! • Want to present? Let me know. 12

×