Skip to main content

Common requirements πŸ”₯

Microservice manifesto​

  • Small disposable components with single responsibility both in backend and frontend
  • Extensibility through addition of components as opposed to modifying existing ones, Composition vs. inheritance
  • Do not refactor legacy application code, gradually replace with new better designed components
  • Streaming oriented, event driven, interaction via event propagation
  • Automated delivery pipelines, easy to add and remove components
  • Component status visibility via monitoring and alerting

Metrics​

All service must expose metrics endpoint for prometheus

Route (private aceess):​

/metrics

Response​

# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.0.8"} 1
...

Healhcheck​

All service must expose healthcheck endpoint

Route (private aceess):​

/_health

Response:​

{
"status": "UP",
"version": "v0.0.1-master",
}

Logging​

We use two main tools to log our system: ELK Stack + Sentry.

ELK is used to cover all services with logs​

https://kibana.n0d.io/

Sentry collects critical project errors​

https://sentry.n0d.io/

Server port​

The standard ports for all our services are described here.

For http service​

3000

For grpc service​

3030

Note: PHP + FPM config​

All services must be accessible through standard interfaces (http/grpc/etc). This means that the container cannot be started with only php-fpm. All php-fpm service must have nginx around and expose 3000 port.

Docker​

Default environment variables:​

SERVICE_NAME Example: SERVICE_NAME=Service Name

SERVICE_VERSION Example: SERVICE_VERSION=v0.0.1-master

ENVIRONMENT Example: ENVIRONMENT=dev

ENVIRONMENT_NAME Example: ENVIRONMENT_NAME=dev01

Kubernetes​

Helm files​

Configuration​

Config path in docker​

Template: /{SERVICE_NAME}/configs/{}.yml

Secrets​

Template: /{SERVICE_NAME}/secrets/{}.yml

Service Discovery​

Databases​

Database name​

Template: {ENVIRONMENT_NAME}_{SERVICE_NAME}_{TOPIC NAME}