Skip to content

Commit 65d9562

Browse files
committed
added the rest of data ingestion, starting and stopping, listing
1 parent 4f475db commit 65d9562

File tree

3 files changed

+144
-7
lines changed

3 files changed

+144
-7
lines changed

modules/ROOT/pages/scalability/sharded-property-databases/data-ingestion.adoc

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ a| Defines an identical seed from an external source, which will be used to seed
197197
[source, syntax, role="noheader"]
198198
----
199199
seedUri: {
200-
`neo4j-sharded-g000`: "s3://bucket/folder/foo-g000.backup",
201-
`neo4j-sharded-p000`: "s3://bucket/folder/foo-p001.backup",
202-
`neo4j-sharded-p001`: "s3://bucket/folder/foo-p002.backup"
200+
`foo-sharded-g000`: "s3://bucket/folder/foo-g000.backup",
201+
`foo-sharded-p000`: "s3://bucket/folder/foo-p001.backup",
202+
`foo-sharded-p001`: "s3://bucket/folder/foo-p002.backup"
203203
}
204204
----
205205
Or
@@ -214,3 +214,96 @@ seedUri: "s3://bucket/folder/"
214214
The sharded property databases use the Neo4j cluster topology.
215215
Therefore, you need to consider how the following settings will affect the creation of your sharded property database.
216216

217+
[options="header", width="100%", cols="4m,1m,1m,3a"]
218+
|===
219+
| Configuration settings with their default value
220+
| Default value
221+
| Valid values
222+
| Description
223+
224+
|initial.dbms.default_primaries_count
225+
| 1
226+
| [1-10]
227+
| The default number of primaries for the graph shard when the database is created.
228+
229+
|initial.dbms.default_secondaries_count
230+
| 0
231+
| [0-19]
232+
| The default number of secondaries for the graph shard when the database is created.
233+
|===
234+
235+
=== Creating an empty sharded property database
236+
237+
You can create an empty sharded database using the `CREATE DATABASE` command.
238+
The command allows you to specify the number of property shards and the topology of the graph shard.
239+
The following examples show how to create an empty sharded database with different configurations.
240+
241+
==== Example 1: Create an empty sharded database with the default topology (1 primary, no secondaries, and 1 replica per property shard)
242+
243+
[source, cypher]
244+
----
245+
CYPHER 25 CREATE DATABASE `foo-sharded`
246+
PROPERTY SHARDS { COUNT 3 };
247+
----
248+
249+
==== Example 2: Create an empty sharded database with a custom topology
250+
251+
[source, cypher]
252+
----
253+
CYPHER 25 CREATE DATABASE `foo-sharded`
254+
SET GRAPH SHARD { TOPOLOGY 1 PRIMARY 0 SECONDARIES }
255+
SET PROPERTY SHARDS { COUNT 3 TOPOLOGY 1 REPLICAS };
256+
----
257+
258+
==== Example 3: Create an empty sharded database with a custom high-availability topology
259+
260+
[source, cypher]
261+
----
262+
CYPHER 25 CREATE DATABASE `foo-sharded`
263+
SET GRAPH SHARD { TOPOLOGY 3 PRIMARY 0 SECONDARIES }
264+
SET PROPERTY SHARDS { COUNT 3 TOPOLOGY 2 REPLICAS };
265+
----
266+
267+
=== Creating a sharded database from a URI
268+
269+
You can create a new sharded property database from an existing database with seeding from one or more URIs.
270+
This is useful when you want to create a new database as a copy of an existing one, or when you want to seed a new database with data from another source.
271+
For more information on how seed from URI works, see the xref:database-administration/standard-databases/seed-from-uri.adoc[Create a database from a URI].
272+
273+
The following example shows how to create a shared database with seeding from one or several URIs.
274+
275+
==== Example 1: Create a sharded database with seeding from one URI
276+
277+
[source, cypher]
278+
----
279+
CYPHER 25 CREATE DATABASE `foo-sharded`
280+
PROPERTY SHARDS { COUNT 3 }
281+
OPTIONS { seedURI: “s3://bucket/folder/” };
282+
----
283+
284+
==== Example 2: Create a sharded database with seeding from one URI with a different name
285+
286+
This one is similar to example 1, but the system looks for `other-database-g000`, etc.
287+
288+
[source, cypher]
289+
----
290+
CYPHER 25 CREATE DATABASE `foo-sharded`
291+
PROPERTY SHARDS { COUNT 3 }
292+
OPTIONS { seedURI: “s3://bucket/folder/”, seedSourceDatabase: “other-database” };
293+
----
294+
295+
==== Example 3: Create a sharded database with seeding from multiple URIs
296+
297+
The URIs need to be keyed by the shard name they should be used to seed.
298+
The shard names will be `databaseName-g000` and `databaseName-p000` to `databaseName-px`, where `x` is the number of property shards `-1`.
299+
300+
[source, cypher]
301+
----
302+
CYPHER 25 CREATE DATABASE `foo-sharded`
303+
PROPERTY SHARDS { COUNT 3 }
304+
OPTIONS { seedUri: {
305+
`foo-sharded-g000`: "s3://bucket/folder/foo-g000.dump",
306+
`foo-sharded-p000`: "s3://bucket/folder/foo-p001.dump",
307+
`foo-sharded-p001`: "s3://bucket/folder/foo-p002.dump"
308+
} };
309+
----
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
:page-role: new-2025.10 enterprise-edition not-on-aura
2-
:description:
3-
= Listing sharded property databases
2+
:description: Listing sharded property databases
3+
= Listing sharded property databases
4+
5+
Sharded databases are listed as standard databases in the `type column` when you execute `SHOW DATABASES`.
6+
7+
* The status is either:
8+
** Equal to the status shared by all shards.
9+
** “Mixed”, if some shards have a different status.
10+
The statusMessage indicates the number of shards with different statuses, e.g., online (4) and starting (1).
11+
12+
* The associated graph shard is listed as `graph shard` in the `type column`.
13+
* The associated property shards are listed as `property shard` in the `type column`.
14+
* The `shardTxnLag` column displays the number of transactions the current shard is behind compared to the most up-to-date shard allocation of the sharded database.
15+
The lag is expressed in negative integers, whereas the column `replicationLag` shows the number of transactions the current database is behind compared to the most up-to-date allocation of that database.
16+
17+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
18+
| name | type | aliases | access | address | role | writer | requestedStatus | currentStatus | statusMessage | default | home | constituents |
19+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
20+
| "foo" | "standard" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | FALSE | FALSE | [] |
21+
| "foo-g000" | "graph shard" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | FALSE | FALSE | [] |
22+
| "foo-p000" | "property shard" | [] | "read-write" | "localhost:7687" | "property shard replica" | FALSE | "online" | "online" | "" | FALSE | FALSE | [] |
23+
| "foo-p001" | "property shard" | [] | "read-write" | "localhost:7687" | "property shard replica" | FALSE | "online" | "online" | "" | FALSE | FALSE | [] |
24+
| "foo-p002" | "property shard" | [] | "read-write" | "localhost:7687" | "property shard replica" | FALSE | "online" | "online" | "" | FALSE | FALSE | [] |
25+
| "system" | "system" | [] | "read-write" | "localhost:7687" | "primary" | TRUE | "online" | "online" | "" | FALSE | FALSE | [] |
26+
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
27+
28+
[NOTE]
29+
====
30+
Some columns are empty for the virtual sharded database (with the name passed into the create command) and can be found on the rows of the associated graph shard instead, e.g., `lastCommittedTxn` or `replicationLag`.
31+
These rows are only visible if the user has either `CREATE/DROP/ALTER DATABASE`, `SET DATABASE ACCESS`, or `DATABASE MANAGEMENT` privileges.
32+
These rows can be distinguished by the type that has the value `graph shard` and `property shard`, respectively.
33+
====
34+
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
:page-role: new-2025.10 enterprise-edition not-on-aura
2-
:description:
3-
= Starting and stopping sharded property databases
2+
:description: Starting and stopping sharded property databases
3+
= Starting and stopping sharded property databases
4+
5+
You can start and stop a sharded database using `START DATABASE <name>` and `STOP DATABASE <name>`.
6+
7+
If the name is equal to the sharded database name, the graph shard and all its property shards are started/stopped.
8+
If the name is equal to a shard name, only the specified shard is stopped.
9+
10+
[WARNING]
11+
====
12+
Stopping a single shard makes the database inaccessible.
13+
Therefore, this should only be done if you need to perform some action that requires only one shard to be offline, such as the recovery of a single shard.
14+
15+
Please, do not do this unless you know what you are doing.
16+
====

0 commit comments

Comments
 (0)