You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/faq/faq.adoc
+155-3
Original file line number
Diff line number
Diff line change
@@ -451,15 +451,167 @@ public class CustomConfig {
451
451
}
452
452
----
453
453
454
+
[[faq.cluster]]
455
+
== Using a Neo4j cluster instance from Spring Data Neo4j
456
+
457
+
The following questions apply to Neo4j AuraDB as well as to Neo4j on-premise cluster instances.
458
+
454
459
[[faq.transactions.cluster]]
455
-
== Do I need specific configuration so that transactions work seamless with a Neo4j Causal Cluster?
460
+
=== Do I need specific configuration so that transactions work seamless with a Neo4j Causal Cluster?
456
461
457
462
No, you don't.
458
463
SDN uses Neo4j Causal Cluster bookmarks internally without any configuration on your side required.
459
464
Transactions in the same thread or the same reactive stream following each other will be able to read their previously changed values as you would expect.
460
465
466
+
[[faq.transactions.cluster.rw]]
467
+
=== Is it important to use read-only transactions for Neo4j cluster?
468
+
469
+
Yes, it is.
470
+
The Neo4j cluster architecture is a causal clustering architecture, and it distinguishes between primary and secondary servers.
471
+
Primary server either are single instances or core instances. Both of them can answer to read and write operations.
472
+
Write operations are propagated from the core instances to read replicas inside the cluster.
473
+
Those read replicas are secondary servers.
474
+
Secondary servers don't answer to write operations.
475
+
476
+
In a standard deployment scenario you'll have some core instances and many read replicas inside a cluster.
477
+
Therefor it is important to mark operations or queries as read-only to scale your cluster in such a way that leaders are
478
+
never overwhelmed and queries are propagated as much as possible to read replicas.
479
+
480
+
Neither Spring Data Neo4j nor the underlying Java driver do Cypher parsing and both building blocks assume
481
+
write operations by default. This decision has been made to support all operations out of the box. If something in the
482
+
stack would assume read-only by default, the stack might end up sending write queries to read replicas and fail
483
+
on executing them.
484
+
485
+
NOTE: All `findById`, `findAllById`, `findAll` and predefined existential methods are marked as read-only by default.
Copy file name to clipboardExpand all lines: src/main/asciidoc/introduction-and-preface/preface.adoc
+23
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,19 @@ On a lower level, you can grab the Bolt driver instance, but than you have to ma
48
48
To learn more about Spring, you can refer to the comprehensive documentation that explains in detail the Spring Framework.
49
49
There are a lot of articles, blog entries and books on the matter - take a look at the Spring Framework https://spring.io/docs[home page ] for more information.
50
50
51
+
This documentation tries to bridge between a broad spectrum of possible users:
52
+
53
+
* People new to all the Spring ecosystem, including Spring Framework, Spring Data, the concrete module (in this case Spring Data Neo4j)
54
+
and Neo4j.
55
+
* Experienced Neo4j developers that are new to Spring Data and want to make best use of their Neo4j knowledge but are unfamiliar
56
+
with declarative transactions for example and how to incorporate the latter with Neo4j cluster requirements.
57
+
* Experienced Spring Data developers who are new to this specific module and Neo4j and need to learn how the building blocks
58
+
interact together. While the programming paradigm of this module is very much in line with Spring Data JDBC, Mongo and others,
59
+
the query language (Cypher), transactional and clustering behaviour is different and can't be abstracted away.
60
+
61
+
We decided to move a lot of Neo4j specific questions into the <<faq, Frequently Asked Questions>>.
62
+
63
+
51
64
[[what-is-sdn]]
52
65
== What is Spring Data Neo4j
53
66
@@ -60,6 +73,16 @@ JVM primitives are mapped to node or relationship properties.
60
73
An OGM abstracts the database and provides a convenient way to persist your domain model in the graph and query it without having to use low level drivers directly.
61
74
It also provides the flexibility to the developer to supply custom queries where the queries generated by SDN are insufficient.
62
75
76
+
TIP: Please make sure you read the <<faq, Frequently Asked Questions>> where we address many reoccurring questions about our
77
+
mapping decisions but also how interaction with Neo4j cluster instances such as https://neo4j.com/cloud/platform/aura-graph-database/[Neo4j AuraDB]
78
+
and on-premise cluster deployments can be significantly improved.
79
+
+
80
+
Concepts that are important to understand are Neo4j Bookmarks, https://medium.com/neo4j/try-and-then-retry-there-can-be-failure-30bf336383da[the potential need]
81
+
for incorporating a proper retry mechanism such as https://github.com/spring-projects/spring-retry[Spring Retry] or
82
+
https://github.com/resilience4j/resilience4j[Resilience4j] (we recommend the latter, as this knowledge is applicable outside
83
+
Spring, too) and the importance of read-only vs write queries in the context of Neo4j cluster.
0 commit comments