Skip to content

Guide to creating a JSON architecture file

Adrian Cockcroft edited this page May 28, 2015 · 7 revisions

Example Architecture - AWS Architecture Center Reference Architecture for Web

This architecture uses ELBs as intermediary steps, and cloudfront backed by S3 for cached static content. The architecture is described here. There are several other interesting architectures listed that could be created for simianviz.

Arch

Use the same name as the filename to define the architecture, use via: spigo -a aws_ac_ra_web

Description

Any text you like that describes the architecture. It will be printed by spigo when it's loaded.

Version

Use arch-0.0 for now. Dot-releases will add entries in an upwards compatible way. Major releases will break the ability to read old format files.

Victim

Name of the service that the chaosmonkey.go package will shut down one member of half way through the run.

Services

List of service specifications

Name

The color of each service in the simianviz display is currently chosen based on the number of characters in the name. This is why the appserver and webserver below are both the same color. This is a useful hack for now. Names must be unique in the list of services.

Package

These correspond to Go packages which will be invoked to implement the behavior of each service. If an unknown name is used, a helpful error message is generated. The architecture.go package has some validation code that generates an error if an unknown or duplicate package is used, and lists the valid packages. A wiki page needs to be written to describe those behaviors.

Count

The number of services to create in each region at the default spigo -p=100 level. Can be varied proportionally using -p to set a percentage. The counts all scale together and one third of each count will be created in each zone. Count of zero is used for services like "elb" that exist at region level and don't have a node count.

Regions

Set to 1 for everything that lives in a region, and 0 for cross region services like DNS endpoints. The spigo -w option multiplies the number of actual regions generated from the same json_arch definition.

Dependencies

A list of service names. It must match names defined elsewhere in the file, apart from the special case "eureka" which provides the name service for each zone and is always started without being specified explicitly. It's needed to setup cross region priamCassandra services, which need to see all eureka services rather than just the local ones in their own region, so they can find all the priamCassandra nodes globally. The architecture.go validation test will complain if it can't find a dependency and list the valid options.

{
    "arch": "aws_ac_ra_web",
    "description":"See http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_web_01.pdf",
    "version": "arch-0.0",
    "victim": "webserver",
    "services": [
        { "name":"rdsmysql",      "package":"store",       "count":2, "regions":1, "dependencies":["rdsmysql"]},
        { "name":"appserver",     "package":"monolith",    "count":6, "regions":1, "dependencies":["rdsmysql"]},
        { "name":"appserver-elb", "package":"elb",         "count":0, "regions":1, "dependencies":["appserver"]},
        { "name":"webserver",     "package":"monolith",   "count":12, "regions":1, "dependencies":["appserver-elb"]},
        { "name":"webserver-elb", "package":"elb",         "count":0, "regions":1, "dependencies":["webserver"]},
        { "name":"content-s3",    "package":"store",       "count":0, "regions":1, "dependencies":[]},
        { "name":"cloudfront",    "package":"monolith",    "count":0, "regions":1, "dependencies":["content-s3","webserver-elb"]},
        { "name":"www",           "package":"denominator", "count":0, "regions":0, "dependencies":["cloudfront"]}
    ]
}

aws_ac_ra_web