Santekno
Projects/Ad Credit Budget Integration
Backend / APILive

Ad Credit Budget Integration

Real-time ad-credit budget tracking from the ad-credit incentive program into the budget-management platform — polling plus event-driven, across global markets.

2026-3m-ad-credit-budget · main
# E-Commerce / Ads Budget
$ go -X POST /2026-3m-ad-credit-budget/v1/sync
→ 201 Created
{ "status": "ok" }
publish 2026-3m-ad-credit-budget.synced
Role
Backend Engineer
Timeline
2026
Team
4
Domain
E-Commerce / Ads Budget
Stack
11 tech
Status
Live
01

Overview

This project integrated Ad Credit budget data from the ad-credit incentive program into the budget-management platform so ad credit issued via a seller incentive program could be tracked in real time for occupancy, usage, and recycling. I owned the resource-sync-service and budget-consumer-service modules — design, implementation, integration, and multi-region validation.

A backend has no screens, so its "UI" is the operational surface: sync dashboards, the event/ops flow, and reliability metrics.

Grafana — sync freshness & lag
Event flow — budget-bill triggered sync
Ops view — occupancy / used / recycle tracking
03

Problem & Solution

Problem

Before this integration, monitoring of ad credit (a traffic-type resource) depended on risky offline processes. That made accurate, timely visibility into consumption hard, raised operational risk, and limited consistent management of the resource across global markets.

Solution

I built a hybrid synchronization architecture: a scheduled polling task (ad-credit sync task) that syncs ad-credit line and program data from the ad-credit incentive program every 30 minutes, plus event-driven sync triggered by budget-bill changes for near-real-time consistency. The work also included external API integration (ad-credit paging APIs), service-side RPC handlers, multi-tenancy, security approvals, and retry/backoff for submission reliability. I validated multiple regional flows through extensive self-testing.

04

Workflow

Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.

flowchart diagram

ad credit data

change event

Ad-Credit Program

Resource Sync Service

Budget Bill

Budget Consumer Service

Budget Management Platform

Use case interaction
sequence diagram
Budget Management Platformbudget-consumer-serviceAd-Credit Program APIsresource-sync-serviceScheduler (30m)Budget Management Platformbudget-consumer-serviceAd-Credit Program APIsresource-sync-serviceScheduler (30m)ad-credit sync taskad-credit paging APIscredit lines & programssync occupancy / used / recycleupdate budget state
Sequence flow
05

Architecture

flowchart diagram

metrics

Ad-Credit Program APIs

Resource Sync Service · Go

Scheduler

Budget Bill Events

Budget Consumer Service

RDS

Budget Management Platform

Prometheus / Grafana

System architecture
Architecture notes

resource-sync-service pulls data from the ad-credit incentive program via scheduled polling and reacts to budget-bill events, then hands off to budget-consumer-service, which updates budget state in the budget-management platform. The polling + event-driven hybrid balances freshness with load, and all paths run across multiple regions with Prometheus/Grafana monitoring and retry/backoff on external calls.

state diagram

consumption reported

release

occupied

used

recycled

Resource sync lifecycle
06

Features

Operations
  • Real-time occupancy, used & recycle tracking
  • Visibility into ad-credit budget consumption
System
  • Scheduler-based polling (every 30 min)
  • Event-driven sync on budget-bill changes
  • Integration with external program APIs
  • Multi-tenancy
  • Retry & backoff for robust submission
  • Security-reviewed RPC interfaces
07

Tech Stack

language
Go
framework
RPC frameworkHertz
scheduler
Scheduling Framework
protocol
RPCHTTP
database
Managed RDS (relational database)
infra
Multi-region
security
Security Review
observability
PrometheusGrafana
08

Engineering Challenges

01
Replacing risky offline monitoring with reliable real-time sync

Ad-credit resources were tracked via offline processes, creating visibility and consistency risk. Fix: a hybrid of scheduled polling and event-driven triggers on budget-bill changes to keep data fresh.

02
Integrating an unstable external platform

The ad-credit incentive program APIs added latency and failure risk. Fix: retry and backoff logic on proposal submission plus multi-region validation to keep sync trustworthy.

09

Outcomes

30 min
scheduler polling interval
3
regions supported
2
external program APIs integrated
PASS
multi-region self-test result
10

Lessons Learned

Cross-platform budget integrations need both scheduled reconciliation and event-driven updates to stay accurate. Treating external-API instability as a first-class design concern — retries, backoff, multi-region validation — was essential to a trustworthy sync system.

11

Related Santekno Tutorials

Interested in working together?

Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.