Skip to content

Developer's Thoughts (SweFreq NG)

Johan Viklund edited this page Aug 25, 2017 · 5 revisions

Requirements

"The live system"

  • One live (public) web server
  • One corresponding database server

"The development system"

  • One (semi-public) development web server
  • One corresponding database server

"The web proxy"

  • One proxy server

Thoughts on architecture

  • There should be no cross-talk between the live system and the development system. The live web server should never talk to the development database. The development web server should never talk to the live database.

  • The development system needs to be accessible though either the proxy (via a public URL) or through private SSH tunnels. A public URL would be preferrable if we want to show off development features to others before they go live.

Thoughts on management

  • The live web server runs off the "master" branch while the development web server runs off the "develop" branch.

  • There is little or no development happening on either system. Ideally they are just "deployed". Actual development happens elsewhere. This is to avoid either system accumulating changes, fixes or additional code that lives outside of the source code repositories.

An exception will have to be the actual data (VCF files and coverage data files) which will have to be transferred to either system for uploading into the database on the corresponding database server.

Thoughts on deployment

Database servers

  • We would want to avoid having to load data into the database servers too often. The live database server could therefore be a clone of the development database server.

  • Database server life cycle:

  1. Initial deployment of container
    • MongoDB database instance (for swefreq-browser)
  2. Life as a development database server
    • Data gets loaded and tested
  3. Birth as a live database server
    • Development database server gets cloned
    • Cloned server instance resurrected as live database server
  4. Death
    • Once the next database server is cloned and is awaiting resurrection, the current live database server is taken off-line

Question: Where does the switchover for the live web server happen?

  1. As a configuration change on the web server?
  2. As a DNS change?

Concern: We can not allow data in the databases to deviate from the data loaded form files over time, e.g., by modifying the data in the MongoDB instance.

Web servers (WIP)

  • The web servers run the swefreq-browser as well as the Tornado server in swefreq (which includes running a small MySQL database of users).

  • Web server life cycle:

  1. A web server container is deployed with Ansible.
  2. The web server container hangs around until it's replaced.