Introduction: The second Cloud Native Programming Challenge provides a stage for young people who love technology to challenge world-class technical problems, hoping to create greater value for the whole society with technology.

The author | liu xin

Well, I’m probably part of what others would call the don’t struggle generation.

I’ve experienced everything you want to hear about a colorful life.

My family runs a chain of supermarkets, mainly in a few second-tier cities.

When I was in elementary school, chain stores began installing computers, purchasing and installing complete cash registers.

My dad said we should learn from the big supermarket chains to improve production efficiency.

At that time, I was very interested in those gray interface cashier software, but my parents wouldn’t let me touch it.

Later, they bought me a computer. At that time, there were not many people with computers in the town, and my relatives’ children often came here to play with computers.

Because of the early contact with computers, I chose to major in computer science in college.

A few weeks after I started college, my dad asked me,

At that time, I did not even have a concept of database, and I was still learning inverse complement. I told him: Yes, but not now, wait me a year or two.

My dad says it doesn’t matter. According to his thinking, we do not need to be able to write completely, as long as we know how to write, we can leave the specific implementation to the software company.

But it’s important to understand how software is built, because it helps us buy software from the perspective of our suppliers, and helps us narrow our information gap.

That’s essentially what business is all about.

In 2005, when I was a junior, the school held a software development competition. There were three propositions, which basically covered all scenarios and students could play freely. So I thought of the supermarket checkout software.

At that time, Taobao was just popular, SO I thought why not learn to completely reform my father’s business model from offline to online!

The whole online mall, browsing goods, shopping cart, order, delivery, but we mainly sell their own source.

At that time, the technology used was MySQL+ Java + JSP, and then bought a server to make the service run.

When I demonstrated the system at school, I got the highest grade.

Filled with joy, I tried to use the system in real business, starting with my own head store.

Unexpectedly, my father poured cold water on me. He said that our users here did not have the habit of shopping online, and the delivery problem could not be solved.

I refuse to accept, must try, as expected there is a huge difference between ideal and reality, I fell a big somersault.

Although I had a lot of campaigns and flyers about the mall, very few people actually shopped online.

For those willing to try something new, I bought something online, and I delivered it myself.

When I returned home after graduation, I wanted to study abroad, but my father dragged me back. I first studied with Lao Zhang, the head of the Information Department, and then gradually took over.

At that time, every supermarket in my family was very large, with ten or twenty POS machines, and each supermarket had a server and a database.

POS machine is directly connected to the server of the supermarket, typical client/server structure.

At that time, I guess everyone is like this!

To tell the truth, such software architecture seems to be quite stable, as long as the machine does not have problems, stable power supply, the whole cashier system will not be a problem. But it actually faces many disadvantages:

1. Machines do break down, and there are real cases of them breaking down

2. Every time there is commodity data to be updated, the management personnel of each store should be informed to update. It is very normal to make mistakes

4. It is difficult to unify the data of each store, so the monthly statistical data need to be consolidated, so the current data of each store cannot be known anytime and anywhere. And so on…

Each store operates a separate system, and the list goes on and on

I suggest Lao Zhang to set up a central computer room to centralize the software and connect each store to a unified computer room server, thus solving the above problems:

Later system transformation, after bidding, bidding, we chose a local quite powerful company to do.

I gave full play to the advantages of my computer major and helped Lao Zhang find out many problems.

Looks like my dad was right. Narrowing the gap is important.

Central computer room operation for a few years, the effect is good, but their own computer room management is very troublesome.

You need to plan carefully, you need to buy servers, you need to install software, you need to be in charge of operations, and we’ve built a team to deal with that.

What’s more, hacking attacks are everywhere

There is also downtime, network interruption, an accident is a big deal, affecting all supermarkets, I do not know how many times in the middle of the night was woken up.

This is not a big deal. One year, in order to cooperate with the supermarket during the Double 11 promotion, I asked my father to buy a lot of servers. After the double 11, all of them were idle, which made my father very angry.

So when Aliyun appeared, my eyes lit up, and it was set up to save me.

Right now, right now, all over the place.

The operating system will automatically install it for you. Network naturally need not worry about, want how much bandwidth directly buy line.

Safety issues do not need to worry about, if there is a problem, I can justifiably to my father said: you see, this is not my problem, is ali cloud problem, ha ha.

And the machine can be easily expanded, CPU core from 4 to 8, memory from 16G to 64G……

From now on, the server in our machine room will be laid off.

In a twinkling of an eye, more than ten years have passed, along with the development of supermarket IT system, I have grown from a teenager using JSP to write online mall to the technology leader of the company.

Technology is constantly changing, the rise of small programs, we also follow the small program, with preferential information to attract customers scan code attention, registration, slowly accumulated millions of fans.

Every month, we send coupons to our members through the mini program so that they can spend in offline stores.

It’s hard to accurately estimate the volume of requests for coupons, which makes it hard to predict how many virtual machines are needed to handle it.

I quickly mobilized all my contacts to solve this problem, and by chance, I discovered a new technique: function computation, namely Serverless.

The platform will create corresponding function instances according to the number of requests to execute, without manual intervention, instantly elastic expansion, coping with traffic outbreak.

Who has the strongest Serverless technology in China?

According to a report released by Authoritative consulting firm Forrester, Alibaba Cloud Function Computing stands out in terms of product capabilities, security, strategic vision and market size, ranking first in the world in terms of product capabilities. This is the first time that a Chinese cloud vendor has entered the FaaS leadership quadrant.

Just as we used ali cloud virtual machine before, is it!

In addition to function calculation, since the business needs to query the member database, we hope it can also be seamless and elastic expansion, so we use aliyun’s table storage.

On the Serverless system, no longer need to consider the server, virtual machine with how much CPU, how much memory, elastic!

Function deployment is also extremely simple, with no need to worry about the low-level details, just a click to update the function.

The double tenth spent a very smooth, cost estimation afterwards: before when buy cloud server will may be met in accordance with the highest amount of concurrent performance assessment, because of the volume pricing Serverless, how much how much, the final evaluation, under the condition of 120% increase in volume, cost saving of 45% than normal! R&d delivery efficiency also increased by more than 30%!

From then on, my father looked at me with new eyes, look at me a lot of gentle eyes.

Of course, I care about the business beyond the technology, and it fits in with all the modern, trendy gameplay. Not long ago for the company to build a live broadcast, on the platform to promote their own goods.

Later thought, oneself play boring, I tried to contact the supermarket near the businesses of all walks of life, invited them to join my live broadcast, sell goods together. I didn’t get a lot of offers, but the owner of a bathing center was interested. Have to say, the boss of that bath center is extremely strong with front chat ability, and I be a match.

In the first live broadcast, our supermarket chain and the branches of the bath center held a joint discount activity, but that night the live broadcast turned from sales promotion to cross talk.

We hold the live broadcast once a week, more and more netizens came to hear the voice, the number of orders is also more and more. The night of the broadcast was worth as much as the previous week. In the process of live broadcast, there are always enthusiastic netizens who take the initiative to connect with the mic. Technically speaking, it is necessary to connect the screen of multiple netizens and combine the screen of the anchor into a new screen, which is called “mixed stream”.

Since the audience of Lianmai is not fixed, I have to consider a certain degree of concurrency and flexibility. Our cross talk live broadcast is only once a week, so it is impossible to reserve a large number of servers to deal with the business peak.

Having tasted the benefits of Serverless before, THIS time I immediately asked the R&D department to adopt Ali Cloud function computing to deal with the demands of mixed flow.

When the amount of concurrency increases, the function computations automatically expand multiple execution environments to handle real-time data flow, and automatically reduces resources when the business peak passes, which is very cool.

Of course, Serverless’s application is not only these, but also our “cross talk” video needs transcoding and optimization of push stream. I also used Ali’s function calculation, saving more than 60% of computing resources.

In the past two years, I have deeply experienced the benefits of Serverless: don’t worry about the server at all, just focus on implementing your own business logic!

Over the years, technology has been changing all the time. This year, I was honored to be invited by the School of Computer science of my Alma mater to give a talk. I shared with you the technological process of these years

During my talk, I brought up the programming contest I attended in college, which was the beginning of my programming career.

Incidentally, I know aliyun has held a cloud native programming contest, and I also want to share this contest with my friends: The contest, which began in 2015 as the Middleware Performance Challenge for seven years, was upgraded to the Cloud Native Programming Challenge last year, attracting more than 23,000 teams in more than 10 countries and regions.

The competition provides a stage for young people who love technology to challenge world-class technological problems, hoping to create greater value for the whole society with technology.

The original link

This article is the original content of Aliyun and shall not be reproduced without permission.