Skip to content

Instantly share code, notes, and snippets.

@mxschmitt
Created October 22, 2020 16:32
Show Gist options
  • Save mxschmitt/303ed443a0219dce51633ceb9eedb97e to your computer and use it in GitHub Desktop.
Save mxschmitt/303ed443a0219dce51633ceb9eedb97e to your computer and use it in GitHub Desktop.

Revisions

  1. mxschmitt revised this gist Oct 22, 2020. No changes.
  2. mxschmitt created this gist Oct 22, 2020.
    49 changes: 49 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    Try Playwright (try.playwright.tech) rewrite

    +-----------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------+
    | Before | | N times After N times |
    | 1x time 1x time | | +------------------------+ +------------------------------------------------+ |
    | +------------------+ +------------------------+ | | | | | | |
    | | | | | | | | Frontend (LB) | +------------------+ | File service | |
    | | Backend: | | Frontend: | | | | + Caddy +<-----+ User (Browser) | | - Uploads Files | |
    | | + Node.js | | + Caddy webserver | | | | It does: | +------------------+ | - Deletes regularly files older than 30 mins | |
    | | + Express | | It does: | | | | + Proxy to Control MS | | | |
    | | It does: +<---------------+ + Proxy to Backend | | | | | Serve React assets | +------+------------------------------^----------+ |
    | | + Savings | | + Serve React assets | | | | | Proxy to Minio | | | |
    | | + Launching | | | | | +--+---------+-------+---+ | | |
    | | | | | | | | | | | |
    | | | | | | | | | | | |
    | +------------------+ +------------------------+ | | | | | | |
    | | | | | | | |
    +-----------------------------------------------------------------------+ | | | possible HA | | |
    | | | +----------------------+ | | |
    Jobs: | | | | | | | |
    | | +--------> Storage (Minio/S3) +<--------------------------------+ | |
    + Run arbitrary Node.js code scalable in the cloud | | | | | |
    | Isolated on Node.js level by a V8 sandbox +-----+ | +----------------------+ | |
    | Current frontend on try.playwright.tech | | | |
    | Should work with 5-10 users in parallel | v N times | |
    + Currently only a single backend and frontend container | N times +--------------------+----------+ |
    | +----------------------------+ | | |
    | | | | Worker processs (launches PW)| |
    | | Control microservice: | possible HA | + Node.js | |
    | | + Go microservice | +---------+ | | |
    | | | Saves to the database | | | | It does: | |
    | | | adds jobs to the queues | | Queue | | + Launching | |
    | | + wait until the ack/nack +-----------------> +<------------------------------------->+ + Listens to RabbitMQ Queue | |
    | | | +---------+ | | |
    | +---------------+------------+ +-------------------------------+ |
    | | |
    | | +--------------------------------------------------------------------------------------+
    | | |
    | possible HA | |
    | +--------------v------------------+ |
    | | | |
    | | Etcd key/value storage | |
    | | - stores the shared snippets | |
    | | | |
    | | | |
    | +---------------------------------+ |
    | |
    | |
    +---------------------------------------------------+