Spring Data Graph is an integration library for the open source graph database Neo4j and has been around for over a year, evolving from its infancy as brainchild of Rod Johnson and Emil Eifrem. It supports transparent AspectJ based POJO to Graph Mapping, a Neo4jTemplate API and extensive support for Spring Data Repositories. It can work with an embedded graph database or with the standalone Neo4j Server.
The session starts with a short introduction to graph databases. Following that, the different approaches using Spring Data Graph are explored in the Cineasts.net web-app, a social movie database which is also the application of the tutorial in the Spring Data Graph Guidebook. The session will also cover creating a green-field project using the Spring Roo Addon for Spring Data Graph and deploying the App to CloudFoundry.
In this webinar we discuss the primary use cases for Graph Databases and explore the properties of Neo4j that make those use cases possible.
We cover the high-level steps of modeling, importing, and querying your data using Cypher and give an overview of the transition from RDBMS to Graph.
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jIvan Zoratti
I gave this presentation at DataOps 19 in Barcelona.
You will find information about Neo4j and how to use it with Graph Algorithms for Machine Learning and Artificial Intelligence.
In this webinar we discuss the primary use cases for Graph Databases and explore the properties of Neo4j that make those use cases possible.
We cover the high-level steps of modeling, importing, and querying your data using Cypher and give an overview of the transition from RDBMS to Graph.
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jIvan Zoratti
I gave this presentation at DataOps 19 in Barcelona.
You will find information about Neo4j and how to use it with Graph Algorithms for Machine Learning and Artificial Intelligence.
The Future is Big Graphs: A Community View on Graph Processing SystemsNeo4j
Alexandru Iosup, Full Professor, Vrije Universiteit Amsterdam (VU Amsterdam)
Angela Bonifati, Full Professor of Computer Science, Université de Lyon
Hannes Voigt, Software Engineer, Neo4j
This introduction to graph databases is specifically designed for Enterprise Architects who need to map business requirements to architectural components like graph databases. It explains how and why graphs matter for Enterprise Architecture and reviews the architectural differences between relational and graph models.
Relational databases were conceived to digitize paper forms and automate well-structured business processes, and still have their uses. But, oftentimes with RDBMS, performance degrades with the increasing number and levels of data relationships and data size.
A graph database like Neo4j naturally stores, manages, analyzes, and uses data within the context of connections meaning Neo4j provides faster query performance and vastly improved flexibility in handling complex hierarchies than SQL.
This webinar explains why companies are shifting away from RDBMS towards graphs to unlock the business value in their data relationships.
In diesem Webinar wollen wir einen Überblick über unser Angebot für Data Scientsts geben und zeigen, was heute schon relativ einfach und schnell möglich ist.
A comparison of relational and graph model theories, with an eye towards DataStax's implementation of Graph. Note: I'm working on a concise, formal mathematical definition of relational, based on Codd's 1970 paper. (Thanks to Artem Chebotko for suggesting this.)
In this talk, Michael Hunger is going to shed some light over the new High Availability architecture for the popular Neo4j Graph Database. We are going to look at the different variants of the Paxos protocol, master failover strategies and cluster management state handling. This piece of infrastructure poses non-trivial challenges to distributed consensus-finding, an interesting session for anyone into scalable systems.
The Future is Big Graphs: A Community View on Graph Processing SystemsNeo4j
Alexandru Iosup, Full Professor, Vrije Universiteit Amsterdam (VU Amsterdam)
Angela Bonifati, Full Professor of Computer Science, Université de Lyon
Hannes Voigt, Software Engineer, Neo4j
This introduction to graph databases is specifically designed for Enterprise Architects who need to map business requirements to architectural components like graph databases. It explains how and why graphs matter for Enterprise Architecture and reviews the architectural differences between relational and graph models.
Relational databases were conceived to digitize paper forms and automate well-structured business processes, and still have their uses. But, oftentimes with RDBMS, performance degrades with the increasing number and levels of data relationships and data size.
A graph database like Neo4j naturally stores, manages, analyzes, and uses data within the context of connections meaning Neo4j provides faster query performance and vastly improved flexibility in handling complex hierarchies than SQL.
This webinar explains why companies are shifting away from RDBMS towards graphs to unlock the business value in their data relationships.
In diesem Webinar wollen wir einen Überblick über unser Angebot für Data Scientsts geben und zeigen, was heute schon relativ einfach und schnell möglich ist.
A comparison of relational and graph model theories, with an eye towards DataStax's implementation of Graph. Note: I'm working on a concise, formal mathematical definition of relational, based on Codd's 1970 paper. (Thanks to Artem Chebotko for suggesting this.)
In this talk, Michael Hunger is going to shed some light over the new High Availability architecture for the popular Neo4j Graph Database. We are going to look at the different variants of the Paxos protocol, master failover strategies and cluster management state handling. This piece of infrastructure poses non-trivial challenges to distributed consensus-finding, an interesting session for anyone into scalable systems.
Each of the files or classes of a projects source code represents a tree (AST). Looking at dependencies to other classes besides inheritance creates a graph though. Field types and method parameters are also implicit dependencies. Storing this information in a graph database like Neo4j allows for interesting queries and insights. Class-Graph provides that and is available as open-source github project.
Graphs are everywhere. From websites adding social capabilities to Telcos providing personalized customer services, to innovative bioinformatics research, organizations are adopting graph databases as the best way to model and query connected data. If you can whiteboard, you can model your domain in a graph database.
In this session Emil Eifrem provides a close look at the graph model and offers best use cases for effective, cost-efficient data storage and accessibility.
Take Aways: Understand the model of a graph database and how it compares to document and relational databases Understand why graph databases are best suited for the storage, mapping and querying of connected data
Emil's presentation will be followed by a Hands-on Guide to Spring Data Neo4j. Spring Data Neo4j provides straightforward object persistence into the Neo4j graph database. Conceived by Rod Johnson and Neo Technology CEO Emil Eifrem, it is the founding project of the Spring Data effort. The library leverages a tight integration with the Spring Framework and the Spring Data infrastructure. Besides the easy to use object graph mapping it offers the powerful graph manipulation and query capabilities of Neo4j with a convenient API.
The talk introduces the different aspects of Spring Data Neo4j and shows applications in several example domains.
During the session we walk through the creation of a engaging sample application that starts with the setup and annotating the domain objects. We see the usage of Neo4jTemplate and the powerful repository abstraction. After deploying the application to a cloud PaaS we execute some interesting query use-cases on the collected data.
Third lecture in Java EE training series.
Covers:
- JPA entities and persistence units
- Mapping of JPA entities to SQL database
- Querying entities
- Lazy and eager loading
- Id generation
- Optimistic locking
Have you ever wondered what the best way would be to test emails? Or how you would go about testing a messaging queue?
Making sure your components are correctly interacting with each other is both a tester and developer’s concern. Join us to get a better understanding of what you should test and how, both manually and automated.
This session is the first ever in which we will have two units working together to give you a nuanced insight on all aspects of integration testing. We’ll start off exploring the world of integration testing, defining the terminology, and creating a general understanding of what phases and kinds of testing exist. Later on we’ll delve into integration test automation, ranging from database integration testing to selenium UI testing and even as far as LDAP integration testing.
We have a wide variety of demos prepared where we will show you how easy it is to test various components of your infrastructure. Some examples:
- Database testing (JPA)
- Arquillian, exploring container testing, EJB testing and more
- Email testing
- SOAP testing using SoapUI
- LDAP testing
- JMS testing
Enterprise applications are complex making it difficult to fit everything in one model. NoSQL is taking a leading role in the next generation database technologies and polyglot persistence a good option to leverage the strength of multiple data stores. This talk will introduce the Spring Data project, an umbrella project that provides a familiar and consistent Spring-based programming model for a wide range of data access technologies such as Redis, MongoDB, HBase, Neo4j...while retaining store-specific features and capabilities.
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)Emil Eifrem
Presentation given at nosql east 2009 in Atlanta. Introduces the NOSQL space by offering a framework for categorization and discusses the benefits of graph databases. Oh, and also includes some tongue-in-cheek party poopers about sucky things in the NOSQL space.
Polyglot Persistence with MongoDB and Neo4jCorie Pollock
Learn how to enhance your application by using Neo4j and MongoDB together. Polyglot persistence is the concept of taking advantage of the strengths of different database technologies to improve functionality and enhance your application. In this webinar we will examine some use cases where it makes sense to use a document database (MongoDB) with a graph database (Neo4j) in a single application. Specifically, we will show how MongoDB can be used to provide search and browsing functionality for a product catalog while using Neo4j to provide personalized product recommendations. Finally we will look at the Neo4j Doc Manager project which facilitates syncing data from MongoDB to Neo4j to make polyglot persistence with MongoDB and Neo4j much easier.
Selecting the right database type for your knowledge management needs.Synaptica, LLC
This presentation looks at relational vs. graph databases and their advantages and disadvantages in storing semantic data for taxonomies and ontologies.
Looming Marvelous - Virtual Threads in Java Javaland.pdfjexp
Nowadays we have 2 options for concurrency in Java:
* simple, synchronous, blocking code with limited scalability that tracks well linearly at runtime, or.
* complex, asynchronous libraries with high scalability that are harder to handle.
Project Loom aims to bring together the best aspects of these two approaches and make them available to developers.
In the talk, I'll briefly cover the history and challenges of concurrency in Java before we dive into Loom's approaches and do some behind-the-scenes implementation. To manage so many threads reasonably needs some structure - for this there are proposals for "Structured Concurrency" which we will also look at. Some examples and comparisons to test Loom will round up the talk.
Project Loom is included in Java 19 and 20 as a preview feature, it can already be tested how well it works with our applications and libraries.
Spoiler: Pretty good.
Easing the daily grind with the awesome JDK command line toolsjexp
Included in the JDK installation are a lot of handy tools for Java developers, from java, jshell and jcmd to jfr and jdeprscan. These allow you to analyze a running JVM, generate JRE's, run Java source code and much more. In this talk I would like to present a number of these tools with practical examples and thus expand the toolbox of the participants. With the command line tools, many tasks can be automated and executed more efficiently, leaving more time for the exciting things in developer life.
Today, we have 2 options for concurrency in Java:
Simple, synchronous, blocking code with limited scalability that tracks well linearly at runtime, or
complex, asynchronous libraries with high scalability, which are harder to handle
Project Loom aims to bring together the best aspects of these two approaches and make them available to developers.
In the talk, I'll briefly discuss the history and challenges of concurrency in Java before we dive into Loom's approaches and look a bit behind the scenes.
Project Loom is included since Java 17 as a preview feature, it can already be tested to see how well it works with our applications and libraries. Spoiler: Pretty good.
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxjexp
I was there when Cypher was invented in 2012
and have been using it ever since. The language is
extremely powerful and easy to learn. But to truly
master it, you need to understand how it works
internally and how the database executes your
queries. In this session, you'll learn to look behind
the scenes at execution plans with PROFILE and
EXPLAIN and which specific clauses, expressions,
structures, and operations help you minimize
Cypher and database operations. After this talk,
you should be able to speed up your Cypher
statements quite a bit.
The newly released Neo4j Connector for Apache Spark can be used to read and write data between the two systems.
In this demo I show how to use the investigative Data from the FinCEN files to have a full pipeline up an running.
Notebook is in https://github.com/jexp/fincen
How Graphs Help Investigative Journalists to Connect the Dotsjexp
The Journalists of the ICIJ used graph technology to understand the relationships between the leaked pieces of information in the Panama and Paradise Papers.
NBC News applied graph algorithms to the messages and follower networks of Russian Twitter trolls to gain further insights.
The Trumpworld organizational data correlated with US bills and government contracts offers starting points for further investigations.
New tools like graph databases allow data journalists to understand the intricate networks of the criminal, economic and political world better as those three examples show. Each journalist adding new connections helps others to validate their stories. They say "It's like magic".
Join Michael for a look behind the scenes of graph based data ingestion, analysis and investigation.
We will use the open source graph database Neo4j, data visualization and graph algorithms to read between the lines.
Who doesn't know him, the office hero, who sat in the office late into the evening and repaired production? The fact that perhaps another colleague sat on the sofa at home and had an equal share in this success is unfortunately not so appreciated in most company cultures. But why is that? Because we are not used to working at home? Because we think that you are not so productive at home? Because you have family, garden or other activities at home? Michael has been working for distributed companies for a long time, but has also worked in offices for a long time. He will take you on his journey through different working environments and tell you what worked well for him.
The JVM is already a runtime for many languages. With the optimizing Graal compiler added to Java 11 and the language implementations in Truffle for Ruby, Python, JavaScript, and R it becomes possible to run them natively on the JVM, even exchanging data between them.
Michael Hunger explains the concepts behind Truffle and Graal and uses a practical example to show how you can use Python and JavaScript for “stored procedures” in a JVM-based database.
He demonstrates how to optimize the startup time of your application and container images by precompiling it to machine-code and examines its limits and the difference it makes. But nothing is perfect—Michael discusses the limitations and compares performances for the full picture.
Presentation at OSCON, PDX 2019.
https://conferences.oreilly.com/oscon/oscon-or/public/schedule/detail/76092
Neo4j Graph Streaming Services with Apache Kafkajexp
In this presentation we give an high level overview of the Neo4j-Kafka integration and the Confluent partnership.
Providing change-data-capture and ingestion capabilities as Neo4j Extension and the Kafka Connect Neo4j Sink on Confluent Hub allows you to integrate real-time streaming with graph querying and analytics.
How Graph Databases efficiently store, manage and query connected data at s...jexp
Graph Databases try to make it easy for developers to leverage huge amounts of connected information for everything from routing to recommendations. Doing that poses a number of challenges on the implementation side. In this talk we want to look at the different storage, query and consistency approaches that are used behind the scenes. We’ll check out current and future solutions used in Neo4j and other graph databases for addressing global consistency, query and storage optimization, indexing and more and see which papers and research database developers take inspirations from.
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Libraryjexp
APOC has become the de-facto standard utility library for Neo4j. In this talk, I will demonstrate some of the lesser known but very useful components of APOC that will save you a lot of work. You will also learn how to combine individual functions into powerful constructs to achieve impressive feats
This will be a fast-paced demo/live-coding talk.
Video: https://neo4j.com/graphconnect-2018/session/neo4j-utility-library-apoc-pearls
Unicorn images by TeeTurtle.com (Unstable Unicorns is a fun game & cool t-shirts)
Code we've written once has to be kept readable, maintainable, understandable and extensible for many years. Good code is not self-serving but the foundation for working together.
Refactoring can help you to keep the quality of the relevant parts of our systems high.
The technique is really easy (almost too easy) - improve the naming, structure, and responsibility in small steps that don't change behavior and run your tests after each step.
18 years ago I got hooked on Refactoring when Martin Fowler's first book came out. I've been using it since then on a daily basis on many different projects. Since then a lot has changed, especially with the help of modern IDEs with their automated refactorings and intentions.
Now he asked me to help review the 2nd edition. Our discussions reminded me that each generation of developers should be taught this crucial skill. That's why I want to give an overview of core refactorings and code-smells but also demonstrate the tips and tricks of today's tools that make this task so much easier.
Plus a sneak preview of the upcoming book.
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...jexp
Highlighting the progress in Neo4j 3.3 and 3.4 especially
Neo4j Desktop, Graph Algorithms, NLP, Date-Time, Geospatial, and performance.
Also featuring the new visualization tool Neo4j Bloom.
GraphQL - The new "Lingua Franca" for API-Developmentjexp
Three years ago, with the release of the GraphQL specification, Facebook took a fresh stab at the topic of "API design between remote services and applications." The key aspects of GraphQL provide a common, schema-based, domain-specific language and flexible, dynamic queries at interface boundaries.
In the talk, I'd like to compare GraphQL and REST and showcase benefits for developers and architects using a concrete example in application and API development, data source and system integration.
Not only, is our data is getting not just more complex but also more connected. In order not to lose sight of the web of information, but to use it as a source of new insights and opportunities, technologies such as graph databases can help.
For both analytical and transactional use cases, they allow efficient storage, retrieval, and processing of networked data without loss of detail. In this talk, we want to get to know existing tools and techniques for graph data processing.
We recently released the Neo4j graph algorithms library.
You can use these graph algorithms on your connected data to gain new insights more easily within Neo4j. You can use these graph analytics to improve results from your graph data, for example by focusing on particular communities or favoring popular entities.
We developed this library as part of our effort to make it easier to use Neo4j for a wider variety of applications. Many users expressed interest in running graph algorithms directly on Neo4j without having to employ a secondary system.
We also tuned these algorithms to be as efficient as possible in regards to resource utilization as well as streamlined for later management and debugging.
In this session we'll look at some of these graph algorithms and the types of problems that you can use them for in your applications.
Despite the “Graph” in the name, GraphQL is mostly used to query relational databases, object models or APIs. But it is really easy to support GraphQL endpoints from graph databases too. In this talk, I’ll demonstrate how we implemented a GraphQL extension for the Neo4j graph database. It uses the GraphQL schema definition map arbitrary GraphQL queries into single graph queries and runs them against the data in the Graph database. Using directives in the schema, we added some cool features that are transparent to the end user like computed fields and auto-generated mutations and query types. That allows you to create GraphQL APIs of some complexity without writing a single line of code.
I will show how to use the Neo4j-GraphQL extension, by creating an endpoint for the Game of Thrones dataset, and how we then can use our well-known tools (GraphiQL, apollo-client, graphql-cli, voyager) to interact with it.
Despite the “Graph” in the name, GraphQL is mostly used to query relational databases or object models. But it is really well suited to querying graph databases too. In this talk, I’ll demonstrate how I implemented a GraphQL endpoint for the Neo4j graph database and how you would use it in your app.
The world around us is full of connected information. Neo4j was originally developed to solve two complex "network" problems in a document management system, as it was too hard to manage rich connection information efficiently in traditional and new "NOSQL" databases.During this meetup, we will talk about the technology, and about the journey that a couple of technologists from Malmö took. You will learn* how Neo Technology grew from just the three founders in to a global database company with use-cases in every domain imaginable.* how focusing on customer and community feedback allows us to provide a solution for managing connected data to everyone, not just the large internet companies.
Of course we will also introduce the graph model, it's whiteboard friendlyness and how you get started with Neo4j and it's easy and powerful query language Cypher. We'll also compare the graph and relational data model to see how they differ in shape and capabilities. Finally we discuss the foundations that enable Graph databases to provide higher join performance, faster development processes and more inclusive software for all stakeholders. With use-cases from Gaming, Dating and Finance we'll see how to apply the graph capabilities to these domains to realize new functionality or opportunities that were not possible before.
Finally, if there's a question you've always wanted to ask/discuss, we'll have plenty of time for that at the end of Michael's presentation.
Putting your data in a graph database is easy. We wanted to make it as easy to query the data. That's why we set out to create the cypher query language. This session introduces cypher shows a lot of examples and explains how it is used.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
7. What does NOSQL stand for?
It’s not “No to SQL”
It’s not “Never SQL”
8. What does NOSQL stand for?
It’s not “No to SQL”
It’s not “Never SQL”
It’s “Not Only SQL”
9. What does NOSQL stand for?
It’s not “No to SQL”
It’s not “Never SQL”
It’s “Not Only SQL”
NOSQL no-seek-wool n. Describes ongoing
trend where developers increasingly opt for
non-relational databases to help solve their
problems, in an effort to use the right tool for
the right job.
10. Why NOSQL now?
We have observed four trends:
๏ Trend 1: Size of data is growing
๏ Trend 2: Data is increasingly connected
๏ Trend 3: Data is increasingly semi-structured
๏ Trend 4: Change in architecture
12. NOSQL categories
We see four main categories in the NOSQL space:
Key-Value
•Redis
•Riak
•Voldemort
13. NOSQL categories
We see four main categories in the NOSQL space:
Column-family/
Key-Value
BigTable
•Redis
•Riak •Cassandra
•Voldemort •HBase
14. NOSQL categories
We see four main categories in the NOSQL space:
Column-family/
Key-Value
BigTable
•Redis
•Riak •Cassandra
•Voldemort •HBase
Document
•MongoDB
•CouchDB
15. NOSQL categories
We see four main categories in the NOSQL space:
Column-family/
Key-Value
BigTable
•Redis
•Riak •Cassandra
•Voldemort •HBase
Document Graph
•Neo4j
•MongoDB
•InfiniteGraph
•CouchDB
•OrientDB
•DEX
16. Scaling to size vs. Scaling to complexity
Size
Key-Value stores
Bigtable clones
Document databases
Graph databases
Complexity
8
17. Scaling to size vs. Scaling to complexity
Size
Key-Value stores
Bigtable clones
Document databases
Graph databases
Billions of nodes
and relationships
Complexity
8
18. Scaling to size vs. Scaling to complexity
Size
Key-Value stores
Bigtable clones
Document databases
Graph databases
Billions of nodes
and relationships
> 90% of use cases
Complexity
8
20. What is Spring Data
๏ VMWare/SpringSource initiative to give Spring developers easy
access to the emerging world of NOSQL, including:
• Non-relational databases
• MapReduce
• Grails NOSQL support
• Cross-store persistence
• Object Persistence Mapping Infrastructure
• Generic Repository Infrastructure
• upcoming Spring Roo add-ons
10
21. Spring Data projects
๏ Code is in SpringSource git repository:
• http://springsource.org/spring-data
• https://github.com/SpringSource/spring-data-*
๏ Includes:
• data-commons
• spring-data-graph-neo4j
• spring-data-{redis,riak}
• spring-data-mongo
• spring-data-jdbc
• spring-data-jpa
22. Spring Data Neo4j
๏ Focus on Spring Data Neo4j
๏ VMWare is collaborating with Neo Technology, the company behind
the Neo4j graph database.
๏ Improved programming model: Annotation-based
programming model for graph applications
๏ Cross-store persistence: Extend existing JPA application with
NOSQL persistence
๏ Spring Roo support: Add graph persistence with Roo add-on
26. Good Relationships
๏ the world is rich, messy and related data
๏ relationships are as least as important as the things they connect
๏ Graphs = Whole > Sum of all parts
๏ complex interactions
๏ always changing, change of structures as well
๏ Graph: Relationships are part of the data
๏ RDBMS: Relationships part of the fixed schema
16
27. Questions and Answers
๏ Complex Questions
๏ Answers lie between the lines (things)
๏ Locality of the information
๏ Global searches / operations very expensive
๏ constant query time, regardless of data volume
17
28. Categories ?
๏ Categories == Classes, Trees ?
๏ What if more than one category fits?
๏ Tags
๏ Categories vi relationships like „IS_A“
๏ any number, easy change
๏ „virtual“ Relationships - Traversals
๏ Category dynamically derived from queries
18
43. For example
WORKS_WITH
project: spring-data
name: Oliver name: Michael
44. For example
WORKS_WITH
project: spring-data
name: Oliver name: Michael
EM
PL
LIVES_IN
OY
E
D_
BY
city: Dresden
company: VMware country: DE
45. For example
name: Rod
KN
S OW
OW S
KN
WORKS_WITH
project: spring-data
name: Oliver name: Michael
EM
PL
LIVES_IN
OY
E
D_
BY
city: Dresden
company: VMware country: DE
46. For example
name: Rod
KN
S OW
OW S
KN
WORKS_WITH
project: spring-data
name: Oliver name: Michael
EM
PL
LIVES_IN
S
OY
LIKE
E
D_
BY
city: Dresden
food: Chinese
company: VMware country: DE
47. Best NOSQL Database for Spring ?
Why ? Explain !
•Written in Java
•Embeddable or standalone Server
•Schema-free - perfect for rich domains
•Fully transactional (ACID)
•Persistent to custom on-disk file structure
•Traversal speeds of 1,000+ hops per ms
•24/7 production since 2003
•Integrated indexing
•Plenthora of language bindings
50. Whiteboard friendly
Blog
Post BEL
ON
GS
_TO
Ally’s
Blog
WROTE
BE
LO
NG
NS
S_
W
O
OT
Blog
Allison WROTE Post 2
51. Whiteboard friendly
Blog
Post BEL
ON
GS
_TO
Ally’s
Blog
WROTE
BE
LO
NG
NS
S_
W
O
T O
Blog
Allison WROTE Post 2 CO
MM
EN
T_
OR
FO
R
COMMENT_F
Comment
Comment
52. Whiteboard friendly
Blog
Post BEL
ON
GS
_TO
Ally’s
Blog
WROTE
BE
LO
NG
NS
S_
W
O
T O
Blog
Allison WROTE Post 2 CO
MM
EN
T_
OR
FO
R
COMMENT_F
Comment
Comment
53. Show me some code, please
GraphDatabaseService graphDb =
new EmbeddedGraphDatabase(“var/neo4j”);
Node david = graphDb.createNode();
Node andreas = graphDb.createNode();
david.setProperty(“name”, “David Montag”);
andreas.setProperty(“name”, “Andreas Kollegger”);
Relationship presentedWith = david.createRelationshipTo(
andreas, PresentationTypes.PRESENTED_WITH);
presentedWith.setProperty(“date”, System.currentTimeMillis());
54. Show me some code, please
GraphDatabaseService graphDb =
new EmbeddedGraphDatabase(“var/neo4j”);
Transaction tx = graphDb.beginTx();
try {
Node david = graphDb.createNode();
Node andreas = graphDb.createNode();
david.setProperty(“name”, “David Montag”);
andreas.setProperty(“name”, “Andreas Kollegger”);
Relationship presentedWith = david.createRelationshipTo(
andreas, PresentationTypes.PRESENTED_WITH);
presentedWith.setProperty(“date”, System.currentTimeMillis());
tx.success();
} finally {
tx.finish();
}
61. Traversal framework
Example: a dependency graph
Query: Find all dependencies of A, transitively A
B
D
C
TraversalDescription desc = Traversal.description()
.relationships(ExampleTypes.DEPENDS_ON, Direction.OUTGOING);
Node a = ...;
for (Node dependency : desc.traverse(a).nodes()) {
print(dependency);
}
63. So how do I find a node
to traverse from?
g!
in
ex
i nd
i ng
us
B y ?
64. So how do I find a node
to traverse from?
g!
in
ex
i nd
i ng
us
B y name: David
?
65. So how do I find a node
to traverse from?
g!
in
ex
i nd
i ng
us
B y name: David
?
David
66. So how do I find a node
to traverse from?
g! Andreas
in
ex
i nd Michael
i ng
us
B y name: David
?
David
Ed
Allison
67. Cypher Query Language
๏ Declarative query language
• Describe what you want, not how
• Based on pattern matching
๏ Examples:
START david=node:people(name=”David M”) # index lookup
MATCH david-[:knows]-()-[:knows]-foaf
WHERE foaf.age > 18
RETURN foaf
START user=node(5, 15, 26, 28) # node IDs
MATCH user--friend
RETURN user, COUNT(friend), SUM(friend.money)
30
68. Cypher Query Language (E
xp
๏ Declarative query language en er
ta im
• Describe what you want, not how l)
• Based on pattern matching
๏ Examples:
START david=node:people(name=”David M”) # index lookup
MATCH david-[:knows]-()-[:knows]-foaf
WHERE foaf.age > 18
RETURN foaf
START user=node(5, 15, 26, 28) # node IDs
MATCH user--friend
RETURN user, COUNT(friend), SUM(friend.money)
30
69. Beyond basics
๏ Graph algorithm library
• Cheapest path (Dijkstra, A*)
• Shortest path
• Simple paths
• All paths
๏ REST API access to Neo4j Standalone Server
๏ High availability and online backups
• Provides fault tolerance and horizontal scaling of reads
31
71. Spring Framework Conveniences
๏ default enterprise development framework
๏ future Java Cloud stack
๏ POJO centric application design
๏ made AspectJ aspects socially acceptable (tx-config, @Configurable)
๏ Template programming model
๏ Inversion of Control / Dependency Injection
๏ Spring Java Config, configuration XML-namespaces
๏ lots of powerful libraries and library abstractions
๏ existing, well-known persistence framework for JDBC
๏ Spring Data project
72. Programming model overview
๏ SDN is the brain child of Rod Johnson and Emil Eifrém
• Wrote functional initial prototype
• Developed by Neo Technology and SpringSource teams
๏ Uses annotations to define POJO entities
๏ Entity state backed by graph database
๏ Two modes of Object Graph Mapping
• Spring Data Mapping
• seamless object mapping leverages AspectJ
๏ Spring Roo add-on available
73. Spring Data Neo4j features
๏ Annotation-based programming model
๏ Spring Data Commons Repository support
๏ Neo4j Query (Cypher, Gremlin) and Traversal support
• on dynamic fields and via repository methods
๏ Neo4j indexing support (includes fulltext and numeric range queries)
๏ Entity types stored in the graph database as well
๏ Dynamic type projection (duck typing)
๏ Cross-store support for partial JPA / graph entities
๏ Support for JSR-303 (bean validation)
๏ Support for the Neo4j Server (remote server and in server extension)
๏ Neo4jTemplate with exception translation, optional transaction management and
more
35
74. Classic Neo4j domain class
public class Actor {
private final Node underlyingNode;
Actor( final Node node ) {
underlyingNode = node;
}
public Node getUnderlyingNode() {
return underlyingNode;
}
public final String getName() {
return (String) underlyingNode.getProperty( “name” );
}
public void setName( final String name ) {
underlyingNode.setProperty( “name”, name );
}
}
75. Spring Data Neo4j domain class
@NodeEntity
public class Actor {
@Indexed
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
76. What about relationships
@NodeEntity
class Actor {
...
public Iterable
<Movie> getMovi
final List<Movi es() {
e> movies = new
for ( Relations LinkedList<Movi
hip rel : under e>();
RelTypes.ACTS_I lyingNode.getRe
N, Direction.OU lationships(
movies.add( new TGOING ) ) {
Movie( rel.getE
Old
} ndNode() ) );
return movies;
}
class)
@RelatedTo(type="ACTS_ IN", elementClass = Movie.
;
private Set<Movie> movies
public Iterable<Movie> ge
tMovies() {
New
return movies;
}
78. Defining entity classes
• @NodeEntity
• Represents a node in the graph
• Fields saved as properties on node
• References stored as relationships between nodes
• Instantiated using Java ‘new’ keyword, like any POJO
• Also returned by lookup mechanisms
• Type information stored in the graph
80. Defining entity classes
• @RelationshipEntity
• Represents a relationship in the graph
• Fields saved as properties on relationship
• Special fields for start- and end-nodes
• Only returned by lookup methods
81. Fields in node entities (@NodeEntity)
• Primitive types and strings are directly persisted
• For all other types, Spring conversion support can be used
• Enum and Date conversion is provided out-of-the-box
• Transient fields not persisted
@NodeEntity
public class Actor {
private String name;
private int age;
private HairColor hairColor;
private transient String nickname;
}
41
82. Fields in node entities (@NodeEntity)
• Fields of types that represent a node (@NodeEntity)
42
83. Fields in node entities (@NodeEntity)
• Fields of types that represent a node (@NodeEntity)
@NodeEntity
public class Movie {}
@NodeEntity
public class Person {
private Movie favoriteMovie;
}
42
84. Fields in node entities (@NodeEntity)
• Fields of types that represent a node (@NodeEntity)
@NodeEntity
public class Movie {}
@NodeEntity
public class Person {
private Movie favoriteMovie;
}
@NodeEntity
public class Movie {
private Actor topActor;
}
@NodeEntity
public class Actor {
// Mirrors topActor in Movie
@RelatedTo(type = ”topActor”, direction = Direction.INCOMING)
private Movie wasTopActorIn;
}
42
85. Fields in node entities (@NodeEntity)
• Fields of collections of node entities: @RelatedTo
@NodeEntity
public class Movie {}
@NodeEntity
public class Actor {
@RelatedTo(type = “ACTS_IN”)
private Set<Movie> movies;
}
43
86. Fields in node entities (@NodeEntity)
๏ Fields of collections of relationship entities: @RelatedToVia
@RelationshipEntity
public class Role {
@StartNode private Actor actor;
@EndNode private Movie movie;
private String roleName;
}
@NodeEntity
public class Actor {
@RelatedToVia(type = “ACTS_IN”)
private Iterable<Role> roles;
}
๏ Read only view of relationship entities 44
87. Fields in relationship entities
(@RelationshipEntity)
• Primitive and convertible types work just the same
• @StartNode and @EndNode provide access to the start and
end node entities for the relationship entity
@RelationshipEntity
public class Role {
@StartNode private Actor actor;
@EndNode private Movie movie;
private String title;
}
88. Indexing
By annotating an entity field with @Indexed it becomes searchable:
@NodeEntity
public class Actor {
@Indexed private String name;
@Indexed private HairColor hairColor;
It can then be looked up:
GraphRepository<Actor> actorRepo =
template.repositoryFor(Actor.class);
Actor kevin =
actorRepo.findByPropertyValue(“name”, “Kevin Bacon”);
Iterable<Actor> allBlondActors =
actorRepo.findAllByPropertyValue(“hairColor”, “blond”);
89. Indexing
@NodeEntity
public class Actor {
@Indexed(type = FULLTEXT)
private String name;
๏ Index name defaults to domain class name
๏ Index key defaults to field name
๏ Fulltext and spatial index types
๏ Repository query methods for any Lucene query, including ranges:
Iterable<Actor> allKevinsOlderThan32 =
actorRepo.findAllByQuery(“name:Kevin* AND age>32”);
Iterable<Actor> youngActors =
actorRepo.findAllByRange(“age”, 3, 18);
90. Traversal
@NodeEntity
public class Actor {
@GraphTraversal(
traversalBuilder = CoactorsTraversalDescriptionBuilder.class)
private Iterable<Actor> coactors;
}
public class CoactorsTraversalDescriptionBuilder implements
FieldTraversalDescriptionBuilder {
public TraversalDescription build(...) {
return Traversal.description()
.evaluator(Evaluators.atDepth(2))
.relationships(RelTypes.ACTS_IN);
}
}
Example for dynamic field computation
48
91. Cypher query language
@NodeEntity
public class Actor {
@Query(“START actor=({self}) ” +
“MATCH (actor)-[:ACTS_IN]->(movie)<-[:ACTS_IN]-(coactor) ” +
“RETURN coactor”)
private Iterable<Actor> coactors;
}
@NodeEntity
public class Actor {
@Query(“START actor=({self}) ” +
“MATCH (actor)-[:ACTS_IN]->(movie)<-[:ACTS_IN]-(coactor) ” +
“RETURN movie.title, coactor.name”)
private Iterable<Map<String, Object>> movieCoactorPairs;
}
49
92. Spring-Data-Mapping
๏ Based on Spring-Data-Commons infrastructure
• Extract Mapping Meta Information
‣Neo4jPersistentEntity, Neo4jPersistentProperty
• Entity-Converter Implementations for Object-Graph-Mapping
‣Type-resolution
‣Entity construction
‣Transfer properties
‣loaed for eagerly fetched relationships
• Neo4j-Template for Graph-Interaction
50
93. AspectJ
๏ Introduces interface to entities:
• NodeBacked into @NodeEntity classes
• RelationshipBacked into @RelationshipEntity classes
๏ NodeBacked introduces methods such as:
• relateTo
• findByQuery
• findAllByTraversal
• ...
๏ going to be pulled out in separate Active-Record-Mixin
51
94. AspectJ - Tooling
๏ IDE‘s
• latest versions of STS / Eclipse with current AJDT plugin
• IntelliJ IDEA 10.5 compile + run, some editor quirks
‣full AspectJ support in IDEA 11
๏ Build Systems
• Maven
• Gradle
• Ant / Ivy
• ...
52
95. AspectJ - NodeBacked.relateTo
<T extends RelationshipBacked> T NodeBacked.relateTo(
NodeBacked node,
Class<T> relationshipEntityType,
String relationshipType
);
usage:
@NodeEntity
public class Actor {
public Role actsIn(Movie movie, String roleName) {
Role role = relateTo(movie, Role.class, “ACTS_IN”);
role.setName(roleName);
return role;
}
}
53
96. Interface based Repositories
๏ based on Repository infrastructure in Spring Data Commons
๏ just define the interface and the namespace configuration
๏ provide out-of-the-box support for
• CRUD-Operations
• Index-Lookups
• Traversal-Execution
• Graph-Queries (Cypher, Gremlin)
• derived Queries
• Spatial Queries
๏ extensible via custom methods with provided implementations
54
97. Repositories
interface MovieRepository extends GraphRepository<Movie> {
Movie findById(String id);
Page<Movie> findByTitle(String title, Pageable page);
}
<neo4j:repositories base-package=“com.example.repositories„/
@Controller
public class MovieController {
@Autowired MovieRepository moviesRepository;
@RequestMapping(value = "/movies/{movieId}",...)
public String show(Model model, @PathVariable String movieId) {
Movie movie = moviesRepository.findByPropertyValue("id", movieId);
Movie movie = moviesRepository.findById(movieId);
model.addAttribute("movie", movie);
return "/movies/show";
}}
55
99. Repository-Query-Support
interface MovieRepository extends GraphRepository<Movie> {
@Query("start m=({movie}) match m-[ACTS_IN]-actor return actor")
Iterable<Actor> getActorsCypher(@Param("movie") Movie m);
@Query("start movie =({0}) match (movie)<-[role:ACTS_IN]-(actor)
return actor.name, role.title")
Iterable<Map<String,Object>> getCast(Movie m);
@Query(value = "g.v(movie).out('ACTS_IN')", type = QueryType.Gremlin)
Iterable<Person> getActorsGremlin(@Param("movie") Movie m);
}
57
100. Neo4j-Template (I)
๏ well known Spring Template Pattern
๏ Resource / Transaction Management
๏ Convenience Methods
๏ Nodes and Entities handling & conversion
๏ Fluent Query Result Handling
๏ Works also via REST with Neo4j-Server
๏ Exception Translation
58
101. Neo4j-Template (II)
template.lookup("node", "name", "David")
.to(String.class, new PropertyContainerNameConverter()).single()
template.traverse(node, traversal)
.to(Integer.class,new ResultConverter<Path,Integer>() {
public Integer convert(Path path, Class<String> type) {
return path.length();
}})
template.query("start movie=(Movies,title, {m}) match movie-->actor return actor",
map("m","Matrix")).to(Actor.class)
template.execute("g.v(ref).outE", map("ref",0)).to(Relationship.class)
59
102. REST-Client-Support
<bean id="restGraphDatabaseService"
class="org.sf.data.neo4j.rest.SpringRestGraphDatabase">
<constructor-arg value="http://localhost:7473/db/data" />
</bean>
<datagraph:config graphDatabaseService="restGraphDatabaseService"/>
๏ drop-in replacement for the embedded GraphDatabase
๏ works transparently with POJO-Entity-Mapping and
Neo4j-Template
60
103. REST-Server-Support
public class HelloWorldInitializer extends SpringPluginInitializer {
public HelloWorldInitializer() {
super(new String[]{"spring/helloWorldServer-Context.xml"},
Pair.of("worldRepository", WorldRepository.class),
Pair.of("graphRepositoryFactory",
GraphRepositoryFactory.class));
}
}
๏ integrate Spring Data Neo4j config with already running
Graph-Database in Neo4j-Server
๏ expose Spring Beans as Jersey Injectables
61
105. A scenario...
You have a traditional web app using JPA to persist data to a relational
database
106. Option C: Introducing cross-store
persistence
๏ JPA data and NOSQL data can share a data model
๏ Could be the entire entity, or some fields of an entity
๏ We call this cross-store persistence
• One transaction managerdatabase the NOSQL database
with the JPA relational
to coordinate
• AspectJ support to manage the NOSQL entities and fields
107. The 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;
108. Adding 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;
109. Adding 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;
110. Adding 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;
111. Adding 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;
112. Adding 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;
113. Spring Data Neo4j Roo add-on
๏ Roo adding support for non-JPA
persistence providers
๏ Spring Data Neo4j was the first
NOSQL persistence Roo
Add-On
๏ See the chapter on Spring Data
Neo4j in the latest O’Reilly
Roo book, Getting Started with
Roo.
67
114. Spring Data Neo4j Roo add-on
roo> project --topLevelPackage org.neo4j.imdb
roo> graph setup --provider NEO4J --databaseLocation target/imdb
roo> graph entity --class ~.model.Movie
roo> field string title
roo> field number --fieldName year --type java.lang.Integer --permitReservedWords --primitive
roo> graph entity --class ~.model.Actor
roo> field string name
roo> graph relationship --to Movie --from Actor --fieldName movies --type ACTS_IN
--cardinality ONE_TO_MANY
roo> graph relationship --via ~.model.Role --to Movie --from Actor --fieldName roles
--type ACTS_IN --cardinality ONE_TO_MANY
roo> graph relationship --from Movie --to Actor --type ACTS_IN --fieldName actors
--direction INCOMING --cardinality MANY_TO_ONE
roo> field string --fieldName title --class ~.model.Role
roo> controller scaffold --class ~.web.ActorController --entity ~.model.Actor
roo> controller scaffold --class ~.web.MovieController --entity ~.model.Movie
68
115. Spring Data Neo4j Guidebook
“Good Relationships”
“I’m excited about Spring Data Neo4j.... Spring Data Neo4j makes working
with Neo4j amazingly easy, and therefore has the potential to make you
more successful as a developer.”
Rod Johnson, founder of Spring
๏ Spring Data Neo4j comes with a great Guide Book, featuring:
• Forewords by Rod Johnson and Emil Eifrem
• An easy to read, narrative tutorial walkthrough for cineasts.net
• A comprehensive reference for all the details
• Check it out here: http://spring.neo4j.org/guide
69
116. The end (and the beginning!)
๏ See the Spring Data Neo4j site for more info:
http://spring.neo4j.org
๏ Check out the developer notes at GitHub:
http://spring.neo4j.org/notes
๏ Again, don’t miss our fantastic e-book on Spring Data Neo4j:
http://spring.neo4j.org/guide
๏ Spring Data Forum at
http://spring.neo4j.org/discussions
๏ All about Neo4j:
http://neo4j.org
๏ Neo4j videos and webinars:
http://video.neo4j.org
social networks (our actions in them work life health)\nthe internet\nits hardware\nits software\nour interactions\nour body\nnature environment\npolitical economic networks\nzusammenhaenge\nhistory\nscience\nzeit gr&#xFC;nen abgeordneter handy\n
social networks (our actions in them work life health)\nthe internet\nits hardware\nits software\nour interactions\nour body\nnature environment\npolitical economic networks\nzusammenhaenge\nhistory\nscience\nzeit gr&#xFC;nen abgeordneter handy\n
messy world\nfast changing world\nbez um graph sind teil der daten\nim rdbms teil des starren schemas\nkomplexe zusammenhaenge\nkomplexe fragen\nimmer neue kategorien - rels\ndynamisch - traversals\ntags attribute\ntemporale attribute\ndyn sprachen besser geeignet \n
messy world\nfast changing world\nbez um graph sind teil der daten\nim rdbms teil des starren schemas\nkomplexe zusammenhaenge\nkomplexe fragen\nimmer neue kategorien - rels\ndynamisch - traversals\ntags attribute\ntemporale attribute\ndyn sprachen besser geeignet \n
messy world\nfast changing world\nbez um graph sind teil der daten\nim rdbms teil des starren schemas\nkomplexe zusammenhaenge\nkomplexe fragen\nimmer neue kategorien - rels\ndynamisch - traversals\ntags attribute\ntemporale attribute\ndyn sprachen besser geeignet \n
\n
\n
\n
\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
Neo4j is a graph database. \n\nNodes, rels, key-value props on nodes and rels.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
... so like I&#x2019;m a node, Thomas is a node, and there&#x2019;s a PRESENTED_WITH relationship between us.\n
schema-free evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
evolve data separately\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
Traversing is great, but it needs to start from somewhere. How do we find that place?\n
\n
\n
\n
No need for persistence contexts or entity managers.\n\n
No need for persistence contexts or entity managers.\n\n
\n
Jumping right into code\n
\n
\n
\n
\n
Anonymous relationships\n
Anonymous relationships\n
Anonymous relationships\n
Anonymous relationships\n
Anonymous relationships\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
This does not apply to Neo4j.\nIn Neo4j, transactions MUST be used.\n