Note: All requests are established using mTLS, using the ATMs short lived certificate, which is bound to its hardware key and generated quite frequently. Idempotency keys are used to ensure we don't accidentally execute the same API twice, which is critical in banking applications
We require highly transactional consistent database to support user purchases, etc... However, we may not need as strong consistency for storing user preferences, and storing user activities not related to deposit/purchase transactions. Therefore we will have a hybrid set up where we use SQL for storing (1) user credentials and (2) user transactions and (3) user profile. We will use noSQL for storing user preferences (language, etc...), activity for potential AI/ML use cases, etc... We will use Cassandra for noSQL store, ensuring fast writes.
We will have three SQL tables, each served by separate SQL instances, and each sharded using consistent hashing on the userUID. We scale each instance separately since, for example the auth SQL table will be much smaller and has different scaling considerations:
For caching, we will use a distributed Redis store and primarily used for storing user preferences so that users entering an ATM system will have their preferences loaded (language, preferred accounts, etc...). We will also use the same store for storing session data.
The transaction services are some of the most important backend services, which will be stateless and scale horizontally.