code-modul with the following code like cloudkvs does
The Put method for CloudKVS that you are showing is part of the client portion. The client has no code module, it's a class module.
Read this article (
https://msdn.microsoft.com/en-us/library/aa733572(v=vs.60).aspx) by Microsoft, where standard module is equivalent to code module.
Then look at the CloudKVS server where the same database is used for all access. In this case, each request gets a new handler, but each handler talks to the same database. In this case, a code module for the database portion makes sense. But, it could have been a class. That's actually how JRDC2 does it (and out of the box it only serves one database). In short, it's up to you.
As to KVS2, by making it a class module, you can actually have more than one KVS2 storage used per application. If it were a code module, you would restrict the application to only have one KVS2 store. BTW, since the CloudKVS client is a class module, your client application is not restricted to talking to only one CloudKVS server.
Hope I made it clear as mud.