PayPal Backend Clone

Production-ready payment backend with event-driven settlement and distributed transactions.

Distributed SystemsFeb 2026 – Mar 20262 monthsCompleted
View Repository

Overview

PayPal Backend Clone is a production-inspired distributed payment system built using Spring Boot microservices. The project separates authentication, user management, wallets, ledger, payments, transaction graph, and notifications into independent services that can evolve and scale independently. The system is designed to explore modern payment backend architecture with asynchronous communication, distributed services, multiple databases, and production-ready observability.

Problem Statement

Modern payment platforms must process financial transactions reliably while managing user accounts, wallet balances, payment history, notifications, and audit records. As these responsibilities grow, a monolithic architecture becomes difficult to maintain and scale. This project explores how a payment platform can be decomposed into independent microservices that communicate efficiently while remaining scalable, fault tolerant, and easier to extend.

Features

  • JWT-based authentication
  • User management
  • Wallet management
  • Payment processing
  • Ledger management
  • Transaction graph service
  • Notification service
  • API Gateway
  • Apache Kafka event communication
  • Observability with Prometheus, Grafana and Zipkin

Core Services

The system is composed of independently deployable services, each responsible for a single business capability.

01

API Gateway

Single entry point for all external client requests.

02

Auth Service

Authentication and JWT token management.

03

User Service

User profile and account management.

04

Wallet Service

Maintains wallet balances and transactions.

05

Ledger Service

Stores immutable financial ledger records.

06

Payment Service

Processes payments between users.

07

Transaction Graph Service

Stores relationship-oriented transaction data using Neo4j.

08

Notification Service

Processes notification events.

Technology Stack

Technologies, frameworks, infrastructure, and tooling used throughout the development of this project.

Backend

Java 17 • Spring Boot • Spring Cloud Gateway • Spring Security

Database

MySQL • Redis • Neo4j

Messaging

Apache Kafka

Infrastructure

Docker • Docker Compose

Developer Tools

Prometheus • Grafana • Zipkin • Git • Postman

Engineering Decisions

Architectural choices made to improve scalability, maintainability, reliability, and long-term evolution of the system.

01

Microservice Architecture

Business capabilities such as payments, wallets, ledger, authentication, and notifications are separated into independent services to improve maintainability and scalability.

02

Event-Driven Communication

Apache Kafka is used to exchange events asynchronously between services, reducing coupling and improving system flexibility.

03

Polyglot Persistence

The system combines MySQL, Redis, and Neo4j so that each storage technology is used where it best fits the application's data access patterns.

04

Observability

Prometheus, Grafana, and Zipkin are integrated to monitor system health, collect metrics, and trace requests across services.

05

API Gateway

All incoming requests pass through a centralized API Gateway, simplifying routing and hiding the internal service topology.

Challenges

The most significant engineering challenges encountered while building the system.

01

Designing clear service boundaries for payment workflows.

02

Maintaining consistency across distributed services.

03

Managing communication using asynchronous Kafka events.

04

Handling multiple databases within a single platform.

05

Improving observability across independently deployed services.

What I Learned

Key technical concepts and engineering practices gained during the implementation.

01

Designing payment systems using microservice architecture.

02

Using Kafka for asynchronous service communication.

03

Applying different databases to different business requirements.

04

Building observable distributed systems.

05

Structuring production-style backend services.

Future Improvements

Potential enhancements that could improve scalability, reliability, and maintainability.

01

Implement Saga orchestration for distributed transactions.

02

Deploy the platform on Kubernetes.

03

Introduce distributed rate limiting.

04

Expand integration and end-to-end testing.

05

Add payment reconciliation workflows.