Skip to main content
GullySystem

Serverless Architecture Development for Event-Driven Applications

Serverless architecture development designs applications around managed functions and events. It decides where state lives, how one event triggers several steps, and how the system behaves when a later step fails.

Decisions made before any function is written

How small should a function be? Which steps belong together, and which need their own queue? Where does a half-finished workflow wait? Poor answers work in testing and then become hard to follow at the first production failure.

What the design covers

Event flow and boundaries

The design shows which event triggers which function, drawn so a new engineer can follow a request from arrival to completion.

State outside the function

Sessions, uploads and partial progress are kept in storage or a database, because a function keeps nothing between runs. State lives elsewhere.

Failure and retry behaviour

It defines what a repeated message must not do twice, and where an event lands after it has failed a set number of times.

A cost model before the build

Expected invocations, duration and storage are turned into a monthly estimate that you can compare against running a server.

Awkward parts that are planned for

  • Cold starts, where the first call after a quiet spell is slower
  • Database connection limits, which a burst of functions can exhaust at once
  • Local testing, which needs deliberate effort on this model
  • Tracing one request across several functions when something fails

Idempotency and retries

Queues and event services deliver a message at least once, so duplicates will arrive. A handler that charges a card or sends an email twice causes real harm. Each handler is written to give the same result when repeated, by checking a unique request key before acting. Failed messages move to a dead-letter queue where a person can inspect them. AWS’s Lambda guidance warns that event source mappings deliver each record at least once, so duplicates can occur. It also says to keep a queue’s visibility timeout above the function’s expected run time, since a mismatch can cause duplicate invocations.

Limits that shape the design

Execution time

Functions have a maximum run time set by the provider. Long jobs are split into steps or handed to a container service.

Trigger caps

The service in front of a function can impose its own, shorter limit on how long a caller waits. Slow work is made asynchronous.

Payload size

Events and responses have size ceilings. Large files travel through object storage, and the event carries only a reference.

Concurrency

A sudden burst launches copies in parallel and can overwhelm a database. A concurrency limit protects it.

Patterns that recur

  • Upload to storage triggers processing
  • Order placed publishes an event that billing, stock and notifications each consume
  • Scheduled function summarises data overnight
  • A step-by-step workflow service coordinates a multi-stage process with retries

Where serverless builds go wrong

Functions calling functions directly

Chained synchronous calls multiply cost and failure points. Queues or events decouple them.

One function doing everything

A giant handler recreates a monolith with worse tooling. Separate concerns by event.

No observability

Without correlation IDs and structured logs, tracing a failed order across five functions takes hours.

How an event-driven build is used day to day

An event-driven application behaves differently from a screen-driven one. Work starts when something happens, such as a file arriving or an order closing. Operations and support staff watch events rather than servers. Staff read each night’s log in the morning.

An order arrives overnight

The event starts a chain: stock check, payment, confirmation message. Staff arriving in the morning read the outcome of each step, not a queue of tasks. Nothing is lost.

Support finds a stuck event

A customer says the confirmation never came. Support opens the event log, finds the step that failed and replays it from there. The same order is not charged twice, because each step checks first. Replays are safe.

Developer reads the dead-letter queue

Events that failed repeatedly wait in a separate queue. A developer reads it each morning, fixes the cause and releases them again. An empty queue is the sign of a quiet night. A short queue is healthy.

Month-end cost review

The owner reads which functions ran longest and what they cost. A function triggered far more than planned is investigated. The aim is a bill that follows the business, with no unexplained spikes. Surprises are rare.

Make an informed decision

Agree the evidence before signing off this part.

Use a representative scenario to decide what this part of the system must show and where review is still needed.

No observability

Who responds when a critical customer journey fails?

For “No observability”, trigger a harmless failure in a test environment. Check that an alert reaches the named responder with enough context to investigate, then agree how the team records recovery.

Background reading: Google SRE: monitoring distributed systems

Idempotency and retries

Which identifier keeps two similar names from becoming the same record?

Choose similar-looking entries in “Idempotency and retries” and agree how the team distinguishes them. Check which linked history must remain separate before approving a merge or import.

Background reading: ERPNext: importing linked records

FAQ

Frequently asked questions

Is serverless architecture suitable for a large application?

For parts of one, yes. Event-driven and background work fits well, while a busy transactional core is better on servers. A mixed design is common.

Do we still need a database?

Yes. Functions hold nothing between runs, so state lives in a managed database or object storage chosen alongside the design.

What if we already have a working backend?

Then it is not rewritten. New event-driven pieces can run on functions beside what exists.

Will our infrastructure cost less?

It depends on the load. Bursty work costs less because idle time is not billed, while steady load can cost more. The figures are estimated before you commit.

Is serverless the same as having no servers?

No. Servers still exist, but the provider runs them. You deploy code and configuration instead of managing machines.

What is a cold start?

It is the extra delay when the platform prepares a new instance of your function after a quiet period. Package size and language choice influence it. Where it matters, keep-warm settings or a different design handle it.

Does serverless cause vendor lock-in?

Partly. Triggers and managed services are provider-specific, though the business logic can stay portable. Where the coupling sits is stated in the design.

How do we stop a function calling itself in a loop?

Avoid designs where a function triggers the event that invokes it again. If a loop starts, setting reserved concurrency to zero throttles every invocation while the code is fixed. Budget alerts give an early warning.

Talk to us

Tell us what you need.

Tell us what your team does today, where work gets stuck and what you want to change.

What happens after you share your requirements

  1. We review your brief and the systems you already use.
  2. We clarify the workflow, missing information and the work to consider first.
  3. The proposed scope sets out the deliverables, responsibilities and dependencies.
  4. Review the scope and commercial terms before deciding whether to proceed.

Start with your requirements

Describe your current process, the people involved and the change you need. Start with the details you know; we can clarify the rest together.

Share your requirements