博文

目前显示的是 三月, 2022的博文

Ch1 - Scale from zero to millions of users

DB Non-relational DB might be right if: Your application requires super-low latency Your data are unstrctured, or you do not have any relationship data. You only need to serialize and desrialize data(JSON, XML, YAML, etc.) You need to store a massive amount of data. Scaling Vertical Scaling: Add power to your server(RAM, CPU, etc.) Horizontal Scaling: Add number of servers in pool. Vertical Scaling better fit low traffic case . Advantages:  Simplicity. Disadvantages:  Vertical has limit, no unlimited CPU power... Vertical does not have failover and redundancy. Horizontal scaling better for large scale app . If rootcuase is traffic increasing cause custoemr experience slower use load balancer better. Load balancer For better security, private IPs are used for communication between servers. A private IP is an IP address reachable only between servers in same network. With load balancer and second server we now can cover failover case. DB replication A manager DB generally only s...

Difference between Http and Https

1. What is? SSL stands for Secure Socket Layer. It is the predecessor of TLS. TLS the short form of Transport Layer Security, which is a cryptographic protocol that provides secure communication over a computer network. 2. Why? Authentication TLS verifies the identity of the communicating parties, which normally be clients and servers. Confidentiality TLS protects the exchanged data from unauthorized access by encrypting it with symmetric encryption algorithms. Integrity TLS recognizes any alteration of data during transmission by checking the message authentication code, which we will learn about in a moment. 3. How TLS work? (2 phases or say 2 protocols) Handshake protocol Negotiate the protocol version Select cryptographic algorithm (or cipher suites) Authenticate each other by asymmetric cryptography Establish a shared secret key that will be used for symmetric encryption in the next phase. Record protocol All outgoing messages will be encrypted with the shared secret key establis...