Wednesday, July 5, 2017

Best Practice

parameterized

Don't check too much

It would be better to separate the concerns of Access Control from the concerns of Task, Action or Command.
I stopped using this pattern a long time ago, for a very simple reason; maintenance cost. Several times I found that I had some function say frobnicate(something, forwards_flag) which was called many times in my code, and needed to locate all the places in the code where the value false was passed as the value of forwards_flag. You can't easily search for those, so this becomes a maintenance headache. And if you need to make a bugfix at each of those sites, you may have an unfortunate problem if you miss one.

System Design

1. How to design Shazam phone app

2. How to speed a bank transaction order processing system. All orders need to be processed sequentially.
    a. Use lazy Load for DB
    b. Java Profiler to analyze
    c. Try to parallel orders which can be paralleled
    d. prepare/load order to different machine to cut waiting time

SQL/DB/Nosql question

1. What is NoSQL
    A DB which has key-value paired and document based.
    Doesn't use string based queries to fetch data
    Cassandra is a distributed NoSQL DB

2. Difference between NoSQL and RDMBS
    NoSQL is unstructured, high availability, cannot be queried by  SQL, K-V parir, document base
    RDMBS is structured, low availability, can use SQL QUERY,  Data/Relational stored in dif tables