• Save
NOSQL part of the SpringOne 2GX 2010 keynote
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

NOSQL part of the SpringOne 2GX 2010 keynote

on

  • 9,903 views

 

Statistics

Views

Total Views
9,903
Views on SlideShare
3,788
Embed Views
6,115

Actions

Likes
6
Downloads
0
Comments
0

20 Embeds 6,115

http://blog.neo4j.org 3476
http://nosql.mypopescu.com 2486
http://neo4j.com 94
http://localhost 13
http://translate.googleusercontent.com 9
http://j-reference.blogspot.com 8
http://static.slidesharecdn.com 8
http://localhost:3000 5
http://pleasesendmeto.appspot.com 3
http://shoutscreamprxy.appspot.com 2
http://www.blogger.com 2
http://don-proxy.appspot.com 1
http://webcache.googleusercontent.com 1
http://www.netvibes.com 1
http://j-reference.blogspot.nl 1
http://passing.tk 1
http://www.kinghill-server.appspot.com 1
http://www.linkedin.com 1
http://ljq1288.appspot.com 1
https://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

NOSQL part of the SpringOne 2GX 2010 keynote Presentation Transcript

  • 1. Spring Data NOSQL Support • Challenge • Proliferation of data • Complexity of data • Won’t all go into relational databases • NOSQL = Not Only SQL • Opportunity for Spring to provide solutions • Spring Data support for new data stores Column/ Tuesday, October 19, 2010
  • 2. The Neo4j graph database • A graph database uses nodes, relationships and properties • Sweet spot: complex domains such as social networking, bioinformatics, fraud detection, master data mgm – Very high performance on complex data: traverses 1-2 MILLION hops per second 2 Tuesday, October 19, 2010
  • 3. A scenario ... You have a traditional web app using JPA to persist data to a relational database Tuesday, October 19, 2010
  • 4. Existing JPA data model Restaurant UserAccount @Entity @Entity public class Restaurant { @Table(name = "user_account") @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) private Set<Restaurant> favorites; Tuesday, October 19, 2010
  • 5. Adding Neo4J graph features to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Tuesday, October 19, 2010
  • 6. Old style Neo4j code example public class Recommendation { private final Relationship underlyingRel; public Recommendation( Relationship underlyingRel ) { this.underlyingRel = underlyingRel; } public void rate(int stars, String comment) { this.underlyingRel.setProperty("stars", stars); this.underlyingRel.setProperty("comment", comment); } public int getStars() { return (Integer) this.underlyingRel.getProperty("stars"); } public String getComment() { return (String) this.underlyingRel.getProperty("comment"); } Tuesday, October 19, 2010
  • 7. New style Spring/Neo4j code example @RelationshipEntity public class Recommendation { @StartNode private UserAccount user; @EndNode private Restaurant restaurant; private int stars; private String comment; public Recommendation() { } public void rate(int stars, String comment) { this.stars = stars; this.comment = comment; } public int getStars() { return stars; } public String getComment() { return comment; } Tuesday, October 19, 2010
  • 8. The social networking version Tuesday, October 19, 2010
  • 9. Generating in Spring Roo - new Neo4J Add-On Tuesday, October 19, 2010
  • 10. Conclusion • The goal of the Spring Data project is to provide simple and convenient connectivity to non-relational databases such as Redis, Neo4j, MongoDB and Cassandra • The Neo4j datastore-graph and Roo add-on have been developed in collaboration with the Neo4j team – Already used in a commercial context • If you want to learn more, go to: – “Graph Database Persistence using Neo4J with Spring and Roo” on Friday @ 1015 am – http://wiki.neo4j.org/content/Neo4j_and_SpringOne 10 Tuesday, October 19, 2010