|
| 1 | +# Development Principles |
| 2 | + |
| 3 | +> **Note:** This document outlines guidances behind some development decisions |
| 4 | +> behind the Hipster Shop demo application. |
| 5 | +
|
| 6 | +### Minimal configuration |
| 7 | + |
| 8 | +Running the demo locally or on GCP should not require minimal to no |
| 9 | +configuration unless absolutely necessary to run critical parts of the demo. |
| 10 | + |
| 11 | +Configuration that takes multiple steps, especially such as creating service |
| 12 | +accounts should be avoided. |
| 13 | + |
| 14 | +### App must work well outside GCP |
| 15 | + |
| 16 | +Demo application should work reasonably well when it is not deployed to GCP |
| 17 | +services. The experience of running the application locally or on GCP should |
| 18 | +be close. |
| 19 | + |
| 20 | +For example: |
| 21 | +- OpenCensus prints the traces to stdout when it cannot connect to GCP. |
| 22 | +- Stackdriver Debugging tries connecting to GCP multiple times, eventually gives |
| 23 | + up. |
| 24 | + |
| 25 | +### Running on GCP must not reduce functionality |
| 26 | + |
| 27 | +Running the demo on the GCP must not reduce/lose any of the capabilities |
| 28 | +developers have when running locally. |
| 29 | + |
| 30 | +For example: Logs should still be printed to stdout/stderr even though logs are |
| 31 | +uploaded to Stackdriver Logging when on GCP, so that developers can use "kubectl |
| 32 | +logs" to diagnose each container. |
| 33 | + |
| 34 | +### Microservice implementations should not be complex |
| 35 | + |
| 36 | +Each service should provide a minimal implementation and try to avoid |
| 37 | +unnecessary code and logic that's not executed. |
| 38 | + |
| 39 | +Keep in mind that any service implementation is a decent example of “a GRPC |
| 40 | +application that runs on Kubernetes”. Keeping the source code short and |
| 41 | +navigable will serve this purpose. |
| 42 | + |
| 43 | +It is okay to have intentional inefficiencies in the code as they help |
| 44 | +illustrate the capabilities of profiling and diagnostics offerings. |
0 commit comments