Redis can be used in various scenarios, as shown in the diagram.
/2 ๐นSession
We can use Redis to share user session data among different services.
๐นCache
We can use Redis to cache objects or pages, especially for hotspot data.
๐นDistributed lock
We can use a Redis string to acquire locks among distributed services.
/3 ๐นCounter
We can count how many likes or how many reads for articles
๐นRate limiter
We can apply a rate limit for specific user IPs
๐นGlobal ID generator
We can use Redis Int for global ID
๐นShopping cart
We can use Redis Hash to represent key-value pairs in a shopping cart
/4 ๐นCalculate user retention
We can use Bitmap to represent the user login daily and calculate user retention.
๐นMessage queue
We can use List for a message queue.
๐นRanking
We can use ZSet to sort the articles.
/5 ๐ Over to you: Have you used Redis for other use cases? What are they?
/6 ๐๐ฎ๐๐ฌ๐๐ซ๐ข๐๐ ๐ญ๐จ ๐จ๐ฎ๐ซ ๐ฐ๐๐๐ค๐ฅ๐ฒ ๐ง๐๐ฐ๐ฌ๐ฅ๐๐ญ๐ญ๐๐ซ to learn something new every week:
/2 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.
/3 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.
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?
/2 Both the web browser and the HTTP server could be responsible for this task.
/3 ๐นWeb browsers do the heavy lifting: short polling or long polling. With short polling, the browser will retry until it gets the latest data. With long polling, the HTTP server doesnโt return results until new data has arrived.
/1 Why is a credit card called a โ๐๐ซ๐๐๐ข๐ญโ card?
Why is a debit card called a โ๐๐๐๐ข๐ญโ card?
An example of a debit card payment is shown in the diagram below. ๐
/2
๐ธ Each transaction in the business system is transformed into at least two journal lines in the ledger system. This is called ๐๐จ๐ฎ๐๐ฅ๐-๐๐ง๐ญ๐ซ๐ฒ accounting, where every transaction must have a ๐ฌ๐จ๐ฎ๐ซ๐๐ account and a ๐ญ๐๐ซ๐ ๐๐ญ account.
/3
๐ธ Each journal line is booked to an account.
๐ธ Each account belongs to one of the three components in the balance sheet:
๐กAsset = Liability + Equity
Letโs look at the issuing bankโs ledger as an example:
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.
/2 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.
/3 ๐น 2. Application architecture
The architecture has gone from monolithic to microservices. Each service is designed to be small, adaptive to the limited resources in cloud containers.
๐น Define API - This establishes a contract between frontend and backend. We can use Postman or OpenAPI for this.
/3 ๐น Development - Node.js or react is popular for frontend development, and java/python/go for backend development. Also, we need to change the configurations in the API gateway according to API definitions.