SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
Active/Active Payments Processing
at Square
Ted Mao and Jiang-Ming Yang
October 2014
Active/Active
!
What
• Resilient to datacenter-level failure
• Resilient to Internet routing
problems
• Transparent to the merchant
• No human intervention
!
Why
• Every second of uptime matters to
our merchants. Goal is 5 9s.
• Much easier and safer to perform
datacenter-level maintenance.
Challenges
!
Inconsistent state between
datacenters
Datacenters can’t tell if a transaction
has already been processed
elsewhere.
!
Limited idempotence
Payment networks can’t reliably
guarantee idempotence on retries.
!
Real-time latency requirements
We can’t just wait until our
datacenters get in sync.
!
!
Concepts
Client idempotence key
Concepts
Client idempotence key Server transaction
Concepts
Client idempotence key Server transaction Transaction progression
Card Processing
Multi-DC resolution
Multi-Tender
Multi-DC challenge
Scenario
When Merchant try to sell items/products to customers, customers will
have the option to pay with multiple tenders.
!
APIs
1. 1. CreateBill
2.2. AddTender
3.3. CompleteBill / CancelBIll
!
Challenges
1. 1. Each time we receive a tender request, we need to process this
tender immediately. Thus different tenders for the same bill may be
processed at different data centers.
2.2. When receiving the CompleteBill request, we may need to wait for
the tender information from remote data center.
Multi-Tender
Multi-DC resolution
Multi-Tender
Multi-DC resolution
State Machine
Tender state machine
!
!
!
!
Bill state machine
!
!
!
Correctness
1. 1. A formal proof
2.2. Simulate all the possible operational combinations and verify the
results
Caveats
Eventually consistent
Asynchronous, eventually consistent
systems are harder to reason about.
!
Complex
Active/active systems are harder to
design, implement, and test.
!
Data Loss
If the original data center is down and
never comes back, we may not be able
the perform the capture due to the loss
of original auth.
!
Downstream effects
Not all downstream effects are
reversible.
Future Plans
!
We want a storage solution with the
following properties:
1. Horizontally scalable
2. Tolerant to DC failure
3. Transactional
!
CockroachDB: a Scalable, Geo-
Replicated, Transactional Datastore
!
!
!
!
!
http://cockroachdb.org/
Q&A

Más contenido relacionado

Similar a Active_Active Payments Processing

PayU Biz Product Deck (1)
PayU Biz Product Deck (1)PayU Biz Product Deck (1)
PayU Biz Product Deck (1)
ICICI Bank
 

Similar a Active_Active Payments Processing (20)

PayU Biz Product Deck (1)
PayU Biz Product Deck (1)PayU Biz Product Deck (1)
PayU Biz Product Deck (1)
 
Tisc99keynote
Tisc99keynoteTisc99keynote
Tisc99keynote
 
Introducing safex pay june2017
Introducing safex pay june2017Introducing safex pay june2017
Introducing safex pay june2017
 
Introducing safex pay june2017
Introducing safex pay june2017Introducing safex pay june2017
Introducing safex pay june2017
 
EMV in the Cloud
EMV in the CloudEMV in the Cloud
EMV in the Cloud
 
BizDay: Improving Remittances in the World's 2nd Largest Corridor, Digiledge
BizDay: Improving Remittances in the World's 2nd Largest Corridor, DigiledgeBizDay: Improving Remittances in the World's 2nd Largest Corridor, Digiledge
BizDay: Improving Remittances in the World's 2nd Largest Corridor, Digiledge
 
E-commerce & WordPress: Navigating the Minefield
E-commerce & WordPress: Navigating the MinefieldE-commerce & WordPress: Navigating the Minefield
E-commerce & WordPress: Navigating the Minefield
 
PayU's Digital Transformation: Transparency from Dev to Prod, Monitoring Micr...
PayU's Digital Transformation: Transparency from Dev to Prod, Monitoring Micr...PayU's Digital Transformation: Transparency from Dev to Prod, Monitoring Micr...
PayU's Digital Transformation: Transparency from Dev to Prod, Monitoring Micr...
 
Orchestration of Microservices - Google dev fest 2017 Berlin
Orchestration of Microservices - Google dev fest 2017 BerlinOrchestration of Microservices - Google dev fest 2017 Berlin
Orchestration of Microservices - Google dev fest 2017 Berlin
 
Guide to terminals_(sg)
Guide to terminals_(sg)Guide to terminals_(sg)
Guide to terminals_(sg)
 
Transforming Consumer Banking with a 100% Cloud-Based Bank (FSV204) - AWS re:...
Transforming Consumer Banking with a 100% Cloud-Based Bank (FSV204) - AWS re:...Transforming Consumer Banking with a 100% Cloud-Based Bank (FSV204) - AWS re:...
Transforming Consumer Banking with a 100% Cloud-Based Bank (FSV204) - AWS re:...
 
5 Best Credit Card Processors For Merchants in 2024
5 Best Credit Card Processors For Merchants in 20245 Best Credit Card Processors For Merchants in 2024
5 Best Credit Card Processors For Merchants in 2024
 
Adaptive Payments SDK - Magento Developers Paradise
Adaptive Payments SDK - Magento Developers ParadiseAdaptive Payments SDK - Magento Developers Paradise
Adaptive Payments SDK - Magento Developers Paradise
 
Cenpos Mobile Overview - US EMV Certified
Cenpos Mobile Overview - US EMV CertifiedCenpos Mobile Overview - US EMV Certified
Cenpos Mobile Overview - US EMV Certified
 
Payments Innovations and EMV: What does it mean for the US Parking Industry?
Payments Innovations and EMV: What does it mean for the US Parking Industry?Payments Innovations and EMV: What does it mean for the US Parking Industry?
Payments Innovations and EMV: What does it mean for the US Parking Industry?
 
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
 
Disaster Recovery: Don't risk it--automate it
Disaster Recovery: Don't risk it--automate itDisaster Recovery: Don't risk it--automate it
Disaster Recovery: Don't risk it--automate it
 
AtomicPay - Decentralized & Non-Custodial Payment Gateway
AtomicPay - Decentralized & Non-Custodial Payment GatewayAtomicPay - Decentralized & Non-Custodial Payment Gateway
AtomicPay - Decentralized & Non-Custodial Payment Gateway
 
Credit card processing highrisk gateways
Credit card processing   highrisk gatewaysCredit card processing   highrisk gateways
Credit card processing highrisk gateways
 
Leveraging FinTech by fmr Revolut Head of Product & Expansion (US)
Leveraging FinTech by fmr Revolut Head of Product & Expansion (US)Leveraging FinTech by fmr Revolut Head of Product & Expansion (US)
Leveraging FinTech by fmr Revolut Head of Product & Expansion (US)
 

Active_Active Payments Processing