I only wanted to test couchbase without installing it. After search, i discovered that there are a Paas service offered by Clever-cloud. This PaaS is the first cloud platform that offer a couchbase as service. This article show how configure Couchbase Bucket and how to connect to this service using Spring.
First Step : Creation of the bucket in clever-cloud :In this step, i will create an account in clever-cloud and sign in to can create an instance.
After creation, check your mail and verify that you received an email from clever cloud that contains all informations to connect to your instance, all parameters should be like this :
The problem with clever-cloud is that you don't have access to manage your instance, but you can do this with your client.
Second Step : JSF 2 and Spring 3 application :
Here, just you create a jsf web app maven prototype. maven dependencies are as follows:
To inject Spring beans in jsf managed bean, you can use the dependency injection : JSR 330, to do this just add in your pom the dependency :
Now, to add Spring to your project, you can add dependencies in your pom file :
At this stage, to add record in your data base, you should specify it in JSON format, and if you want to read it you should convert it from JSON to your code source langage, in our case, we should add firt the java couchbase-client and i will use google-gson :
Don't forget to add the couch base repository to your pom :