ECS vs EKS#

First lesson take a look at the following diagram is a simple ECS cluster with a fastAPI, grafana, prometheus, redpanda-console, redpanda broker and a Axium API. We will see how to setup a ECS cluster using this services, with the AWS console and with Terraform.

ECS#

  1. Understanding the architecture

We will use two APIs, a message broker for streaming data, and a monitoring system with Prometheus and Grafana, but first we need to understand the needs of each service.

  • APIs: We have one API for the application and one for monitoring and get information.
  • Message Broker: We need a message broker to stream data between services, in the past we used Kafka (it was very dificult to setup because of the complexity of the configuration, and it was not fast enough), and redis pub/sub (in the API and docker we have incompatible for linux and mac because of OPENSSL package).
  • Monitoring: We need a monitoring system to monitor the health of our services.

    openssl::ssl::SslStream<S>::read_uninit':
    215.9           sqlx_postgres.db90206912fb9d19-cgu.13:(.text._ZN7openssl3ssl18SslStream$LT$S$GT$11read_uninit17h8195d4e4fd2c0fa9E+0x2d): undefined reference to SSL_read_ex'
    ...
    215.9 error: could not compile roadr_rs (bin "roadr_rs") due to 1 previous error
    ------
    ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101
    Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101
  
  • Monitoring: We need a monitoring system to monitor the health of our services.
  1. Setting up the ECS cluster

Imgur

Imgur

Hello Friend