systemdesign2

database System

  • database: data structure + operation (key, value)
  • key: file+ point search, range search->serialization-> quick search

design data with class and inheritance

design user system

question money,expiretime

  • question1: user number: IP, session
  • How to study
    • look at the question
    • answer it by yourself(with google)
    • check points with summary
    • add points as you go deeper with each query
  • how to study reference
    • read all, conception, difficult part, and how to solve

design payment system

  • S: send, receive money
  • N: Ave data user: 1,000,000; qps: 1% 1.1times 5future = 50000/86400 =1 QPS
  • A: account service, balance service, success and fail and waiting(state machine),
  • K: user table{userid ,username}, payment table {bankid, limit money, routing number, userid}, order table{orderid, bankid, userid, amount, state, time, type}
  • if succeed, process:
    • log system service,lock, load userdata, update transaction, submit, notification