# Homegate Engineering Blog - Medium

SMG | Homegate | ImmoScout24 Engineering is happy to share ideas and technologies used in daily work. Our goal is to provide a great experience in offering and finding a new home. - Medium

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Build a self-hosted, GPU-accelerated translation API with open-source LLMs

DevFeed: [Build a self-hosted, GPU-accelerated translation API with open-source LLMs](<https://devfeed.tech/articles/build-a-low-cost-low-latency-low-energy-ai-translator-a-deepl-alternative-that-works-23896.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/build-a-low-cost-low-latency-low-energy-ai-translator-a-deepl-alternative-that-works-19b903d00845?source=rss----2186e5b9bd8f---4>)

Author: fm.mateo

Published: 2025-08-07T12:57:31Z

Content type: tutorial

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [Latency](<https://devfeed.tech/topics/latency.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [Google Cloud Platform (GCP)](<https://devfeed.tech/topics/google-cloud.md>), [GPU](<https://devfeed.tech/topics/gpu.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Self-hosted](<https://devfeed.tech/topics/self-hosted.md>), [API](<https://devfeed.tech/topics/api.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [Developer Tools](<https://devfeed.tech/topics/developer-tools.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [amazon](<https://devfeed.tech/tags/amazon.md>), [api](<https://devfeed.tech/tags/api.md>), [backend](<https://devfeed.tech/tags/backend.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cost](<https://devfeed.tech/tags/cost.md>), [deepl](<https://devfeed.tech/tags/deepl.md>), [energy](<https://devfeed.tech/tags/energy.md>), [google-translate](<https://devfeed.tech/tags/google-translate.md>), [inference](<https://devfeed.tech/tags/inference.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [latency](<https://devfeed.tech/tags/latency.md>), [low-latency](<https://devfeed.tech/tags/low-latency.md>), [machine-translation](<https://devfeed.tech/tags/machine-translation.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [translation](<https://devfeed.tech/tags/translation.md>)

### AI overview

This step-by-step guide describes how Swiss Marketplace Group built and deployed a self-hosted, GPU-accelerated translation service using open-source large language models on Google Cloud Platform. The article reports over 85% cost savings, sub-three-second latency, and no impact on buyers' conversion rate compared with its previous DeepL API usage.

### Source excerpt

Build a low-cost, low-latency, low-energy AI Translator: a DeepL alternative that worksA step-by-step guide to deploying your own AI-powered translation API at scale, and get rid of DeepL, Google Translate, Amazon Translate, etc.Introduction and motivation At Swiss Marketplace Group (SMG), we operate multiple online platforms used daily by millions of people across Switzerland. One of them, Ricardo, is a second-hand marketplace where buyers and sellers interact in four different languages: French, German, Italian, and English. To deliver a seamless experience across languages, we had been relying on DeepL API, one of the most accurate translation APIs on the market. And while DeepL served us well in terms of quality and response time, it came with significant downsides: A monthly cost of over 7,000 CHF A black-box approach, offering no insight into how translations were produced Data privacy risks As usage grew, so did the bill, and the urgency to reduce it. Around that time, generative AI had made enormous improvements, and open-source large language models (LLMs) had become more accessible than ever. This sparked a question: Can we replace DeepL API with a self-hosted open-source LLM, without sacrificing translation quality, speed, and user experience? The answer turned out to be yes. Over the course of my master thesis, I built a production-grade, GPU-accelerated translation service using modern LLM tooling, hosted entirely on Google Cloud Platform (GCP), and fully integrated into Ricardo's infrastructure. The result: Over 85% cost savings Sub-3-second latency No impact on conversion rate of buyers And everything is reproducible, transparent, and extensible. In this article, I'll walk you through exactly how I built it, from selecting the right model, optimizing inference time, and wrapping it in an API, to deploying and monitoring it in production. My goal is simple: enable you to do the same. Whether you're a backend developer, a ML engineer, or just AI-curious

## Replacing AWS Step Functions with SQS FIFO queues and cutting the cost in half

DevFeed: [Replacing AWS Step Functions with SQS FIFO queues and cutting the cost in half](<https://devfeed.tech/articles/replacing-aws-step-functions-with-sqs-fifo-queues-and-cutting-the-cost-in-half-23900.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/replacing-aws-step-functions-with-sqs-fifo-queues-and-cutting-the-cost-in-half-9ab97e819b3a?source=rss----2186e5b9bd8f---4>)

Author: Alexei Liulin

Published: 2025-03-14T14:47:27Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [scheduling](<https://devfeed.tech/topics/scheduling.md>), [AWS Step Functions](<https://devfeed.tech/topics/aws-step-functions.md>), [Cloud Logging](<https://devfeed.tech/topics/cloud-logging.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [alert](<https://devfeed.tech/tags/alert.md>), [alerts](<https://devfeed.tech/tags/alerts.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-step-functions](<https://devfeed.tech/tags/aws-step-functions.md>), [batching](<https://devfeed.tech/tags/batching.md>), [cloud-computing](<https://devfeed.tech/tags/cloud-computing.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cost-optimization](<https://devfeed.tech/tags/cost-optimization.md>), [deduplication](<https://devfeed.tech/tags/deduplication.md>), [email](<https://devfeed.tech/tags/email.md>), [fifo](<https://devfeed.tech/tags/fifo.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [notification](<https://devfeed.tech/tags/notification.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [push-notification](<https://devfeed.tech/tags/push-notification.md>), [push-notifications](<https://devfeed.tech/tags/push-notifications.md>), [queue](<https://devfeed.tech/tags/queue.md>), [queues](<https://devfeed.tech/tags/queues.md>), [real-estate](<https://devfeed.tech/tags/real-estate.md>), [sqs](<https://devfeed.tech/tags/sqs.md>), [sqs-queue](<https://devfeed.tech/tags/sqs-queue.md>), [step-functions](<https://devfeed.tech/tags/step-functions.md>)

### AI overview

SMG Real Estate replaced Step Functions for five-minute Search Alert batching with an SQS FIFO queue, cutting AWS costs in half and improving resilience to match spikes. Previously, each alert started a workflow that waited five minutes before invoking `LoadMatches`; repeated starts with the same execution name deduplicated pending work. The new flow uses FIFO's five-minute deduplication interval and delayed messages to batch equivalent messages containing a search alert ID. The team shadowed both flows, compared correlated trigger events and timing with Athena queries over exported CloudWatch logs, then routed a stable subset of alerts to each flow and gradually increased the FIFO share to 100%. FIFO pricing was cited as $0.48 per million messages versus $25 per million Step Functions state transitions. The approach suits five-minute batching; because FIFO deduplication lasts only five minutes, longer intervals still use Step Functions, with scheduled EventBridge triggers mentioned as a possible future option.

### Source excerpt

One of the core services for SMG Real Estate is Search Alerts -- a service that allows users to be notified about new properties published on ImmoScout24 and Homegate. For example, if a user is looking for a new apartment having N rooms and costing less than X, and not finding any matches now, they can create a search alert with those search criteria. When a new property matching those criteria is published, the user will be notified either via email or a mobile push notification. About the Search Alerts system Users can choose the frequency of notifications -- either every 5 minutes or every 4 hours (assuming there are any to be delivered). The vast majority of search alerts are configured with the 5-minute frequency. Just to get an idea of the scale, we have: Millions of published properties match saved search alerts every day More than a million emails and push notifications sent daily Check out our "Homegate's fast and modern search experience helps users find their dream home" blog post for an overview of how Search Alerts work. The Original Implementation In the original implementation we used an AWS Step Function to achieve the 5- minute batching of notifications: When a new property matching a search alert arrived, the StartSendNotificationProcess lambda would start a Step Function execution specific to that search alert. All it did was waiting for 5 minutes while the matches accumulated in the matches-{searchAlertId} SQS queue, which was programmatically created for that specific search alert If more matching listings arrived during the 5-minute waiting period, the StartSendNotificationProcess lambda attempted to start the step function execution with the same name. When it failed with the ExecutionAlreadyExists error, we knew there was already a SF for waiting. That way the deduplication of notification processes was guaranteed. After 5 minutes of waiting time, the Step Function execution proceeded with triggering the LoadMatches lambda that received the acc

## AWS API Gateway's Request Validation: Navigating the Quirks

DevFeed: [AWS API Gateway's Request Validation: Navigating the Quirks](<https://devfeed.tech/articles/aws-api-gateway-s-request-validation-navigating-the-quirks-23894.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/aws-api-gateways-request-validation-navigating-the-quirks-38285cb0a1c1?source=rss----2186e5b9bd8f---4>)

Author: Thomas Klein

Published: 2024-08-09T12:07:11Z

Content type: tutorial

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [Amazon API Gateway](<https://devfeed.tech/topics/amazon-api-gateway.md>), [API](<https://devfeed.tech/topics/api.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [API Logging](<https://devfeed.tech/topics/api-logging.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [api-gateway](<https://devfeed.tech/tags/api-gateway.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-api-gateway](<https://devfeed.tech/tags/aws-api-gateway.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [diy](<https://devfeed.tech/tags/diy.md>), [enum](<https://devfeed.tech/tags/enum.md>), [error](<https://devfeed.tech/tags/error.md>), [error-messages](<https://devfeed.tech/tags/error-messages.md>), [http](<https://devfeed.tech/tags/http.md>), [input](<https://devfeed.tech/tags/input.md>), [json](<https://devfeed.tech/tags/json.md>), [json-schema](<https://devfeed.tech/tags/json-schema.md>), [kermit](<https://devfeed.tech/tags/kermit.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [middy](<https://devfeed.tech/tags/middy.md>), [option](<https://devfeed.tech/tags/option.md>), [query](<https://devfeed.tech/tags/query.md>), [required](<https://devfeed.tech/tags/required.md>), [schema](<https://devfeed.tech/tags/schema.md>), [string](<https://devfeed.tech/tags/string.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [validation](<https://devfeed.tech/tags/validation.md>), [zod](<https://devfeed.tech/tags/zod.md>)

### AI overview

API Gateway checks that the `offerType` query parameter is present, but the example shows it accepting `KERMIT` despite the declared `RENT`/`BUY` enum. For POST and PUT bodies, it validates against JSON Schema Draft 4, yet reports failures with a generic "Invalid request body" message; details require checking logs. The article compares manual checks in a Lambda handler, which add per-parameter code and testing work, with Middy middleware that validates before business logic and improves handler typing. Its Zod example adds schema-based query validation, inferred types, and more detailed 400 responses. The text also names JSON Schema-based `@middy/validator` and AJV, and Zod and Joi as alternatives with different schema APIs. Middleware adds some request overhead, which the article suggests benchmarking for high-throughput APIs.

### Source excerpt

AWS API Gateway's request validation follows a specific set of rules that developers should be aware of when setting up their APIs. While it offers some validation features, it's important to understand its scope and limitations. Let's examine how it works with a common API configuration: parameters: - name: offerType in: query required: true description: RENT or BUY schema: type: string enum: - RENT - BUY With this configuration, API Gateway diligently checks for the presence of the query parameter, returning an HTTP 400 error if it's missing. However, it falls short when it comes to validating the actual value. Surprisingly, it would accept "KERMIT" without batting an eye, despite the clear enum specification. This behavior, while documented, can be a source of frustration for developers expecting more comprehensive validation. Interestingly, API Gateway shows more validation prowess with POST and PUT requests. It validates request payloads using JSON Schema Draft 4, demonstrating a somewhat inconsistent approach to input validation across different HTTP methods. Even when it does catch an error, API Gateway's feedback is less than illuminating. Instead of specific error details, you're met with a generic {"message": "Invalid request body"}. For more information, you'll need to dig into the associated log streams, which isn't ideal for surfacing error details in API responses. Example output in AWS console from a failed request validation when a body request validator is setup. API Gateway's validation is handy, but it leaves a lot to be desired. Developers often need to add extra checks for a truly robust API. While API Gateway supports various integrations and Lambda languages, let's focus on TypeScript. TypeScript's strong typing and runtime checks can catch issues early, sparing your users from cryptic error messages. Let's explore how to use this to make your API smarter and your users happier. Option 1: DIY Validation (AKA The "I've Got Trust Issues" Approac

## Update State Management with Pinia

DevFeed: [Update State Management with Pinia](<https://devfeed.tech/articles/update-state-management-with-pinia-23902.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/update-state-management-with-pinia-0d856a417535?source=rss----2186e5b9bd8f---4>)

Author: Dusko Peric

Published: 2024-03-21T14:43:21Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [pinia](<https://devfeed.tech/topics/pinia.md>), [state-management](<https://devfeed.tech/topics/state-management.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Web app](<https://devfeed.tech/topics/webapp.md>)

Tags: [pinia](<https://devfeed.tech/tags/pinia.md>), [state-management](<https://devfeed.tech/tags/state-management.md>), [vue-js](<https://devfeed.tech/tags/vue-js.md>), [vuejs](<https://devfeed.tech/tags/vuejs.md>)

### AI overview

Pinia's central simplification over Vuex is that actions can update state directly, removing Vuex's separate mutation-and-commit step; the excerpt illustrates this with an increment counter store. It describes Pinia's component-like syntax, separate stores for organizing application areas, and sharing state, actions, and getters through nested stores. Stores can use an Option Store style resembling Vue's Options API or a Setup Store style using the Composition API. The article also states that Pinia supports TypeScript and Vue Devtools and is about 1.5 KB. These are the article's stated advantages; the supplied text does not provide a broader feature-by-feature comparison.

### Source excerpt

In the development and maintenance of web applications, one of the crucial factors is the proper choice of state management. When it comes to Vue.js, we have two players in the game, where in my opinion, we have a clear winner. In this article, I will go through the functionalities brought by Pinia, which represent a step forward in this field. Intuitive API One of the problems in working with state is that it can very easily become confusing and complex. With its component-like structure, Pinia allows for easier understanding of how the store functions and interacts with your application. Let's look at an example to compare a Vue component with a Pinia store. Syntax similarity between Vue component and Pinia store This familiar syntax makes it a user-friendly and efficient solution for managing state. Excluding Mutations One of the key differences between Pinia and Vuex lies in the absence of mutations. In Vuex, the distinction between actions and mutations can become less clear-cut, particularly for complex stores. This redundancy can lead to repetitive code, adding unnecessary complexity to state management. Pinia takes a more direct approach. You can simply modify the state directly within actions. Let's see a code example to illustrate this concept: Vuex Store import { createStore } from 'vuex'; export default createStore({ state: { count: 0, }, mutations: { increment(state) { state.count++; // Update state through mutation }, }, actions: { increment({ commit }) { commit('increment'); // Dispatch mutation to update state }, }, }); Pinia Store import { defineStore } from 'pinia'; export const useCounterStore = defineStore('counter', { state: () => ({ count: 0, }), actions: { increment() { this.count++; // Directly update state within action }, }, }); In essence, Pinia removes an unnecessary layer of complexity by allowing direct state updates within actions. Modular stores design Pinia allow you to create multiple stores for different parts of your application,

## Automating Multi-Account Permission Management with AWS IAM Identity Center (previously AWS SSO)

DevFeed: [Automating Multi-Account Permission Management with AWS IAM Identity Center (previously AWS SSO)](<https://devfeed.tech/articles/automating-multi-account-permission-management-with-aws-iam-identity-center-previously-aws-sso-23893.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/automating-multi-account-permission-management-with-aws-iam-identity-center-previously-aws-sso-b1d85281963?source=rss----2186e5b9bd8f---4>)

Author: Niko Jernejsek

Published: 2022-12-22T10:32:09Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [AWS IAM Identity Center](<https://devfeed.tech/topics/aws-iam-identity-center.md>), [AWS Organizations](<https://devfeed.tech/topics/aws-organizations.md>), [Single sign-on (SSO)](<https://devfeed.tech/topics/sso.md>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [identity and access management](<https://devfeed.tech/topics/identity-and-access-management.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>)

Tags: [aws](<https://devfeed.tech/tags/aws.md>), [aws-eventbridge](<https://devfeed.tech/tags/aws-eventbridge.md>), [aws-iam](<https://devfeed.tech/tags/aws-iam.md>), [aws-iam-identity-center](<https://devfeed.tech/tags/aws-iam-identity-center.md>), [aws-organizations](<https://devfeed.tech/tags/aws-organizations.md>), [cicd](<https://devfeed.tech/tags/cicd.md>), [cloudformation](<https://devfeed.tech/tags/cloudformation.md>), [iam-identity-center](<https://devfeed.tech/tags/iam-identity-center.md>), [least-privilege](<https://devfeed.tech/tags/least-privilege.md>), [saml](<https://devfeed.tech/tags/saml.md>), [security](<https://devfeed.tech/tags/security.md>), [sso](<https://devfeed.tech/tags/sso.md>)

### AI overview

This article describes Homegate's multi-account AWS strategy and its use of AWS IAM Identity Center, formerly AWS SSO, to centrally manage permissions for engineers across AWS accounts. It explains the use of permission matrices, least-privilege access, AWS Organizations, external identity providers through SAML 2.0, and SCIM.

### Source excerpt

Background Homegate was founded in 2001 and is now the leading property marketplace in Switzerland. Few years ago we decided to re-architect our monolithic real estate platform towards micro services on top of AWS cloud. At the moment, Homegate workloads are running almost exclusively on server-less compute model with teams organised around micro services. We are utilising so called multi-account strategy where we structure our AWS accounts around individual micro services further breaking them down into different accounts according to software lifecycle, and organising them into the AWS Organizational Units. We've structured our AWS Organizations Units & AWS accounts according to the recommendations provided by AWS (https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/basic-organization.html#basic-organization-with-cicd-as-a-separate-function). Apart from having product workload accounts we also have accounts which are necessary to operate security, governance and platform related workloads. Access to accounts is governed by a permission matrix which is based on least privilege principles. The permission matrix classifies who (internally defined personas, e.g.: engineers/managers/security officers, etc) has what type of access (e.g. read-only or admin), and to what category of AWS accounts (e.g. production workloads, shared infra accounts, etc). Group of accounts in our Permission Matrix are at the same time AWS Organisational Units that we implement. As we have to manage permissions for hundreds of engineers to about hundred of AWS accounts accordingly, this way of grouping makes it easier for us to manage it at scale. IAM Identity Center PrimerIAM Identity Center Intro Note that I will be using AWS IAM Identity Center and AWS SSO interchangeably as even some services (such as CloudFormation) are still using the previous name AWS SSO. AWS IAM Identity Center is a single sign-on (SSO) service that allows AWS users to centrally manage acces

## Micro Service Events (AWS EventBridge vs. SNS)

DevFeed: [Micro Service Events (AWS EventBridge vs. SNS)](<https://devfeed.tech/articles/micro-service-events-aws-eventbridge-vs-sns-23899.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/micro-service-events-aws-eventbridge-vs-sns-2d86b5919c22?source=rss----2186e5b9bd8f---4>)

Author: Kristian Müller

Published: 2022-09-16T12:06:51Z

Content type: comparison

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [event driven](<https://devfeed.tech/topics/event-driven.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [Amazon Simple Queue Service (SQS)](<https://devfeed.tech/topics/amazon-simple-queue-service-sqs.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [AWS Lambda](<https://devfeed.tech/topics/aws-lambda.md>), [Amazon API Gateway](<https://devfeed.tech/topics/amazon-api-gateway.md>), [Amazon DynamoDB](<https://devfeed.tech/topics/amazon-dynamodb.md>), [Amazon S3](<https://devfeed.tech/topics/amazon-s3.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [api-gateway](<https://devfeed.tech/tags/api-gateway.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-eventbridge](<https://devfeed.tech/tags/aws-eventbridge.md>), [aws-sns](<https://devfeed.tech/tags/aws-sns.md>), [data](<https://devfeed.tech/tags/data.md>), [data-processing](<https://devfeed.tech/tags/data-processing.md>), [database](<https://devfeed.tech/tags/database.md>), [dynamodb](<https://devfeed.tech/tags/dynamodb.md>), [event](<https://devfeed.tech/tags/event.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [eventbridge](<https://devfeed.tech/tags/eventbridge.md>), [eventbus](<https://devfeed.tech/tags/eventbus.md>), [events](<https://devfeed.tech/tags/events.md>), [gateway](<https://devfeed.tech/tags/gateway.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [messaging](<https://devfeed.tech/tags/messaging.md>), [microservice-architecture](<https://devfeed.tech/tags/microservice-architecture.md>), [s3](<https://devfeed.tech/tags/s3.md>), [sns](<https://devfeed.tech/tags/sns.md>), [sqs](<https://devfeed.tech/tags/sqs.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

This article examines Homegate's event-driven microservice architecture on AWS and compares Amazon SNS with EventBridge as messaging infrastructure. It describes how services use SNS, SQS, Lambda, API Gateway, DynamoDB, and S3, and explains that EventBridge has a different focus, so replacing SNS is not necessarily the right question.

### Source excerpt

During the last few years, we've been busy rebuilding the Homegate platform in an event driven, micro service architecture based on AWS. One of the most important buildings blocks, or shall we rather say the mortar that connects the building blocks, is the way our services send events to each other. While Amazon offers its notification service SNS since more than 12 years; in 2019 it started a newcomer in the messaging bus field by introducing EventBridge. This was very interesting to us as we're using SNS a lot. Bus on a Bridge (Photo by "Blue Elf" on Wikimedia Commons) As EventBridge was introduced and gained traction we asked ourselves what advantaged we would gain by switching our SNS based service glue to EventBridge. Maybe this turned out to be the wrong question for us. Let's look at our system to see why. Micro Services Connected by SNS Homegate is connecting dozens of services via SNS right now. Those services range from single purpose Lambda functions written in TypeScript to database heavy services using Aurora or DynamoDB and Step Functions sending events to other services. Some of the services are also interfacing external APIs such as Salesforce or SendGrid. Here our Lambda functions can call APIs when needed. On the other hand, we have web services to be called as APIs by other systems and end users. This is mostly achieved via API Gateway. A typical service connects to the system by subscribing to events needed to fulfill its purpose. Those inbound SNS events are then ingested via SQS allowing for orderly data processing and DLQs to handle errors. Outgoing results are pushed back to the system in form of events to a SNS topics. As Marko Savic has pointed out, we're also utilizing S3 to store and replay those events if needed. Basic AWS Lambda function connected via SNS If we would replace the SNS topic by streams on the EventBridge we would initially gain the same functionality by utilizing SQS as well. However, EventBridge has a different focus. Let

## Coroutines on Android

DevFeed: [Coroutines on Android](<https://devfeed.tech/articles/coroutines-on-android-23898.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/coroutines-on-android-d3e3413e6aa7?source=rss----2186e5b9bd8f---4>)

Author: Stevan Milovanovic

Published: 2022-05-20T12:36:23Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [threadpools](<https://devfeed.tech/topics/threadpools.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>), [Structured concurrency](<https://devfeed.tech/topics/structured-concurrency.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-apps](<https://devfeed.tech/tags/android-apps.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [background](<https://devfeed.tech/tags/background.md>), [context](<https://devfeed.tech/tags/context.md>), [coroutine-testing](<https://devfeed.tech/tags/coroutine-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [job](<https://devfeed.tech/tags/job.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [launch](<https://devfeed.tech/tags/launch.md>), [networking](<https://devfeed.tech/tags/networking.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [processing](<https://devfeed.tech/tags/processing.md>), [scope](<https://devfeed.tech/tags/scope.md>), [thread](<https://devfeed.tech/tags/thread.md>), [thread-pools](<https://devfeed.tech/tags/thread-pools.md>)

### AI overview

The excerpt presents coroutines as a lightweight alternative to creating and stopping resource-intensive threads, and says they simplify asynchronous code by making parallel work resemble sequential code. It explains that scopes provide context and propagate cancellation to coroutines launched with builders such as `launch` and `async`; suspending functions allow coroutine work to pause; and a `Job` provides lifecycle control through cancellation and joining, with parent-child cancellation relationships. A dispatcher selects the thread or thread pool. The introduction says the article will demonstrate networking and background processing, but those implementation details are not included in the supplied excerpt.

### Source excerpt

Coroutines on Android In this article I'll try to explain why coroutines are useful and why would you want to use them in your project. After we go through the most important concepts of coroutines, I'll show you how I used coroutines to implement networking and background processing in the example project. First of all, you might ask yourself, why we want to use coroutines over threads? Main problem with threads is that they are resource intensive, meaning it takes a lot of resources to start a thread, stop a thread. Meanwhile, coroutines are lightweight threads, since they use thread pools. Another benefit of coroutines is that they greatly simplify asynchronous code. Callbacks and synchronisation are very easy to use. In fact, they make parallel programming look very much like sequential programming. Coroutines can be paused and resumed at any time, on a number of threads. And lastly, since coroutines are based on a few fairly easy to grasp concepts, their syntax is simple and easy to use. Here are the main concepts we need to explain about coroutines: Scope Coroutine scope, as its name says, defines a scope for new coroutines. Every coroutine builder (like launch and async) is an extension on CoroutineScope and inherits its coroutineContext to automatically propagate all its elements and cancellation. Context Coroutine context represents the context of its scope. Context is encapsulated by the scope and used for implementation of coroutine builders that are extensions on the scope. Scope provides a context in which the coroutine runs (state of the coroutine which provides variables, functionality of the coroutine etc.). Suspending functions Suspending functions are functions that can be run in a coroutine. They make callbacks seamless. They can be run in a coroutine (can be suspended) and that is why they can provide functionalities which have to be run in parallel. Job Job is a handle on that coroutine (on the piece of code which runs in the background). A laun

## Replaying events using AWS S3

DevFeed: [Replaying events using AWS S3](<https://devfeed.tech/articles/replaying-events-using-aws-s3-23901.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/replaying-events-using-aws-s3-3cc84242025e?source=rss----2186e5b9bd8f---4>)

Author: Marko Savic

Published: 2022-04-08T08:40:24Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [event driven](<https://devfeed.tech/topics/event-driven.md>), [AWS Step Functions](<https://devfeed.tech/topics/aws-step-functions.md>), [set up event-driven architecture AWS](<https://devfeed.tech/topics/set-up-event-driven-architecture-aws.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [AWS CloudFormation](<https://devfeed.tech/topics/aws-cloudformation.md>), [event-sourcing](<https://devfeed.tech/topics/event-sourcing.md>)

Tags: [amazon-sqs](<https://devfeed.tech/tags/amazon-sqs.md>), [api](<https://devfeed.tech/tags/api.md>), [api-gateway](<https://devfeed.tech/tags/api-gateway.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [aws-s3](<https://devfeed.tech/tags/aws-s3.md>), [aws-sns](<https://devfeed.tech/tags/aws-sns.md>), [cloudformation](<https://devfeed.tech/tags/cloudformation.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [event-sourcing](<https://devfeed.tech/tags/event-sourcing.md>), [events](<https://devfeed.tech/tags/events.md>), [failed](<https://devfeed.tech/tags/failed.md>), [failure](<https://devfeed.tech/tags/failure.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [resource](<https://devfeed.tech/tags/resource.md>), [s3](<https://devfeed.tech/tags/s3.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [sns](<https://devfeed.tech/tags/sns.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [step-functions](<https://devfeed.tech/tags/step-functions.md>), [storage](<https://devfeed.tech/tags/storage.md>), [versioning](<https://devfeed.tech/tags/versioning.md>)

### AI overview

Homegate describes using versioned AWS S3 objects to retain event history and replay failed or selected resource imports through AWS Step Functions. The importer stores each event in S3, using the resource ID as the key; bucket versioning preserves prior event versions for replay and debugging. For failures, a DLQ-based approach could have a scheduled Lambda fetch messages and restart the flow with the latest event when conditions such as retryability are met. For manual or flexible replays, an API Gateway endpoint accepts parameters such as resource selections or special handling; Replay SQS sits between handler and listener Lambdas, and the listener fetches events from S3 and starts Step Functions. The text presents these as possible mechanisms, not a guarantee that every failure is automatically recoverable.

### Source excerpt

In the world of event-driven microservices one of the important tasks is to have a mechanism to recover from failed events, as well as to have possibility to replay certain events. We at Homegate deal with serverless microservices. If, at any of these services, we encounter a failure during processing of an resource, we might need to recreate the last event or series of events for given resource. Usecase The central part of ingestion process is AWS StepFunctions that lives in a, so called, importer service. It is responsible for various enrichments and conditional actions on resource. The last step of the step function is sending an event to the AWS SNS which is consumed by many downstream services as you can see in the following diagram. Step functions as central part of ingestion process Here, many open questions can be identified: How to deal with failure within AWS StepFunctions? How to recreate SNS event if needed for downstream system? Would it be possible to replay the whole step function? Solution Possible answer to these questions would be to store events that goes through AWS StepFunctions into some kind of event storage, in Homegate case, we chose AWS S3. In order to support the whole history of events for given resource, S3 bucket versioning is used. This is quite handy for replaying series of events or even for debugging purposes. Here is a sample CloudFormation which enables that functionality: EventLogBucket: Type: 'AWS::S3::Bucket' Properties: BucketName: 'sample-unnique-bucket-name' AccessControl: Private PublicAccessBlockConfiguration: BlockPublicAcls: true BlockPublicPolicy: true IgnorePublicAcls: true RestrictPublicBuckets: true Tags: - Key: service Value: sample-service - Key: env Value: !FindInMap [ Stages, !Ref Stage , Env ] VersioningConfiguration: Status: Enabled That way we can replay the whole step functions flow using last logged event for given resource. That functionality could be available from different places, like DLQ or via api end

## AWS FIFO Queues with Message Groups for Atomic Processing at Scale

DevFeed: [AWS FIFO Queues with Message Groups for Atomic Processing at Scale](<https://devfeed.tech/articles/aws-fifo-queues-with-message-groups-for-atomic-processing-at-scale-23895.md>)

Original publisher: [Read original article](<https://medium.com/smg-real-estate/aws-fifo-queues-with-message-groups-for-atomic-processing-at-scale-dc70f8820b16?source=rss----2186e5b9bd8f---4>)

Author: Nick De Cooman

Published: 2022-03-03T09:55:58Z

Content type: article

Language: en

Sources: [Homegate Engineering Blog - Medium](<https://devfeed.tech/sources/homegate-engineering-blog-medium.md>)

Topics: [Amazon Simple Queue Service (SQS)](<https://devfeed.tech/topics/amazon-simple-queue-service-sqs.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [AWS Lambda](<https://devfeed.tech/topics/aws-lambda.md>), [Serverless](<https://devfeed.tech/topics/serverless.md>), [aws-sns](<https://devfeed.tech/topics/aws-sns.md>), [event-driven data processing](<https://devfeed.tech/topics/event-driven-data-processing.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [application](<https://devfeed.tech/tags/application.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [at-the-core](<https://devfeed.tech/tags/at-the-core.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [automatically](<https://devfeed.tech/tags/automatically.md>), [aws](<https://devfeed.tech/tags/aws.md>), [buffer](<https://devfeed.tech/tags/buffer.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [constraint](<https://devfeed.tech/tags/constraint.md>), [core](<https://devfeed.tech/tags/core.md>), [data](<https://devfeed.tech/tags/data.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [fifo](<https://devfeed.tech/tags/fifo.md>), [groups](<https://devfeed.tech/tags/groups.md>), [message](<https://devfeed.tech/tags/message.md>), [processing](<https://devfeed.tech/tags/processing.md>), [queues](<https://devfeed.tech/tags/queues.md>), [scale](<https://devfeed.tech/tags/scale.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [sqs](<https://devfeed.tech/tags/sqs.md>)

### AI overview

The excerpt describes an ingestion service that must process different listings in parallel while preventing simultaneous processing of events for the same listing. Its baseline AWS design fans events from SNS into SQS, where Lambda consumers process them; this scales automatically, but multiple consumers can process the same listing at once. Limiting consumption to one Lambda instance is presented as a simple safeguard, though the excerpt ends before detailing the titled FIFO message-group approach or its tradeoffs.

### Source excerpt

How to process multiple objects in parallel with the guarantee that for each unique object, only a single instance is processed simultaneously In a distributed, event-driven architecture, many challenges arise when processing large sets of data. One of them is the need for scalability when handling event streams with a substantial throughput. The challenge becomes even more complicated when processing these events involves atomic operations. In this case, we cannot simply process multiple events in parallel. As an example, let's say that we are building a service that ingests listings into our platform. The ingestion process involves several steps and requires multiple API operations. As a result, the whole ingestion can take up to several seconds per listing to complete. Now, here is where it gets tricky: a constraint of our service is that, while we are processing a listing, we cannot process other events for the same listing. The ingestion should be considered an atomic operation, and hence, only a single execution per listing can be performed simultaneously. At Homegate, we run most of our infrastructure on AWS in a serverless fashion. At the core of this, Lambda functions execute application logic. A common pattern is to use SNS topics to fan-out messages, and SQS for acting as a decoupling buffer between an SNS topic and some Lambda function. For our ingester service, a logical architecture could look like this: Listing events are published to a dedicated SNS topic. An SQS queue subscribes to this topic and consumes the events. Here, the events are buffered until a Lambda instance removes them from the queue and processes the corresponding listing. Under normal circumstances -- in which the processing would not involve an atomic operation -- this architecture would be a good fit. It would scale automatically relative to the number of Lambda instances that consume events from the queue, without much additional configuration. However, in the case where we cannot p