Discover the architectural, database, and design principles required to build a high-scale fintech wallet, drawing key lessons from Barq's massive $329.5M Series A.

When Saudi fintech barq closed its massive 329.5 million dollar Series A funding round in September 2026, the global financial technology sector paused to look closely at the numbers. In just two years of operating in stealth and open markets, the Riyadh-based digital payments platform achieved a valuation of 1.85 billion dollars, entering the unicorn club at a speed rarely seen in the region. Led by Ahmed Alenazi, the former chief executive officer of stc pay, barq has quietly built a user base exceeding 15 million individuals representing over 210 nationalities. Even more staggering is the volume, as the platform has processed over 440 billion Saudi Riyals, which is roughly 117.3 billion US dollars, in funds since its launch.
For product managers, engineering directors, and founders, these numbers are not just a business milestone. They represent a massive technical challenge. How do you build a platform that handles that amount of transaction volume without falling apart? At Algoramming, we work with enterprise clients to build high-scale payment systems, and we know that scale is the ultimate test of software engineering. When you scale from thousands of transactions a day to millions, minor database locks and latency issues turn into system-wide outages.
Building a digital wallet that can scale to millions of users requires moving past simple software templates. You cannot just put a database behind an API and hope for the best. You need a deeply considered architecture that handles double-entry ledgers, database connection pooling, microservices orchestration, and cross-border payment rails. In this guide, we will break down the exact architectural principles, database strategies, and design paradigms required to build a high-scale fintech wallet capable of handling unicorn-level volumes.
Building a high-scale fintech wallet requires a distributed, double-entry ledger architecture, robust database scaling (such as read replicas and connection pooling), real-time asynchronous message queues for transaction orchestration, and strict regulatory compliance. These systems must process thousands of concurrent transactions under a strict 200-millisecond latency budget while maintaining absolute data integrity.
To reach this level of performance, you must eliminate single points of failure across your entire system. This means decoupling your transaction-heavy balance updates from your read-heavy user interface queries, ensuring that user actions like checking a balance do not block active payments. It also requires building deep, resilient integrations with global payment partners and local central bank infrastructure to ensure high availability and fast settlement times across multiple jurisdictions.
The scale achieved by barq is a clear indicator of how fast the Gulf region's financial infrastructure is maturing. Backed by prominent regional investors including Noon Investments, Sohar International Bank, and M20 Fund, barq has become one of the fastest-growing digital wallets in the Middle East. The platform provides comprehensive digital accounts, Visa cards, local and international transfers, rewards programs, and custom social features like "Gutta" for splitting bills among users.
This growth is occurring alongside a broader digital transformation in Saudi Arabia. Electronic payments now account for over 85% of retail transactions in the Kingdom, driven by regulatory support from the Saudi Central Bank, also known as SAMA. cross-border payments have become a major focus, as shown by barq's partnerships with global payment networks like Thunes and Alipay+ to enable cross-border QR payments across 220 markets.
Handling 15 million users means processing thousands of API requests every single second. To do this, your engineering team must transition from a monolithic architecture to a highly specialized microservices ecosystem. Each component of the wallet, from identity verification to the core ledger, must be isolated so that a spike in one area does not bring down the entire platform. This separation is what allows a high-scale fintech wallet to remain fast and secure, even when millions of users are active simultaneously.
Scaling to 15 million users and processing over 117 billion dollars in transactions requires an architecture that prioritizes absolute database consistency and sub-second transaction routing.
At the center of any financial application is the ledger. This is the source of truth that records who has what money. When building a high-scale fintech wallet, the most important rule is that you must never use a single column in a database to represent a user's balance. If you simply update a balance column with an addition or subtraction query, you will eventually experience data corruption. Race conditions, network timeouts, and concurrent database writes will lead to balance discrepancies that are incredibly difficult to resolve.
Instead, professional fintech systems use double-entry bookkeeping. Every financial event must be recorded as two opposing entries: a debit from one account and a credit to another. The sum of all debits and credits in the system must always equal zero. This design ensures that money is never created or destroyed out of thin air. The ledger becomes an immutable append-only log, meaning you never use database update queries on transaction rows. If a mistake is made, you do not edit the existing row; you write a new transaction to reverse or correct the balance.
To implement this at scale, we separate the ledger into two distinct layers:
When a user initiates a transfer, the system first verifies that the source account has sufficient funds by checking the balance cache. It then writes a pending transaction to the journal. Once the journal entry is successfully committed, the system updates the account balance cache and schedules the actual database balance update. This separation ensures that the critical write path is as fast and simple as possible, reducing the time database locks are held.
we must design the system to handle multiple transaction states. A transaction is rarely instantaneous. It moves from pending, to authorized, to captured, or sometimes to reversed. Your ledger must support these transitions natively, keeping track of "available balance" versus "ledger balance" so that users cannot spend money that is currently held for an authorized but uncaptured transaction.
When you are scaling a fintech wallet app to handle millions of transactions, the database is almost always your primary bottleneck. Relational databases like PostgreSQL are excellent for financial systems because they offer ACID (Atomicity, Consistency, Isolation, Durability) guarantees, which are essential for ledger integrity. However, relational databases do not scale horizontally out of the box.
To resolve this, we implement a multi-tiered database strategy. First, we separate read operations from write operations. In a typical wallet app, users check their balance and view transaction history far more often than they send money. By implementing read replicas, we can route all read-heavy queries to secondary database instances. This leaves the primary database instance dedicated exclusively to handling transaction writes. For a detailed guide on setting this up, you can read our Supabase Postgres scaling guide, which covers read replicas and connection pooling in production environments.
Second, we must manage database connections carefully. Every transaction write requires an active database connection. If your API servers open a new connection for every incoming request, you will quickly exhaust the database's connection limit, causing the system to reject new payments. We use high-performance connection poolers like PgBouncer to queue and reuse database connections efficiently. This keeps your database stable, even during peak shopping hours or regional holidays when transfer volumes spike.
as data grows into billions of rows, table partitioning becomes necessary. We partition the ledger journal table by date (for example, monthly or weekly partitions). This keeps the active indexes small enough to fit into memory, ensuring that insert queries remain incredibly fast. Our article on PostgreSQL scalability bottlenecks offers deep insights into partitioning strategies and query optimization for high-performance systems.
| Scaling Strategy | Target Bottleneck | Primary Benefit | Implementation Cost |
|---|---|---|---|
| Read Replicas | High CPU on read queries | Offloads balance checks and history from primary | Moderate |
| Connection Pooling | Connection exhaustion | Allows thousands of API workers to share DB pools | Low |
| Table Partitioning | Large index memory footprint | Keeps transaction inserts fast as history grows | High |
| Redis Caching | Repetitive read latency | Sub-millisecond response times for user profiles | Low |
A high-scale payment system cannot rely on synchronous HTTP requests to process every step of a transaction. If your API gateway has to wait for fraud checks, ledger updates, push notifications, and external partner settlement before responding to the user, the request will likely time out. To build a highly responsive system, we use an asynchronous, event-driven architecture.
The API gateway acts as the entry point, receiving the transfer request, validating the basic payload, and immediately publishing a "Transaction Initiated" event to a distributed message queue like Apache Kafka or RabbitMQ. The gateway then returns a "Pending" status to the client app. This entire process takes less than 50 milliseconds, ensuring a highly responsive user experience.
Behind the scenes, specialized microservices subscribe to these events and process them in a structured pipeline:
By decoupling these tasks, we ensure that a delay in the notification system does not slow down the actual transaction processing. If the SMS gateway experiences an outage, the ledger service continues to process transactions as normal, and the notification events are simply queued and delivered once the SMS service recovers.
One of barq's key differentiators is its ability to serve a highly diverse population, with users representing more than 210 nationalities. In regions like Saudi Arabia and the wider Gulf, international remittances are a major part of the daily financial ecosystem. To handle this, a high-scale fintech wallet must connect seamlessly with global clearing networks and regional payment rails.
When building these integrations, we work with cross-border payment infrastructure providers like Thunes to handle international money transfers. We also build integrations with solutions like Alipay+ to enable cross-border QR code payments at millions of retail merchants worldwide. agreements like the recent deal between the Saudi Central Bank and the Qatar Central Bank to link national payment schemes (mada and HIMYAN) demonstrate the importance of regional interoperability.
From an engineering perspective, integrating with these external partners requires building a robust, fault-tolerant integration layer. We use the Saga pattern to manage distributed transactions across multiple external APIs. Because we cannot control the uptime or response times of third-party banking networks, our integration services must support idempotent API requests, automated retries with exponential backoff, and reconciliation engines that run daily to verify that our internal ledger matches the external clearing reports.
[User App] ---> [API Gateway] ---> [Internal Ledger]
|
v
[Saga Orchestrator]
/ | \
/ | \
v v v
[FX Engine] [Thunes API] [mada Network]This ensures that even if an external API call fails halfway through a transfer, the system can automatically recover, complete the transaction, or safely reverse the funds without manual intervention from your customer support team.
A great backend architecture is useless if the frontend app is difficult to navigate or slow to load. Designing a digital wallet for millions of users means accounting for different languages, devices, and network speeds. When we provide UI/UX design services for fintech clients, we focus on minimizing friction in the user journey while maintaining strict compliance requirements.
One of the major challenges is the customer onboarding and Know Your Customer, also known as KYC, process. To comply with local regulations, users must verify their identity, which often involves integrating with government databases or third-party biometric verification tools. We design these onboarding flows to be progressive, collecting only the essential information needed to open a basic account, and prompting the user for additional verification only when they want to unlock higher transaction limits.
Another critical design area is the presentation of financial data. When users open their wallet, they expect to see their current balance immediately. We use local-first caching strategies in our mobile app design and development process to display the last-known balance instantly, while silently fetching the latest balance from the server in the background. This prevents the app from feeling sluggish, even on slower mobile networks.
Finally, social features like bill splitting (or barq's "Gutta" feature) require careful design to ensure they feel intuitive. These features involve complex multi-party ledger interactions, but to the user, it should be as simple as selecting contacts from their phone book and entering an amount. We build these features using real-time websocket connections to ensure that split requests and payment confirmations are updated instantly across all participants' devices.
In the financial industry, security is not a feature; it is the foundation of the business. When building a digital wallet, you must design for security at every level of the stack, from the mobile client to the database storage. In Saudi Arabia, digital wallets must comply with SAMA's strict Cyber Security Framework, which outlines clear mandates for data protection, access control, and incident response.
To protect sensitive user data, we implement strict encryption in transit and at rest. All user credentials and payment tokens are stored using Hardware Security Modules, also known as HSMs, or secure enclave technologies provided by cloud platforms. This ensures that even if a database is compromised, the actual cryptographic keys used to sign transactions remain inaccessible to attackers.
We also focus heavily on application-level security. This includes implementing automated AI security code audits in the development pipeline to catch security vulnerabilities before the code is deployed to production. we work on securing our codebases against automated threats, ensuring that API endpoints are protected against credential stuffing, brute force attacks, and distributed denial of service attempts.
Finally, we implement real-time transaction monitoring to detect and prevent fraud. By analyzing user behavior patterns, device fingerprints, and transaction locations, our systems can flag and block suspicious transfers in real time. This requires building high-throughput, low-latency rules engines that can evaluate every transaction against hundreds of fraud indicators within a 50-millisecond window.
While building a highly scalable, distributed architecture is necessary for platforms like barq, it comes with significant trade-offs. The primary challenge is complexity. A distributed, microservices-based wallet with read replicas, event queues, and double-entry ledgers is far more difficult to build, test, and maintain than a monolithic application.
First, let's look at the financial investment. Developing a high-scale payment system is a major project. For a professional, compliant, and production-ready digital wallet platform, you should expect the following cost ranges:
Because of this high entry cost, this advanced architecture is not the right fit for early-stage startups that are still validating their product-market fit. If you are in the pre-seed stage, building a highly complex, custom ledger from day one is a mistake. You will spend your entire budget on backend infrastructure instead of testing your value proposition. In those cases, we recommend using third-party Banking-as-a-Service, or BaaS, APIs to launch quickly, and migrating to a custom architecture only after you have secured sufficient traction and funding.
One common pitfall we see in practice is premature ledger optimization. Engineering teams often try to build complex sharding and distributed ledger databases before they have the transaction volume to justify it. This leads to split-brain scenarios and data synchronization issues that can halt transaction processing entirely. We always advise clients to start with a highly optimized, single-instance relational database for writes, and scale horizontally using read replicas and asynchronous workers only when the transaction metrics demand it.
If you are planning to build a digital wallet in the Middle East, partnering with an experienced software development company in Saudi Arabia can help you navigate these technical and regulatory challenges efficiently, ensuring your platform is built to scale from day one.
Key takeaways
- Use Double-Entry Bookkeeping: Never use simple database update queries on balance columns; use immutable, append-only logs for all transactions.
- Decouple Reads and Writes: Implement read replicas and caching to ensure that heavy user traffic checking balances does not block active payments.
- Leverage Event-Driven Orchestration: Use asynchronous message queues to decouple transaction processing steps and maintain sub-second API response times.
- Plan for Regulatory Compliance: Integrate strict security measures, HSM encryption, and automated compliance auditing into your core development pipeline.
A high-scale fintech wallet is a digital payment platform designed to handle massive transaction volumes and millions of concurrent users. It uses distributed system architectures, double-entry ledgers, and database replica strategies to process payments securely and with sub-second latency.
Building a basic fintech wallet MVP typically costs between 150,000 and 300,000 US dollars. An enterprise-grade, high-scale platform with custom ledgers, advanced fraud detection, and regulatory compliance integrations generally ranges from 600,000 to over 1,500,000 US dollars.
To prevent balance discrepancies, you must use an immutable double-entry ledger system. Every financial transaction is recorded as a debit from one account and a credit to another, ensuring the overall system balance always nets to zero.
PostgreSQL is preferred because it offers ACID compliance, which guarantees transaction reliability and data integrity. By combining PostgreSQL with PgBouncer for connection pooling and read replicas for read queries, we can scale the database to handle heavy transaction volumes.
International transfers are handled by integrating with global clearing networks like Thunes or regional cross-border payment schemes. These integrations require building resilient integration layers that support real-time foreign exchange calculations and automated reconciliation.
A startup should build a custom wallet when they have validated product-market fit, reached high transaction volumes, or require proprietary features like custom rewards or social payments. Early-stage startups should stick to Banking-as-a-Service APIs to save capital.
Digital wallets must comply with local regulations, such as SAMA's guidelines in Saudi Arabia, and global standards like PCI-DSS. This requires implementing end-to-end encryption, tokenization, hardware security modules, and real-time automated fraud detection systems.
Developing a fully compliant, high-scale digital wallet usually takes between 9 to 18 months. This timeline depends on the complexity of the integrations, regional regulatory approvals, and the scale of the custom ledger architecture.
Building a digital wallet that can scale to the level of barq's 15 million users is a major technical challenge. It requires a deep understanding of database performance, microservices orchestrations, and secure ledger design. By focusing on double-entry principles, robust database scaling, and event-driven architectures, you can build a platform that is secure, fast, and compliant.
At Algoramming, we specialize in helping businesses build and scale complex financial systems. If you are planning a high-scale payment project, we can help you design and build an architecture that is ready for unicorn-level growth. Whether you need a trusted custom software development partner or strategic tech partnership and consultation to refine your system design, our team is here to help you build the future of finance.
01 · RelatedDiscover the most common PostgreSQL scalability bottlenecks and how to solve them. Learn how to optimize connection pooling, manage table bloat, configure read replicas, and partition massive databases.
Read post
02 · RelatedA deep architectural comparison of Citus, Multigres, and manual sharding for horizontal scaling in PostgreSQL. Learn how to scale your database without hitting the Postgres cliff.
Read post
03 · RelatedExplore NVIDIA's new native CUDA Rust toolchains, cuda-oxide and cutile-rs. Learn how compile-time-safe GPU programming accelerates cloud infrastructure without sacrificing performance.
Read postWe will reply in plain English within one business day, NDA on request. Discovery call is free.
We design and engineer software, mobile, and web products end-to-end. Send the brief, we will reply within one business day.
Start a projectWe send a short email whenever we publish a new field note or ship a studio update. No fixed schedule, no filler.
Unsubscribe in one click. We never share your address.