Being RESTful with billions of dollars in transactions
summary
Case study of a production REST API that handles credit card authorizations and settlements using nlohmann::json and cpp-httplib, mapping JSON to strong C++ types with from_json/to_json, pre/post routing handlers, IP bans and connection IDs, and a small in-memory datastore protected by a mutex. Claims about scale: 700M transactions/year and >$100B processed over months with 10–15x headroom. Demo client is blocking, server is working and open source.
AI-written summary · about
chapters (19)
- 0:00Introduction to financial REST APIs
- 1:23Credit card transaction basics
- 2:48RESTful API fundamentals
- 6:49REST server constraints explained
- 10:04JSON vs XML for transactions
- 13:38Header-only libraries benefits
- 17:55JSON for Modern C++ library
- 20:41CPP HTTP library overview
- 22:05Building the HTTP server
- 29:09REST endpoint routing
- 34:15Security and error handling
- 35:42Handling sale authorizations
- 38:08JSON serialization with types
- 41:20Creating an HTTP client
- 45:02Live demo walkthrough
- 46:07Dependency injection practices
- 48:34Strong typing with JSON
- 50:00Performance and scalability
- 51:24Q&A on API design
