Does Neo4j support creating a new database on-the-fly for each end-user session?

Was wondering how I'm going to code my app.

Can Neo4j create a database on-the-fly fairly quickly?

Does it support millions of graphs (databases)?

If not, can I at least create a database for each user when they sign up in my web app?

The clause to do that on Neo4j 4.x is CREATE DATABASE [name]
The user have to have the right to do it and that's about it.

It is possible to create a database on the fly for any sign up user, but I can see a huge security concern here. Maybe a more experimented Neo4j Ninja or Staff member can go further.

1 Like

Configuration settings - Operations Manual will limit the maximum number of databases to be created.

Does it support millions of graphs (databases)?

We only support multiple databases beyond system and neo4j when using Neo4j Enterprise.

I suspect that is going to a management/logistical nightmare. Also as each database is going to consume space at data/databases/ and data/transactions/ then the question also becomes how much file system space do you have. And even if you had for example petabytes of file system space it still might simply be a management/logistical nightmare.

You can use bin/neo4j-admin copy Copy a database store - Operations Manual to copy an existing database to another but this requires the source database to be stopped.

and then even if you could have millions of databases you are still sharing RAM across the millions of databases. If you have for example 256G of RAM on the linux instance and you have 512 databases are you going to allocate each a pagecache of 512m for example?

1 Like