Skip to content

Commit bec616c

Browse files
committed
add altering sharded property databases
1 parent 7ec68bc commit bec616c

File tree

1 file changed

+89
-2
lines changed

1 file changed

+89
-2
lines changed
Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,90 @@
11
:page-role: new-2025.10 enterprise-edition not-on-aura
2-
:description:
3-
= Altering sharded property databases
2+
:description: Describes how to alter sharded property databases in Neo4j.
3+
4+
= Altering sharded property databases
5+
6+
A sharded database can be altered on two levels.
7+
It is possible to change the entire sharded database with ALTER DATABASE or alter a specific shard with `ALTER DATABASE <shard-name>`.
8+
9+
== Syntax
10+
11+
[options="header", width="100%", cols="1m,5a"]
12+
|===
13+
| Command | Syntax
14+
15+
| ALTER DATABASE <name>
16+
|
17+
[source, syntax, role="noheader"]
18+
----
19+
ALTER DATABASE name [IF EXISTS]
20+
{
21+
SET ACCESS {READ ONLY \| READ WRITE} \|
22+
SET GRAPH SHARD {
23+
SET TOPOLOGY ((n PRIMAR{Y\|IES}) \| (m SECONDAR{Y\|IES}))+
24+
} \|
25+
SET PROPERTY SHARD {
26+
SET TOPOLOGY n REPLICA[S]
27+
}
28+
}
29+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
30+
----
31+
32+
| ALTER DATABASE <graph-shard>
33+
|
34+
[source, syntax, role="noheader"]
35+
----
36+
ALTER DATABASE name [IF EXISTS]
37+
SET TOPOLOGY (
38+
(n PRIMAR{Y\|IES}) \|
39+
(m SECONDAR{Y\|IES})
40+
)
41+
[WAIT [n [SEC[OND[S]]]] \| NOWAIT]
42+
----
43+
44+
| ALTER DATABASE <property-shard>
45+
|
46+
[source, syntax, role="noheader"]
47+
----
48+
ALTER DATABASE name [IF EXISTS]
49+
SET TOPOLOGY (
50+
n REPLICA[S]
51+
)
52+
[WAIT [n [SEC[OND[S]]]] \| NOWAIT]
53+
----
54+
55+
|===
56+
57+
== Example 1: Change the topology of the graph shard and all property shards
58+
59+
[source, cypher]
60+
----
61+
ALTER DATABASE foo-sharded
62+
SET GRAPH SHARD {
63+
SET TOPOLOGY 1 PRIMARY 2 SECONDARIES
64+
}
65+
SET PROPERTY SHARDS {
66+
SET TOPOLOGY 1 REPLICA;
67+
}
68+
----
69+
70+
== Example 2: Change the topology of the graph shard
71+
72+
[source, cypher]
73+
----
74+
ALTER DATABASE `foo-sharded-g000`
75+
SET TOPOLOGY 1 PRIMARY 2 SECONDARIES;
76+
----
77+
78+
== Example 3: Change the topology of a specific property shard
79+
80+
[source, cypher]
81+
----
82+
ALTER DATABASE `foo-sharded-p000`
83+
SET TOPOLOGY 2 REPLICAS;
84+
----
85+
86+
[NOTE]
87+
====
88+
Resharding is currently not supported.
89+
When the database is operational, altering a property shard can only be done by altering the number of replicas per graph shard.
90+
====

0 commit comments

Comments
 (0)