thegreenwebfoundation / carbon.txt

A proposed convention for making it possible demonstrate that your infrastucture uses green power
Apache License 2.0
83 stars 5 forks source link

Create examples in a directory for common use cases #4

Open mrchrisadams opened 5 years ago

mrchrisadams commented 5 years ago

Ideally we'd have some examples to show what this might look like for common stacks, to people who run them can understand how this would look, and make it easier to adopt.

Own sites, and small-medium hosting company

Own sites, and cloud giant (Digital Ocean, M$, GCP, AWS, etc.)

The main difference here is that the bigger cloud companies tend to act as both a hosting provider and a DC operator, as they often own their own DC's. They often have more complicated products in their portfolio, like hosted database as a service, object storage, and so on (smaller ones have this too, but it's less common).

Larger hosting company, providing carbon.txt data for all their customer's sites

To think about

mrchrisadams commented 5 years ago

After looking at a few different formats, and looking only at the syntax, I think TOML has a lot going for it.

It's readable, you can validate it, and the comparison to other options is listed here:

In some ways TOML is very similar to JSON: simple, well-specified, and maps easily to ubiquitous data types. JSON is great for serializing data that will mostly be read and written by computer programs. Where TOML differs from JSON is its emphasis on being easy for humans to read and write. Comments are a good example: they serve no purpose when data is being sent from one program to another, but are very helpful in a configuration file that may be edited by hand.

The YAML format is oriented towards configuration files just like TOML. For many purposes, however, YAML is an overly complex solution. TOML aims for simplicity, a goal which is not apparent in the YAML specification: http://www.yaml.org/spec/1.2/spec.html

The INI format is also frequently used for configuration files. The format is not standardized, however, and usually does not handle more than one or two levels of nesting.

I think this is the format to try out for this, but I've never written specs or really defined config files before.

I'd love alternative suggestions, with their rationale.