Code Monkey home page Code Monkey logo

Comments (6)

aenario avatar aenario commented on May 18, 2024 1

We will make our own driver by cherry picking relevant codes in other libraries.

from cozy-stack.

tomsquest avatar tomsquest commented on May 18, 2024

Can you list what are the choice criteria (may be "functional" ones) ? (connection pool, binary, auto-marshalling, https...)
What is mandatory, what is nice-to-have ?

from cozy-stack.

aenario avatar aenario commented on May 18, 2024

Hi @tomsquest, Thanks for your feedback !

I added a section on how we will use it, which covers the functional needs.

This allowed to identify the first library as the only one providing access to the internal Client/Transport and allowing fine-tuning. I am not yet sure how much we will need to tweak the golang defaults pooling strategy, but sure would be helpful if we can do it !

from cozy-stack.

tomsquest avatar tomsquest commented on May 18, 2024

Edit: deduce database instead of setting it manually with database(...)

Another advantage of a DIY solution: building exactly what stack needs.
This is orienting the CouchDB access code for Cozy usage.
And this could be implemented as a DSL.

For example:
(if I understand the architecture, the goal is for an User to have many Databases, one for each DocumentType)

// Create an Email
couchdb
    .Doc(anEmail) // deduce the database from the type of the parameters
    .Create()
    // .Update()
    // .Delete()
// List emails from 100 to 200
emails = couchdb
    .emails() // pick the appropriate database
    .Offset(100)
    .Limit(200)
    .Order(DATE, DESC)
    .select() // Create the adhoc CouchDb query (`Mango` style ?)

BTW, couchdb could be an already configured object with the appropriate user credentials.

Pros:

  • Cozy-stack oriented (functionally)
  • Still able to access CouchDb natively (eg. couchdb.Connection())
  • Can hide technical stuff: access to the pool, concurrency, caching, https, retries, timeouts...
  • Build and maintained by Cozy

Cons:

  • DSL to write (and testing is a bit harder)
  • To be maintained, but in fact, this is already the case for the other wrappers

from cozy-stack.

aenario avatar aenario commented on May 18, 2024

This discussion has been moved to docs (34b699d). It can be continued on a PR of this docs/couchdb-plugins.md if the need arise (new great couchdb2 package ?).

Thanks again @tomsquest for your input.

from cozy-stack.

tomsquest avatar tomsquest commented on May 18, 2024

@aenario you're welcome.

from cozy-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.