Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 4, 2019

How to ensure double write consistency between the cache and the database?

Interview question How to ensure double write consistency between the cache and the database? Interviewer psychoanalysis You only need to use the cache, it may involve double storage and double storage of the database. As long as you double write, there will be data consistency problems. How do you solve the consistency problem? Analysis of interview questions In general, if you allow the cache to be slightly inconsistent with the database, that is, if your system  is not strictly required to  "cache + database" must be consistent, it is best not to do this, namely:  read request Serialize the write request  and string it into a  memory queue  . Serialization guarantees that there will be no inconsistencies, but it will also result in a significant reduction in system throughput, supporting a request on the line with machines that are several times larger than normal. Cache Aside Pattern The most classic cache + database read and write mode...

Why Cache

Interview question How is the cache used in the project?  Why use a cache?  What are the consequences of improper use of the cache? Interviewer psychoanalysis This problem, Internet companies must ask, if a person is not even clear about the cache, it is rather embarrassing. As long as you ask the cache, the first question is, first of all, ask you where to use the cache?  Why use it?  Don't you have to work?  What are the possible consequences if used later? This is to see if you have any thoughts on the back of the cache. If you are stupid and can't give the interviewer a reasonable answer, then the interviewer will not be very good at you. I think you usually think too little. I know how to work. Analysis of interview questions How is the cache used in the project? This, you need to combine the business of your own project. Why use a cache? With caching, there are two main uses:  high performance  ,  high concurrency  ...

Front-end technical trend observation 2019

Top GitHub projects This is trend of front-end technology that may helpful for you. Experience Technology myliang / x-spreadsheet JS implementation of the class Excel form, it is very convenient to embed your own project nosir / cleave.js Automatic formatting<input />Input, easy to deal with credit card input, mobile phone number input, date input and other scenarios didi / chameleon Didi's cross-end development framework, class VUE syntax, multi-terminal rendering transloadit / uppy Functional Web file Upload components, modular plug-in, for modern front-end system instantpage / instant.page When the mouse hovers over the link, the preload page starts and opens directly in seconds after clicking. klaussinani / qoa Simple and easy-to-use lightweight interactive command prompt, which is a must leon-ai / leon Open source AI dialogue robot, you can write your own modules t...