What are your thoughts about event driven web architecture? Please help decide the right approach! | C2C Community
Solved

What are your thoughts about event driven web architecture? Please help decide the right approach!

  • 6 April 2023
  • 2 replies
  • 44 views

Userlevel 1

Hey Community!

 

We’re (re-)designing our event driven architecture, and would like to hear some feedback/ideas from you!

Our company provides B2B BNPL in the CEE region (soon through whole EU), so we have handle webshop orders, invoices, complains, communication, etc. 

So we’ll have around 100-150 technical events (ex. order placed, debtor paid inside period, 10 days passed since due date, etc.) and we plan to attach different logic to each event. These handlers will work differently based on some factors (currency, country of origin, time during the day, record statuses, etc.) and will trigger actions (email sending, Slack message, API call, etc.) or other events.

Technical note: We’ll use Terraform to setup the solution, and our whole solution runs on different serverless GCP solutions. (GCF, Cloud Run)


First approach: use GCP Workflows and Tasks to map handlers

  • pro:
    • low-code solution, when all details are passed
    • easy to extend (for a while)
    • great Terraform support
  • con:
    • we have concerns about complexity would make it un-readable by time.
    • really far from programming → team needs to learn it
    • it may have boundaries, which require complex workarounds
    • not sure how can we test locally and on CI.

Second approach: pub/sub based solution

  • pro:
    • We have parts of it already, we only need to extend our solution, but not the tech stack.
    • Also we’re sure about how to run it locally
    • more-code way:
      • TypeScript support,
      • easy testing
  • con:
    • more-code: more time to develop
    • queueing is complicated. We need an execute ‘exactly once’ solution. (something what AWS SQS does well, as I read)

What are your thoughts? If you have ideas for anything else, I’m all ears!

 

(Thanks in advance!)

icon

Best answer by seijimanoan 6 April 2023, 16:57

View original

2 replies

Userlevel 6
Badge +11

To begin with, you can read how SAP saved 70% on compute costs. It can be interesting.

With Cloud Run, the container is portable. You can run that locally, on serverless, on Kubernetes (GKE). It ease the development and troubleshoot (if any). So you can think of some CI/CD pipeline with Docker images.

This event-driven architecture is microservices architecture too. So it is needed some design patterns like Circuit Breaker and how to deal with Dead Letter on Cloud PubSub. Some messages cannot be lost. It needs to be fault tolerant. Count on many third-party integrations it may have. Maybe some workload will need to be 24x7 running or not. Things like: how many seconds a request can take?

 

queueing is complicated. We need an execute ‘exactly once’ solution.

Please, read this Cloud Pub/Sub announces General Availability of exactly-once delivery. It can be useful.

 

My strongest knowledge is Kubernetes (GKE). But these advices can be valid. So I know it is needed to design and architect with wisdom.

I hope more advices from our community/friends at here.

Userlevel 1

To begin with, you can read how SAP saved 70% on compute costs. It can be interesting.

With Cloud Run, the container is portable. You can run that locally, on serverless, on Kubernetes (GKE). It ease the development and troubleshoot (if any). So you can think of some CI/CD pipeline with Docker images.

This event-driven architecture is microservices architecture too. So it is needed some design patterns like Circuit Breaker and how to deal with Dead Letter on Cloud PubSub. Some messages cannot be lost. It needs to be fault tolerant. Count on many third-party integrations it may have. Maybe some workload will need to be 24x7 running or not. Things like: how many seconds a request can take?

 

queueing is complicated. We need an execute ‘exactly once’ solution.

Please, read this Cloud Pub/Sub announces General Availability of exactly-once delivery. It can be useful.

 

My strongest knowledge is Kubernetes (GKE). But these advices can be valid. So I know it is needed to design and architect with wisdom.

I hope more advices from our community/friends at here.

 

Thank you for the detailed answer, it helps a lot!

Actually I missed that Pub/Sub now can guarantee exactly-once delivery, this is great news!

 

I believe we’ll go with a Pub/Sub based solution, as the emulator is reliable and doesn’t need running containers. (We already have 12 containers to run the full system)

Reply