Couchbase Dao Java Layer?

Hi all,

First Bravo on a Great Job on the best NoSQL Doc DB .

I question I have been meaning to ask the community is if anyone is aware of a Tool / lib / Framework we can use to base our DAO / Persistent Layer something like Morphia is for MongoDB or like MyBatis is for RDBMS we are looking if anything is available to bring structure to Junior developers to help them implement Couchbase data modeling e.g. 1-1, 1-m relationships, Lookup pattern , Counter-id pattern , Embedding and Referring implementation . I ask this before we try to implement a supporting Couchbase Dao layer that will live between our Dao implementation and the CB Java SDK something like a Generic Dao.

Any input is very welcome and thanks again for great product.

Hi @GeorgeLeon
Thanks for the kind words :smile:

Concerning your question, there’s no official Couchbase project for what you want at the level of Morphia for now :wink: We are working on an ODM but it is still in its infancy (see the blog post on Java SDK 2.2 developer preview), so definitely a thing to watch for.

By the way, even if you do end up building your common layer for DAOs, we’d love to hear about what you’ve done, and also what you think are essential features for a “micro” ODM like the one we are building into the SDK.

Happy coding!
Simon

1 Like

Yes that’s what I’m talking about you guys are the best !!! I like where Couchbase is going with the Java SDK 2.2. I try to help also . Simon does Java SDK 2.2. need Couchbase 4.0 ?

@GeorgeLeon nope, it does not need 4.0, only if you want to use the new N1QL query features to its full extent. 2.2 is backwards compatible back to the Server 2.0 release.

1 Like

Cheers I give it a spin .

I have implemented a generic data access object using kotlin coroutines, you can check it out.

1 Like

Looks good @EvangelosBoudis !

For anyone coming across this old thread, please consider checking out https://spring.io/projects/spring-data-couchbase, which provides various ways of interacting with Couchbase in Java, Scala and Kotlin, using the popular Spring project.

Also, the latest iteration of the Couchbase SDKS, including Java 3.1 and Scala 1.1, make it easier than ever to use your DTO or entity classes directly with Couchbase, overlapping somewhat with ODM responsibilities. Check out some examples from the Scala SDKs over how easy it is to store and retrieve case classes directly with KV or N1QL operations: JSON Libraries | Couchbase Docs and Query | Couchbase Docs.

1 Like