As primary database?
I am building a Java application that will need an embedded database, vector store and has many connections.
Postgres can not be embedded, h2 can be embedded but doesn’t support embedding.
In the Java world I just see nosql db actually neo4j and arcadedb they are both very active.
Arcadedb doesn’t have a descent ORM. Neo4j has a better documentation and better springboot support.
My questions:
1. Anyone here using neo4j as primary database?
2. Is it still a secondary DB?
3. What is your experience using Neo4J ?
Thanks in advance
5
Upvotes
4
u/Efficient_Fox_9478 Jul 26 '26
What do you mean with H2 'doesn’t support embedding" ? I have used H2 in a java-application distributed as a jar. It worked fine for me.
2
u/Garybake Jul 26 '26
Pgvector on postgres works really well.
12
u/notqualifiedforthis Jul 26 '26
Prove and validate 3x you need graph capabilities.
Prove and validate 6x you won’t need an enterprise license.
6
u/backflipbail Jul 26 '26
I am and it sucks. Use a normal DB for primary, use a graph DB for graph things only.
5
u/VincentxH Jul 26 '26
SQLite
1
u/JollyJuniper1993 Jul 26 '26
Honestly I didn’t even know Neo4j supported embedding, does it? Usually SQLite is the way to go for embedded databases.
1
u/Dense_Age_1795 Jul 28 '26
just use docker and postgres
1
u/Trekker23 Aug 11 '26
Hi, not sure if you’re still looking, but we recently added a Java binding to kglite, a high-performance embedded graph database written in Rust. It’s MIT, so no licensing worries.
- Truly embedded, no server: one Maven dependency (io.github.kkollsga:kglite), native libs bundled in the jar, in-process (Panama/FFM, so JDK 22+). No daemon, no JNI.
- Cypher (a large openCypher subset), plus a bundled typed query builder so you’re not concatenating query strings.
- Vector search from Java: store your own embeddings, build an HNSW index, and run nearest-neighbour via vector_score / text_score by passing a float[] query vector. You can even combine a graph pattern with vector scoring in one Cypher query. The store and index persist in the single-file .kgl on save().
Get started with implementation("io.github.kkollsga:kglite:0.15.11") and you’re querying in-process.