1

I've a couple of questions regarding the (excellent) CouchDB .NET client MyCouch:

  • Is there some built-in retry policy in case of "transient" failure (like the server responding 503)?
  • Should instances of MyCouchClient or MyCouchStore be cached to be reused? Right now I'm creating one for each incoming request, but I'm wondering if that incurs a performance penalty.
  • I would like to customize the configuration of Json.NET as used by MyCouch, like adding a new StringEnumConverter { CamelCaseText = true } to the list of Converters. Is there a way to achieve that through the API?

Thanks

ThomasWeiss
  • 1,292
  • 16
  • 30

1 Answers1

2

1) There's no magic in the MyCouchClient, it's just simple requests and responses. The MyCouchStore how-ever, I would gladly accept pull request to have options for retries or e.g. auto-batching queries.

2) Here are some links to information that would help you to decide on per request or per application.

So doing one per application would probably need a reconf of the connection limit.

I have this centralized in my IoC-config, and by default I'm not doing per application. The first "connection" can take a bit longer, but the second has been measured down to milliseconds against Cloudant by other users so that should in general not be an issue.

3) You can configure the serializer by providing a custom MyCouchClientBootstrapper and providing a custom implementation of: https://github.com/danielwertheim/mycouch/blob/master/source/projects/MyCouch.Net45/MyCouchClientBootstrapper.cs#L170

And you also have to extend this guy: https://github.com/danielwertheim/mycouch/blob/master/source/projects/MyCouch.Net45/Serialization/SerializationConfiguration.cs#L9

Feel free to suggest changes that makes this process simpler for you.

Community
  • 1
  • 1
Daniel
  • 8,133
  • 5
  • 36
  • 51