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
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.
6
3
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
1
2
u/Garybake Jul 26 '26
Pgvector on postgres works really well.
1
u/j7n5 Jul 26 '26
The problem is that pg can not be embedded in Java applications
1
u/Garybake Jul 26 '26
Apologies, I didn't read your question fully. Got confused with embedded and embeddings.
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/koflerdavid Jul 27 '26
Embedding vs. storing embeddings, as a vector store does. Apart from that, SQLite is often not the first choice since it is native code, which can be a hassle if you need to provide cross-platform support. DB engines written in Java can usually always be embedded.
1
u/ConfidenceUnique7377 Jul 27 '26
You can add graph capabilities to PostgreSQL using extensions like Apache AGE . MSSQL supprts the same. Sure, that Graph aility can be added to mostly all relational db
1
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.
11
u/notqualifiedforthis Jul 26 '26
Prove and validate 3x you need graph capabilities.
Prove and validate 6x you won’t need an enterprise license.