Architect's path-how to talk about technology days, current-limiting technology and various programming languages

Source: Internet
Author: User

The programming languages on the market now dominate the object-oriented. Object-oriented should start from some of the most basic. For example, I was 24 years old married, or how to object-oriented programming. And then just married to have a baby, or the object ran to do? New one? Creating destruction overhead is great, or it is good to have a reference to the object that the baby continues to hold.

Why do some people talk for a long time, some people speak desultorily? As far as I can see, the two people who do the work will say that they will develop better in the future. The reason is to feel it from concrete examples.

Chatting with friends, really, a few years ago everyone net out of the total a bit of technical geek spirit, chatting we talk about technology. I was asked how your video was stored and how it was played. I said I was doing the content, Meta, and the rest had nothing to do with me. The days of talking to death, their own pattern down. If I do have a platform for the development of things, there are uploaded video. First call the cloud storage interface for an initialization, they return to us a video media upload URL. The JS side uploads the media shard to the URL. If the network is interrupted or the browser shuts down, you can call the continuation interface to continue the transmission with the newly returned URL. Continuation of the interface with the total file size and the size of the file that has been received, JS can be based on this judgment from which shards continue to pass. Cloud storage in another department, they are responsible for communication with the cloud Transcoding department, the cloud transcoding media into various formats, as for the conversion from the original high-definition files to various bitrate, how to sample, by the Cloud Transcoding department responsible. What policies are internally distributed to each DNS node. Dispatch department is how to save the video site of the most valuable bandwidth, specific details I am not very clear. The Cloud Transcoding department passes the converted various bitrate and video URLs to us in MQ form, and we store them in the database.

Then the family asked again, MQ what do you use? I said Apache's Qpidd. Amount ~ ~, people do not know, chat on the dead. So it has to be said that MQ is similar, and Rabbit MQ is based on the AMQP advanced Message Queuing protocol. This is the company's unified cluster, said the installation is very convenient deployment. Mainstream programming languages are supported, so it's used. Because mainly cross-departmental communication, mainly to facilitate, save communication cost-based, so our message body is the JSON first compressed and then base64. Also useless protobuf those binary, because in case of problems, binary readability is poor, lack of self-description, not easy to troubleshoot.

High concurrency services must have some urgent scenarios, such as service fuse, downgrade, quarantine, current limit, asynchronous RPC, and so on. Service fuse, downgrade, isolate we tend to use Netflix's open source distributed services elastic Framework Hystrix. Hystrix can also limit the flow. But we serve the guava of the Ratelimiter this mature token bucket algorithm to achieve.

The service flow limit is a simple matter. Our code is hundreds of lines, but there is a relatively complete set of design ideas, the purpose is based on a certain strategy (such as: URL, platform source, url+ platform source) to do a business fine-grained flow limit.

  

All requests have to go. This interceptor, which defines a singleton current limit holder, is returned to the interceptor request for the corresponding key and Ratelimiter, based on the configured policy and the map configured for each or each requested limit. The interceptor in the judgment overrun is directly returned to the error is not given to the controller processing. A request type, such as a URL for a ratelimiter fine-grained current limit.

Of course, in addition to this application-level current limit, at Nginx level can also do some of the IP session space, request frequency, concurrency limit. If a network attack is encountered, try to solve the problem from the operation and maintenance level, because the impact on the service will be minimized.

A good software architecture to meet the quality of the system, so that the beneficiaries reach a consistent goal, can support the planning process, the guidance of system development, can effectively manage the complexity, for reuse laid the foundation, can reduce maintenance costs, can support conflict analysis.

Most architectures or programming languages are generated from projects. For example, Stroustrup, the inventor of C + +, designed the language to see that C was a critical programming problem due to unreasonable initialization parameters, a bug that was difficult to find. This problem also occurs when cleaning up. Did insist, and indeed succeeded. However, any thing has a stage of formation and development. Java has been in the old version has been the problem of the performance of the slot, and every version of it will be accompanied by performance improvements, so upgrade the JVM can bring free performance benefits. The details think of the final keyword, in earlier versions, the final keyword part would be called inline, and the function would be expanded directly without the need for constant arguments to stack out the stack, causing a performance overhead. But this will have a large overhead when the function body is large. The JVM was optimized at 1.5, and the final keyword performance was no longer that big. Originally the company has a colleague, the person is very good, also very has the idea. He said: "I always put some of my ideas in a book, and then after a period of time to see that I have only insisted on one of the ideas, to do, have succeeded." "I think he is far more successful than he imagined. Because he had only ideas, and did not do. As if only JDK1.0 idea, but the distance from the success of the jdk1.5 at least away from.

Python is known for its small code volume, low maintenance costs, and high programming efficiency. But how many programming languages are not based on low maintenance costs and high programming efficiency as a point of optimization? So people ask me that search engine has been a fire, you can really build their own advantages in the future? I can only say not how to know. "Life is short, I use Python." These characteristics of Python can free up more time to the sister, not life is too short. Python author's advertising words give python vitality. In fact, the simplicity of Python from its memory recycling is visible, it uses the reference counting method, there is no circular reference problem. I did a python project for everyone. There was a time when we led me to say that I had done 8 jobs alone. In addition to all the maintenance work of the whole website, I answer all kinds of new jobs. Is this character, others really can not find me, I only embarrassed myself, not embarrassed others. At that time, less than four years of work, programming less than two years, I said the first two years of work when the Japanese translation. The reason to go to everyone. Say one day I just came to Beijing, and seniors are visiting the Summer Palace, suddenly received Renren interview phone, the phone that the head asked me various technical issues, my answer is not. The result was very nice to say it doesn't matter. The last call to change an interviewer, in Japanese to speak to me, asked what I did, she was very satisfied with my answer, satisfaction is mainly found my Japanese very good. As a result, I became a bridge engineer for Renren. Remember that I wrote in the article in the personal profile of their own language talent by the Netizen Spit groove, but I in the east soft when everyone said I have a language talent, I myself also used to think so, I just take it for granted that I am stating a thing, and no advertised meaning. I'm not python, and I don't even know what an open platform is. But I took over the maintenance of the entire open platform, because the boss of the open platform to go to the U.S. regiment. Say the boss is really a cow, Tsinghua, Chong Industry, to everyone, and to the United States to do the P4, and now his own business. One day my male God took a picture of a Tsinghua Alumni association and asked me, "this person seems to be your former colleague." I said, "well." He said: "He is sitting next to our boss." Well, it seems that the space for my male God to progress is not generally large.

I have to bite the bullet to maintain this open platform. Then bubble fish game to access a Japanese platform. This game is written in Python. At that time, this game is very hot, the game company super busy, do not have a moment to access, give money to find our help. We can only bring the code over to the access. At that time Renren like to engage in internal entrepreneurship, we are overseas business Department, it is not profitable. I did that access, the game side gave us 100,000 access fees, the rest is the game into, income I do not know how many. But it was the only project we had to make money at that time. Python is really very studious, I maintain the site during the day, all the people come to me, at night to do the access, research Python and access documents, 1 weeks to pay access to the part of the finished. The test environment can be filled with money. But there is a problem on-line, the official environment of the operation of the MM to run when there is a piece of the wrong. Everyone went home at night, and I was there to get an online environment. Then finally found that the installation of a part of a tool version of the wrong, specifically how not remember. It was 6 years ago. So I've done python, but not python.

Between Java and C + + there is a wall of dynamic memory allocation and garbage collection technology, the people outside the wall want to enter, but the people inside the walls want to come out. Java can not be so arbitrary, that is, to optimize the memory allocation parameters, the JVM parameter optimization, in fact, the most commonly used to think that everyone knows that the initial maximum and minimum value of the heap is set to the same value, so as to avoid the heap automatic expansion, adjust the new generation and old wear the size of the full Throughput degradation and latency caused by GC. In other words, almost all GC operations of the JVM, including the minor GC, have to stop the world.

Finally, we recommend a foreign site http://blog.takipi.com/. Some practical tools and tuning techniques are often introduced, focusing on analysis. Representative works of http://blog.takipi.com/7-new-tools-java-developers-should-know/and http://blog.takipi.com/ how-to-instantly-improve-your-java-logging-with-7-logback-tweaks/

Architect's path-how to talk about technology days, current-limiting technology and various programming languages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.