SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
larus-ba.it/neo4j
@AgileLARUS
Andrea Santurbano / @santand84
#GraphRM
Roma, 12/07/2019
How to leverage Apache Kafka data streams
with Neo4j
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
WHO AM I?
Andrea
[:WORKS_AT]
[:LOVES]
[:INTEGRATOR_LEADER_FOR]
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
WHO’S LARUS?
LARUS BUSINESS AUTOMATION
● Founded in 2004
● Headquartered in Venice, ITALY
● Delivering services Worldwide
● Mission: “Bridging the gap between Business and IT”
#1 Solution Partner in Italy since 2013
● Creator of the Neo4j JDBC Driver
● Creator of the Neo4j Apache Zeppelin Interpreter
● Creator of the Neo4j ETL Tool
● Developed 90+ APOC
VENICE
[:BASED_IN]
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
INTEGRATOR LEADERS FOR NEO4J
2016
Neo4j JDBC Driver
20152011
First Spikes
in Retail for
Articles’
Clustering
2014 2018
Neo4j APOC, ETL, Spark, Zeppelin, Kafka
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
WE ARE HIRING!
[:HIRES]
We’re looking for PASSIONATE java DEVELOPERS
to WORK on CHALLENGING PROJECTS
with CUTTING EDGE TECHNOLOGIES (such as Kafka and Neo4j)
(in Rome and Pescara)
larus-ba.it/neo4j
@AgileLARUS
Agenda
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Agenda
● What is Neo4j Streams?
○ What is Apache Kafka?
○ How we combined Neo4j and Kafka?
● The Change Data Capture Module
○ DEMO
● The Streams Procedure
○ DEMO
● The Sink
○ DEMO
larus-ba.it/neo4j
@AgileLARUS
Enables Kafka Streaming on Neo4j!
What is Neo4j Streams?
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
What is Apache Kafka?
A DISTRIBUTED STREAMING PLATFORM
Has three key capabilities:
● Publish and subscribe to streams of records;
● Store streams of records in a fault-tolerant
durable way;
● Process streams of records as they occur.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
What is Apache Kafka?
HOW IT WORKS?
1. TOPICS: a topic is a category or feed name to
which records are published.
2. PARTITIONS: for each topic, the Kafka cluster
maintains a partitioned log
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
What is Apache Kafka?
HOW IT’S USED?
Kafka is generally used for two classes of
applications:
● Building real-time streaming data pipelines;
● Building real-time streaming applications.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
What is Neo4j Streams?
Andrea
[:AUTHOR_OF][:CREATOR_OF] X
Michael
ENABLES DATA STREAM ON NEO4J
The project is a Neo4j Plugin composed of several parts:
● Neo4j Streams Change Data Capture;
● Neo4j Streams Sink;
● Neo4j Streams Procedures
We also have a Kafka Connect Plugin:
● Kafka Connect Sink plugin.
larus-ba.it/neo4j
@AgileLARUS
Stream database changes!
Neo4j Streams: Change Data Capture
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Change Data Capture
Change data “what”?
In databases, Change Data Capture (CDC) is a set of software design patterns used to determine (and
track) the data that has changed so an action can be taken using the changed data.
Well suited use-cases?
● CDC solutions occur most often in data-warehouse environments;
● Allows to replicate databases without having a/much performance impact on its operation.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Change Data Capture
How it works?
Each transaction communicates its changes to our event listener:
● exposing creation, updates and deletes of Nodes and Relationships
● providing before-and-after information
● configuring property filtering for each topic
Those events are sent asynchronously to Kafka, so the commit path should not be influenced by that.
larus-ba.it/neo4j
@AgileLARUS
Neo4j Streams: Change Data Capture
DEMO
larus-ba.it/neo4j
@AgileLARUS
Interact with Apache Kafka directly from Cypher!
Neo4j Streams: Procedures
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Streams Procedures
CONSUME/PRODUCE DATA DIRECTLY FROM CYPHER
The Neo4j Streams project comes out with two procedures:
● streams.publish: allows custom message streaming from Neo4j to the configured environment by
using the underlying configured Producer;
● streams.consume: allows consuming messages from a given topic.
larus-ba.it/neo4j
@AgileLARUS
Neo4j Streams: Streams Procedures
DEMO
larus-ba.it/neo4j
@AgileLARUS
Ingest data into Neo4j directly from the Stream!
Neo4j Streams: Sink
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGEST YOUR DATA, WITH YOUR RULES
The sink provides several ways in order to ingest data from Kafka:
● Via Cypher Template
● Via CDC event published by another Neo4j Instance via the CDC module
● Via projection of a JSON event into Node/Relationship by providing an extraction pattern
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGEST YOUR DATA, WITH YOUR RULES
Initially, we thought about a generic consumer with a fixed projection of events into Nodes and
Relationships.
We decided that instead, we want to give the user the power to use custom Cypher statements per topic
to turn Events into arbitrary graph structures.
So you can choose by yourself what to do with a complex Kafka event. Which parts of it you want to use
for which purpose.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGESTION VIA CYPHER TEMPLATE
Besides your Kafka connection information, you just add entries like this to your Neo4j config.
streams.sink.topic.cypher.<TOPIC>=<CYPHER_QUERY>
For example:
streams.sink.topic.cypher.my-topic=MERGE (n:Label {id: event.id}) ON CREATE
SET n += event.properties
Under the hood, the consumer takes a batch of Events and passes them as $batch parameter to the
Cypher statement, which we prefix with an UNWIND, so each individual entry is available as `event`
identifier to your statement. So the final statement executed by us would look like this:
UNWIND $batch AS event
MERGE (n:Label {id: event.id})
ON CREATE SET n += event.properties
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGESTION VIA CDC EVENT FROM ANOTHER NEO4J INSTANCE
We allow ingesting the data in two ways:
● The SourceId strategy which merges the nodes/relationships by the CDC event `id` field (it's related to
the Neo4j physical ID)
streams.sink.topic.cdc.sourceId=<TOPICS_SEPARATED_BY_SEMICOLON>
● The Schema strategy which merges the nodes/relationships by the constraints (UNIQUENESS,
NODE_KEY) defined in your graph model
streams.sink.topic.cdc.schema=<TOPICS_SEPARATED_BY_SEMICOLON>
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGESTION VIA JSON PROJECTION
You can extract nodes and relationships from a JSON by providing a extraction pattern.
Each property can be prefixed with:
● !: identify the id (could be more than one property), it's *mandatory*
● -: exclude the property from the extraction
● Labels can be chained via :
Tombstone Record Management
This ingestion strategy come out with the support to the Tombstone Record, in order to leverage it your
event should contain as key the record that you want to delete and `null` for the value.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGESTION VIA JSON PROJECTION - NODE PATTERN EXTRACTION
Given:
{"userId": 1, "name": "Andrea", "surname": "Santurbano", "address": {"city": "Venice", "cap": "30100"}}
You can transform it into a node by specifying one of these patterns:
● User:Actor{!userId} or User:Actor{!userId,*} => (User:Actor{userId: 1, name: 'Andrea', surname:
'Santurbano', `address.city`: 'Venice', `address.cap`: 30100})
● User{!userId, surname} => (User:Actor{userId: 1, surname: 'Santurbano'})
● User{!userId, surname, address.city} => (User:Actor{userId: 1, surname: 'Santurbano', `address.city`:
'Venice'})
● User{!userId,-address} => (User:Actor{userId: 1, name: 'Andrea', surname: 'Santurbano'})
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
INGESTION VIA JSON PROJECTION - RELATIONSHIP PATTERN EXTRACTION
Given:
{"userId": 1, "productId": 100, "price": 10, "currency": "€", "shippingAddress": {"city": "Venice", cap: "30100"}}
You can transform it into a relationship by specifying one of these patterns:
● (User{!userId})-[:BOUGHT]->(Product{!productId}) or (User{!userId})-[:BOUGHT{price,
currency}]->(Product{!productId}) => (User{userId: 1})-[:BOUGHT{price: 10, currency: '€',
`shippingAddress.city`: 'Venice', `shippingAddress.cap`: 30100}]->(Product{productId: 100})
● (User{!userId})-[:BOUGHT{price}]->(Product{!productId}) => (User{userId: 1})-[:BOUGHT{price:
10}]->(Product{productId: 100})
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Sink
HOW WE MANAGE BAD DATA
The Neo4j Streams Sink module provide a Dead Letter Queue mechanism that if activated re-route all
“bad-data” to a configured topic.
What we mean for “bad-data”?
● De-Serialization errors. I.e. bad formatted JSON:
{id: 1, "name": "Andrea", "surname": "Santurbano"}
● Transient errors while ingesting data into the DB.
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Kafka Connect Sink
WHAT IS KAFKA CONNECT?
In open source component of Apache Kafka, is a
framework for connecting Kafka with external
systems such as databases, key-value stores,
search indexes, and file systems.
HOW IT WORKS?
It works exactly in the same way as the Neo4j Sink
plugin so you can provide for each topic your own
Cypher query.
You can download it from the Confluent HUB!
And it has the Verified GOLD badge!
larus-ba.it/neo4j
@AgileLARUS
Real-time Polyglot Persistence with
Elastic, Kafka and Neo4j
DEMO
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
RT Polyglot Persistence with Elastic, Kafka & Neo4j
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
RT Polyglot Persistence with Elastic, Kafka & Neo4j
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
Neo4j Streams: Lessons learned
THE POWER OF THE STREAM!
● We have seen how to use the CDC in order to
stream transaction events from Neo4j to other
systems;
● We have seen how to use the SINK in order to
ingest data into Neo4j by providing our own
business rules;
● We have seen how to use the Streams
PROCEDURES in order to consume/produce
data directly from Cypher.
larus-ba.it/neo4j
@AgileLARUS
Community feedback & Beyond Kafka
What’s next?
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
GIVE US FEEDBACK
PROVIDE US FEEDBACK
If you plan to use the Streams Plugin please give us a feedback!
https://github.com/neo4j-contrib/neo4j-streams
LARUS Business Automation Srl Italy’s #1 Neo4j Partner
CODE REPOSITORY
https://github.com/conker84/kafka-rome-june-2k19
larus-ba.it/neo4j
@AgileLARUS
THANKS!
#GraphRM
Roma, 12/07/2019
Andrea Santurbano
andrea.santurbano@larus-ba.it / @santand84

Contenu connexe

Tendances

Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use CasesMax De Marzi
 
Graphs for Enterprise Architects
Graphs for Enterprise ArchitectsGraphs for Enterprise Architects
Graphs for Enterprise ArchitectsNeo4j
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergWalaa Eldin Moustafa
 
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and HadoopGoogle Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoophuguk
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAltinity Ltd
 
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures LibraryAPOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Libraryjexp
 
Logical Replication in PostgreSQL
Logical Replication in PostgreSQLLogical Replication in PostgreSQL
Logical Replication in PostgreSQLEDB
 
Siligong.Data - May 2021 - Transforming your analytics workflow with dbt
Siligong.Data - May 2021 - Transforming your analytics workflow with dbtSiligong.Data - May 2021 - Transforming your analytics workflow with dbt
Siligong.Data - May 2021 - Transforming your analytics workflow with dbtJon Su
 
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops Team
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops TeamTop-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops Team
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops TeamMydbops
 
Linking Metrics to Logs using Loki
Linking Metrics to Logs using LokiLinking Metrics to Logs using Loki
Linking Metrics to Logs using LokiKnoldus Inc.
 
DIY Netflow Data Analytic with ELK Stack by CL Lee
DIY Netflow Data Analytic with ELK Stack by CL LeeDIY Netflow Data Analytic with ELK Stack by CL Lee
DIY Netflow Data Analytic with ELK Stack by CL LeeMyNOG
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Altinity Ltd
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overviewNeo4j
 
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxGraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxjexp
 
How to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOCHow to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOCNeo4j
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
 
5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-ReadyEDB
 
Graph-Based Network Topology Analysis for Telecom Operators
Graph-Based Network Topology Analysis for Telecom OperatorsGraph-Based Network Topology Analysis for Telecom Operators
Graph-Based Network Topology Analysis for Telecom OperatorsNeo4j
 
Top 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & TricksTop 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & TricksNeo4j
 
Vectorized Query Execution in Apache Spark at Facebook
Vectorized Query Execution in Apache Spark at FacebookVectorized Query Execution in Apache Spark at Facebook
Vectorized Query Execution in Apache Spark at FacebookDatabricks
 

Tendances (20)

Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
Graphs for Enterprise Architects
Graphs for Enterprise ArchitectsGraphs for Enterprise Architects
Graphs for Enterprise Architects
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and Iceberg
 
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and HadoopGoogle Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdf
 
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures LibraryAPOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
 
Logical Replication in PostgreSQL
Logical Replication in PostgreSQLLogical Replication in PostgreSQL
Logical Replication in PostgreSQL
 
Siligong.Data - May 2021 - Transforming your analytics workflow with dbt
Siligong.Data - May 2021 - Transforming your analytics workflow with dbtSiligong.Data - May 2021 - Transforming your analytics workflow with dbt
Siligong.Data - May 2021 - Transforming your analytics workflow with dbt
 
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops Team
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops TeamTop-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops Team
Top-10-Features-In-MySQL-8.0 - Vinoth Kanna RS - Mydbops Team
 
Linking Metrics to Logs using Loki
Linking Metrics to Logs using LokiLinking Metrics to Logs using Loki
Linking Metrics to Logs using Loki
 
DIY Netflow Data Analytic with ELK Stack by CL Lee
DIY Netflow Data Analytic with ELK Stack by CL LeeDIY Netflow Data Analytic with ELK Stack by CL Lee
DIY Netflow Data Analytic with ELK Stack by CL Lee
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overview
 
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxGraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
 
How to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOCHow to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOC
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready
 
Graph-Based Network Topology Analysis for Telecom Operators
Graph-Based Network Topology Analysis for Telecom OperatorsGraph-Based Network Topology Analysis for Telecom Operators
Graph-Based Network Topology Analysis for Telecom Operators
 
Top 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & TricksTop 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & Tricks
 
Vectorized Query Execution in Apache Spark at Facebook
Vectorized Query Execution in Apache Spark at FacebookVectorized Query Execution in Apache Spark at Facebook
Vectorized Query Execution in Apache Spark at Facebook
 

Similaire à How to leverage Kafka data streams with Neo4j

Neo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache KafkaNeo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache Kafkajexp
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular jsMindfire Solutions
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsSriskandarajah Suhothayan
 
Monitoring Cloud Native Applications with Prometheus
Monitoring Cloud Native Applications with PrometheusMonitoring Cloud Native Applications with Prometheus
Monitoring Cloud Native Applications with PrometheusJacopo Nardiello
 
Dataiku meetup 12 july 2018 Amsterdam
Dataiku meetup 12 july 2018 AmsterdamDataiku meetup 12 july 2018 Amsterdam
Dataiku meetup 12 july 2018 AmsterdamLonghow Lam
 
Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021Leadex Systems
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsNicholas Jansma
 
SplunkLive! Milano 2016 - customer presentation - Unicredit
SplunkLive! Milano 2016 -  customer presentation - UnicreditSplunkLive! Milano 2016 -  customer presentation - Unicredit
SplunkLive! Milano 2016 - customer presentation - UnicreditSplunk
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j
 
NSA for Enterprises Log Analysis Use Cases
NSA for Enterprises   Log Analysis Use Cases NSA for Enterprises   Log Analysis Use Cases
NSA for Enterprises Log Analysis Use Cases WSO2
 
OpenWhisk - A platform for cloud native, serverless, event driven apps
OpenWhisk - A platform for cloud native, serverless, event driven appsOpenWhisk - A platform for cloud native, serverless, event driven apps
OpenWhisk - A platform for cloud native, serverless, event driven appsDaniel Krook
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docxfantabulous2024
 
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...jexp
 

Similaire à How to leverage Kafka data streams with Neo4j (20)

Neo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache KafkaNeo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache Kafka
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needs
 
Monitoring Cloud Native Applications with Prometheus
Monitoring Cloud Native Applications with PrometheusMonitoring Cloud Native Applications with Prometheus
Monitoring Cloud Native Applications with Prometheus
 
Dataiku meetup 12 july 2018 Amsterdam
Dataiku meetup 12 july 2018 AmsterdamDataiku meetup 12 july 2018 Amsterdam
Dataiku meetup 12 july 2018 Amsterdam
 
Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
 
SplunkLive! Milano 2016 - customer presentation - Unicredit
SplunkLive! Milano 2016 -  customer presentation - UnicreditSplunkLive! Milano 2016 -  customer presentation - Unicredit
SplunkLive! Milano 2016 - customer presentation - Unicredit
 
Colloquium Report
Colloquium ReportColloquium Report
Colloquium Report
 
icv
icvicv
icv
 
ChandanResume
ChandanResumeChandanResume
ChandanResume
 
Django by rj
Django by rjDjango by rj
Django by rj
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform Overview
 
NSA for Enterprises Log Analysis Use Cases
NSA for Enterprises   Log Analysis Use Cases NSA for Enterprises   Log Analysis Use Cases
NSA for Enterprises Log Analysis Use Cases
 
OpenWhisk - A platform for cloud native, serverless, event driven apps
OpenWhisk - A platform for cloud native, serverless, event driven appsOpenWhisk - A platform for cloud native, serverless, event driven apps
OpenWhisk - A platform for cloud native, serverless, event driven apps
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
Zakir_Hussain_cv
Zakir_Hussain_cvZakir_Hussain_cv
Zakir_Hussain_cv
 
Data Modeling in SAP Gateway – maximize performance at all levels
Data Modeling in SAP Gateway – maximize performance at all levelsData Modeling in SAP Gateway – maximize performance at all levels
Data Modeling in SAP Gateway – maximize performance at all levels
 
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
 
Index
IndexIndex
Index
 

Plus de GraphRM

A gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksA gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksGraphRM
 
From zero to gremlin hero - Part I
From zero to gremlin hero - Part IFrom zero to gremlin hero - Part I
From zero to gremlin hero - Part IGraphRM
 
Topology Visualization at Sysdig
Topology Visualization at SysdigTopology Visualization at Sysdig
Topology Visualization at SysdigGraphRM
 
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...GraphRM
 
aRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RaRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RGraphRM
 
The power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDBThe power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDBGraphRM
 
OrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancanteOrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancanteGraphRM
 
Il "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione ItalianaIl "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione ItalianaGraphRM
 
Elastic loves Graphs
Elastic loves GraphsElastic loves Graphs
Elastic loves GraphsGraphRM
 
From text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge GraphsFrom text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge GraphsGraphRM
 
Graph analysis over relational database
Graph analysis over relational databaseGraph analysis over relational database
Graph analysis over relational databaseGraphRM
 
GraphRM - Introduzione al Graph modelling
GraphRM  - Introduzione al Graph modellingGraphRM  - Introduzione al Graph modelling
GraphRM - Introduzione al Graph modellingGraphRM
 
GraphQL ♥︎ GraphDB
GraphQL ♥︎ GraphDBGraphQL ♥︎ GraphDB
GraphQL ♥︎ GraphDBGraphRM
 
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018GraphRM
 

Plus de GraphRM (14)

A gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksA gentle introduction to random and strategic networks
A gentle introduction to random and strategic networks
 
From zero to gremlin hero - Part I
From zero to gremlin hero - Part IFrom zero to gremlin hero - Part I
From zero to gremlin hero - Part I
 
Topology Visualization at Sysdig
Topology Visualization at SysdigTopology Visualization at Sysdig
Topology Visualization at Sysdig
 
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
 
aRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RaRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con R
 
The power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDBThe power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDB
 
OrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancanteOrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancante
 
Il "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione ItalianaIl "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione Italiana
 
Elastic loves Graphs
Elastic loves GraphsElastic loves Graphs
Elastic loves Graphs
 
From text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge GraphsFrom text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge Graphs
 
Graph analysis over relational database
Graph analysis over relational databaseGraph analysis over relational database
Graph analysis over relational database
 
GraphRM - Introduzione al Graph modelling
GraphRM  - Introduzione al Graph modellingGraphRM  - Introduzione al Graph modelling
GraphRM - Introduzione al Graph modelling
 
GraphQL ♥︎ GraphDB
GraphQL ♥︎ GraphDBGraphQL ♥︎ GraphDB
GraphQL ♥︎ GraphDB
 
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
 

Dernier

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

How to leverage Kafka data streams with Neo4j

  • 1. larus-ba.it/neo4j @AgileLARUS Andrea Santurbano / @santand84 #GraphRM Roma, 12/07/2019 How to leverage Apache Kafka data streams with Neo4j
  • 2. LARUS Business Automation Srl Italy’s #1 Neo4j Partner WHO AM I? Andrea [:WORKS_AT] [:LOVES] [:INTEGRATOR_LEADER_FOR]
  • 3. LARUS Business Automation Srl Italy’s #1 Neo4j Partner WHO’S LARUS? LARUS BUSINESS AUTOMATION ● Founded in 2004 ● Headquartered in Venice, ITALY ● Delivering services Worldwide ● Mission: “Bridging the gap between Business and IT” #1 Solution Partner in Italy since 2013 ● Creator of the Neo4j JDBC Driver ● Creator of the Neo4j Apache Zeppelin Interpreter ● Creator of the Neo4j ETL Tool ● Developed 90+ APOC VENICE [:BASED_IN]
  • 4. LARUS Business Automation Srl Italy’s #1 Neo4j Partner INTEGRATOR LEADERS FOR NEO4J 2016 Neo4j JDBC Driver 20152011 First Spikes in Retail for Articles’ Clustering 2014 2018 Neo4j APOC, ETL, Spark, Zeppelin, Kafka
  • 5. LARUS Business Automation Srl Italy’s #1 Neo4j Partner WE ARE HIRING! [:HIRES] We’re looking for PASSIONATE java DEVELOPERS to WORK on CHALLENGING PROJECTS with CUTTING EDGE TECHNOLOGIES (such as Kafka and Neo4j) (in Rome and Pescara)
  • 7. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Agenda ● What is Neo4j Streams? ○ What is Apache Kafka? ○ How we combined Neo4j and Kafka? ● The Change Data Capture Module ○ DEMO ● The Streams Procedure ○ DEMO ● The Sink ○ DEMO
  • 8. larus-ba.it/neo4j @AgileLARUS Enables Kafka Streaming on Neo4j! What is Neo4j Streams?
  • 9. LARUS Business Automation Srl Italy’s #1 Neo4j Partner What is Apache Kafka? A DISTRIBUTED STREAMING PLATFORM Has three key capabilities: ● Publish and subscribe to streams of records; ● Store streams of records in a fault-tolerant durable way; ● Process streams of records as they occur.
  • 10. LARUS Business Automation Srl Italy’s #1 Neo4j Partner What is Apache Kafka? HOW IT WORKS? 1. TOPICS: a topic is a category or feed name to which records are published. 2. PARTITIONS: for each topic, the Kafka cluster maintains a partitioned log
  • 11. LARUS Business Automation Srl Italy’s #1 Neo4j Partner What is Apache Kafka? HOW IT’S USED? Kafka is generally used for two classes of applications: ● Building real-time streaming data pipelines; ● Building real-time streaming applications.
  • 12. LARUS Business Automation Srl Italy’s #1 Neo4j Partner What is Neo4j Streams? Andrea [:AUTHOR_OF][:CREATOR_OF] X Michael ENABLES DATA STREAM ON NEO4J The project is a Neo4j Plugin composed of several parts: ● Neo4j Streams Change Data Capture; ● Neo4j Streams Sink; ● Neo4j Streams Procedures We also have a Kafka Connect Plugin: ● Kafka Connect Sink plugin.
  • 14. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Change Data Capture Change data “what”? In databases, Change Data Capture (CDC) is a set of software design patterns used to determine (and track) the data that has changed so an action can be taken using the changed data. Well suited use-cases? ● CDC solutions occur most often in data-warehouse environments; ● Allows to replicate databases without having a/much performance impact on its operation.
  • 15. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Change Data Capture How it works? Each transaction communicates its changes to our event listener: ● exposing creation, updates and deletes of Nodes and Relationships ● providing before-and-after information ● configuring property filtering for each topic Those events are sent asynchronously to Kafka, so the commit path should not be influenced by that.
  • 17. larus-ba.it/neo4j @AgileLARUS Interact with Apache Kafka directly from Cypher! Neo4j Streams: Procedures
  • 18. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Streams Procedures CONSUME/PRODUCE DATA DIRECTLY FROM CYPHER The Neo4j Streams project comes out with two procedures: ● streams.publish: allows custom message streaming from Neo4j to the configured environment by using the underlying configured Producer; ● streams.consume: allows consuming messages from a given topic.
  • 20. larus-ba.it/neo4j @AgileLARUS Ingest data into Neo4j directly from the Stream! Neo4j Streams: Sink
  • 21. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGEST YOUR DATA, WITH YOUR RULES The sink provides several ways in order to ingest data from Kafka: ● Via Cypher Template ● Via CDC event published by another Neo4j Instance via the CDC module ● Via projection of a JSON event into Node/Relationship by providing an extraction pattern
  • 22. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGEST YOUR DATA, WITH YOUR RULES Initially, we thought about a generic consumer with a fixed projection of events into Nodes and Relationships. We decided that instead, we want to give the user the power to use custom Cypher statements per topic to turn Events into arbitrary graph structures. So you can choose by yourself what to do with a complex Kafka event. Which parts of it you want to use for which purpose.
  • 23. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGESTION VIA CYPHER TEMPLATE Besides your Kafka connection information, you just add entries like this to your Neo4j config. streams.sink.topic.cypher.<TOPIC>=<CYPHER_QUERY> For example: streams.sink.topic.cypher.my-topic=MERGE (n:Label {id: event.id}) ON CREATE SET n += event.properties Under the hood, the consumer takes a batch of Events and passes them as $batch parameter to the Cypher statement, which we prefix with an UNWIND, so each individual entry is available as `event` identifier to your statement. So the final statement executed by us would look like this: UNWIND $batch AS event MERGE (n:Label {id: event.id}) ON CREATE SET n += event.properties
  • 24. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGESTION VIA CDC EVENT FROM ANOTHER NEO4J INSTANCE We allow ingesting the data in two ways: ● The SourceId strategy which merges the nodes/relationships by the CDC event `id` field (it's related to the Neo4j physical ID) streams.sink.topic.cdc.sourceId=<TOPICS_SEPARATED_BY_SEMICOLON> ● The Schema strategy which merges the nodes/relationships by the constraints (UNIQUENESS, NODE_KEY) defined in your graph model streams.sink.topic.cdc.schema=<TOPICS_SEPARATED_BY_SEMICOLON>
  • 25. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGESTION VIA JSON PROJECTION You can extract nodes and relationships from a JSON by providing a extraction pattern. Each property can be prefixed with: ● !: identify the id (could be more than one property), it's *mandatory* ● -: exclude the property from the extraction ● Labels can be chained via : Tombstone Record Management This ingestion strategy come out with the support to the Tombstone Record, in order to leverage it your event should contain as key the record that you want to delete and `null` for the value.
  • 26. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGESTION VIA JSON PROJECTION - NODE PATTERN EXTRACTION Given: {"userId": 1, "name": "Andrea", "surname": "Santurbano", "address": {"city": "Venice", "cap": "30100"}} You can transform it into a node by specifying one of these patterns: ● User:Actor{!userId} or User:Actor{!userId,*} => (User:Actor{userId: 1, name: 'Andrea', surname: 'Santurbano', `address.city`: 'Venice', `address.cap`: 30100}) ● User{!userId, surname} => (User:Actor{userId: 1, surname: 'Santurbano'}) ● User{!userId, surname, address.city} => (User:Actor{userId: 1, surname: 'Santurbano', `address.city`: 'Venice'}) ● User{!userId,-address} => (User:Actor{userId: 1, name: 'Andrea', surname: 'Santurbano'})
  • 27. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink INGESTION VIA JSON PROJECTION - RELATIONSHIP PATTERN EXTRACTION Given: {"userId": 1, "productId": 100, "price": 10, "currency": "€", "shippingAddress": {"city": "Venice", cap: "30100"}} You can transform it into a relationship by specifying one of these patterns: ● (User{!userId})-[:BOUGHT]->(Product{!productId}) or (User{!userId})-[:BOUGHT{price, currency}]->(Product{!productId}) => (User{userId: 1})-[:BOUGHT{price: 10, currency: '€', `shippingAddress.city`: 'Venice', `shippingAddress.cap`: 30100}]->(Product{productId: 100}) ● (User{!userId})-[:BOUGHT{price}]->(Product{!productId}) => (User{userId: 1})-[:BOUGHT{price: 10}]->(Product{productId: 100})
  • 28. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Sink HOW WE MANAGE BAD DATA The Neo4j Streams Sink module provide a Dead Letter Queue mechanism that if activated re-route all “bad-data” to a configured topic. What we mean for “bad-data”? ● De-Serialization errors. I.e. bad formatted JSON: {id: 1, "name": "Andrea", "surname": "Santurbano"} ● Transient errors while ingesting data into the DB.
  • 29. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Kafka Connect Sink WHAT IS KAFKA CONNECT? In open source component of Apache Kafka, is a framework for connecting Kafka with external systems such as databases, key-value stores, search indexes, and file systems. HOW IT WORKS? It works exactly in the same way as the Neo4j Sink plugin so you can provide for each topic your own Cypher query. You can download it from the Confluent HUB! And it has the Verified GOLD badge!
  • 31. LARUS Business Automation Srl Italy’s #1 Neo4j Partner RT Polyglot Persistence with Elastic, Kafka & Neo4j
  • 32. LARUS Business Automation Srl Italy’s #1 Neo4j Partner RT Polyglot Persistence with Elastic, Kafka & Neo4j
  • 33. LARUS Business Automation Srl Italy’s #1 Neo4j Partner Neo4j Streams: Lessons learned THE POWER OF THE STREAM! ● We have seen how to use the CDC in order to stream transaction events from Neo4j to other systems; ● We have seen how to use the SINK in order to ingest data into Neo4j by providing our own business rules; ● We have seen how to use the Streams PROCEDURES in order to consume/produce data directly from Cypher.
  • 35. LARUS Business Automation Srl Italy’s #1 Neo4j Partner GIVE US FEEDBACK PROVIDE US FEEDBACK If you plan to use the Streams Plugin please give us a feedback! https://github.com/neo4j-contrib/neo4j-streams
  • 36. LARUS Business Automation Srl Italy’s #1 Neo4j Partner CODE REPOSITORY https://github.com/conker84/kafka-rome-june-2k19