Payment gateway for a fintech platform
A high-load payment gateway on Laravel and Go: payment processing with guaranteed idempotency and 99.98% uptime.
- PHP
- Laravel
- Go
- PostgreSQL
- +2
Technology
The core relational database: complex queries, indexes, transactions, JSONB and optimization under load.
PostgreSQL has been my primary relational database for nine years, and I treat it as a full-fledged data-engineering tool, not just a storage. I start with schema design: I normalize data where appropriate, choose correct column types, set integrity constraints (NOT NULL, UNIQUE, CHECK, foreign keys with thought-out cascade rules) and lay down primary keys that reflect business meaning. For money and precise quantities I never use floating-point numbers — only numeric/decimal with explicit precision or integers in minor units. A strength of PostgreSQL is its rich SQL: I work freely with window functions, CTEs and recursive queries, aggregates, LATERAL joins and FILTER clauses, which lets me solve analytical tasks right in the database without offloading data into the application. Performance is a separate discipline: I read query plans with EXPLAIN ANALYZE, pick appropriate indexes (B-tree, GIN, GiST, partial and covering), watch for table bloat, tune autovacuum and analyze planner statistics. Understanding transaction isolation levels, locks and MVCC helps me avoid deadlocks and anomalies during concurrent writes. For semi-structured data I use JSONB with GIN indexes, for full-text search the built-in engine with tsvector, and for geodata, extensions. I run migrations carefully: on large tables I account for the risk of long locks during ALTER, use non-blocking index-creation strategies and plan maintenance windows. I ensure reliability through a thought-out backup strategy, point-in-time recovery, streaming replication and read replicas to distribute read load. On the application side I watch the connection pool (PgBouncer), fight the N+1 problem at the ORM level and cache hot queries. Experience has taught me that a well-designed database is half the success of the whole system: it sets integrity constraints, prevents data inconsistency and scales together with the product, remaining predictable under real load.
A high-load payment gateway on Laravel and Go: payment processing with guaranteed idempotency and 99.98% uptime.
A single API over a dozen courier services: cost calculation, order creation and real-time tracking.
Collecting and processing an event stream with real-time dashboards on Go, PostgreSQL and Redis.
Subscriptions, plans and automatic charges with precise money accounting and idempotent jobs.
A two-sided marketplace of providers and customers with search, orders and secure deals.
Gradually extracting microservices from a monolith without downtime: domain boundaries, events and orchestration in Kubernetes.