Coder Social home page Coder Social logo

confiture's Introduction

Distributed configuration

Three modules:

  1. the daemon, has a configuration file. It reads the configuration on startup or when explicitly requested to re-read the configuration.

    It is not an option for the daemon to request the configuration value via SQL for instance, which would generate network requests all the time, the daemon has a local cache. Either a zodb cache, or a memcache, or there is a protocol to notify the daemon to reload the configuration

  2. the persistence, it could be a Couchdb, a Zodb, a Postgresql with a Storm. It could be anything, but it needs to be sexy. It stores the configuration so that when the server reboots, it does not forget its configuration.

  3. the interface either web or command line, it needs to be deported so that one interface can communicate with multiple backends.

The interface is a Grok site or a command line, writing to a zeo zodb, the daemon can read the configuration in the zeo zodb. Or the interface can be a Grok site using storm around Sqlite.

Let's roll: the points of configuration for the daemon is log verbosity which is a boolean, ip and port:

{ "verbosity"  : "false",
  "ip_address" : "127.0.0.1",
  "port"       : "8080" }

On the platform, the daemon has the identifier basil, so the in the store, the three parameters are located under the basil node, under the root node.

Let's first build

  • a command line which sets up the zodb, the default values. It is called config-setup.py, and expects a defaults.py with the interface named after the daemon identifier, and detailing the default values,

def - a command line which can talk to a zeo zodb, and get, set the

options. It is named config.py, and has the --id set, for instance, to basil then takes a json configuration file,

Setting up the configuration repository

  1. it declares the hard coded Data.fs file storage in the current directory,
  2. looping in the interfaces directory, it loads the class based on the zope.interfaces. An object conforming to the interface, and whose values are the default value is instantiated and stored in the ZODB.
    1. list the interfaces of a package,

confiture's People

Contributors

jdb avatar

Stargazers

 avatar

Watchers

 avatar

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.