EP 39: Accounting 101 in Payment Systems

This week’s system design refresher:



What is cloud native?

Below is a diagram showing the evolution of architecture and processes since the 1980s.

Organizations can build and run scalable applications on public, private, and hybrid clouds using cloud native technologies.

This means the applications are designed to leverage cloud features, so they are resilient to load and easy to scale.

Cloud native includes 4 aspects:

  1. Development process
    This has progressed from waterfall to agile to DevOps.

  2. Application Architecture
    The architecture has gone from monolithic to microservices. Each service is designed to be small, and adaptive to the limited resources in cloud containers.

  3. Deployment & packaging
    The applications used to be deployed on physical servers. Then around 2000, the applications that were not sensitive to latency were usually deployed on virtual servers. With cloud native applications, they are packaged into docker images and deployed in containers.

  4. Application infrastructure
    The applications are massively deployed on cloud infrastructure instead of self-hosted servers.

👉 Over to you: what comes into your mind when people talk about “cloud native”?


Accounting 101 in Payments

Why is a credit card called a “credit” card?
Why is a debit card called a “debit” card?
 
An example of a debit card payment is shown in the diagram below.

No alternative text description for this image

Let’s look at the issuing bank’s ledger as an example:
 
Bob pays $100 to the merchant with a debit card. We have two accounts involved in this transaction:

  1. Journal line 1 - From the issuing bank’s point of view, Bob’s bank account is a liability (because the bank owes Bob money). Bob’s bank account is deducted $100. 
    This is a debit record.

  2. Journal line 2 - Bank’s cash is an asset and the bank’s cash is deducted by $100.
    This is a credit record.

The balance sheet equation still balances with the two journal lines recorded in the ledger.
 
Bob’s card is called a “debit” card because it is a debit record when paying with a debit card. 
 
👉 Why is this important? 
This is how a ledger system is designed, only a real ledger is more complicated. 
Applying these strict accounting rules makes reconciliation much easier!


Evolution of Uber’s API layer

Uber’s API gateway went through 3 main stages.

First gen: the organic evolution. Uber's architecture in 2014 would have two key services: dispatch and API. A dispatch service connects a rider with a driver, while an API service stores the long-term data of users and trips.

Second gen: the all-encompassing gateway. Uber adopted a microservice architecture very early on. By 2019, Uber's products were powered by 2,200+ microservices as a result of this architectural decision.

Third gen: self-service, decentralized, and layered. As of early 2018, Uber had completely new business lines and numerous new applications. Freight, ATG, Elevate, groceries, and more are among the growing business lines. With a new set of goals comes the third generation.


Short/long polling, SSE, WebSocket

An HTTP server cannot automatically initiate a connection to a browser. As a result, the web browser is the initiator. What should we do next to get real-time updates from the HTTP server?

Both the web browser and the HTTP server could be responsible for this task.

👉 Over to you: of the four solutions (long polling, short polling, SSE, WebSocket), which ones are commonly used, and for what use cases?


17 Equations That Changed the World

What else should be included?


Featured job openings

HEIRSenior Software Engineer, Full Stack (United States)


Thanks for reading ByteByteGo Newsletter! Subscribe for free to receive new posts and support my work.