Literacy: 10 third-party services commonly used in Java back-end development

Strictly speaking, all third-party services of software can be developed by yourself, but it takes time and money to go from zero to one. Just like we have invested huge costs in developing chips, but we still haven't achieved the desired results. Some things can't be done overnight.

Please unscrupulously like it, search for [ Silent King Two ] on WeChat and follow this programmer who lived in Luoyang, the ancient capital of the Nine Dynasties.

This article has been included on GitHub github.com/itwanger , and there are also interview questions I prepared carefully for you.

Java back-end development usually involves many third-party services, so what mature solutions are available for direct use?

1)IaaS

The full English name of IaaS is Infrastructure as a Service, that is, infrastructure service, which refers to a service model that provides IT infrastructure as a service to the outside world through the network and charges based on the actual usage or occupancy of resources by users. IaaS can quickly scale up and down according to demand, and users do not need to purchase and manage their own physical servers and other data center infrastructure, thereby avoiding corresponding expenses and complicated operations.

Typical things that users can accomplish through IaaS include:

  • Testing and development.
  • Website hosting.
  • Storage, backup and recovery.
  • Web application.
  • High-performance computing.
  • Big data analysis.

Basically all cloud service providers provide IaaS services, and the most powerful cloud service provider in China is Alibaba Cloud.

2) PaaS

The full English name of PaaS is Platform as a Service. You only need to submit the code to the specified operating environment. Code packaging, deployment, and IP binding are all done by the platform.

Compared with IaaS, users do not need to manage and control cloud infrastructure (including networks, servers, operating systems, or storage), but need to control the upper-level application deployment and application hosting environment.

3)SaaS

The full English name of SaaS is Software as a Service. In this mode, users can use the software through the network without going through traditional installation steps. The biggest feature of SaaS is that the software itself is not downloaded to the user's hard drive, but stored in the provider's cloud or server.

How to distinguish IaaS, PaaS and SaaS? Take a look at the picture below.

If we develop a website, in the traditional way, we need to buy a professional server (connect to the network), install server software on it, and then deploy the prepared website.

If you use IaaS services, you don't need to buy the server yourself, just install the server software and deploy the website on the rented cloud server.

If the PaaS service is adopted, there is no need to purchase a server or install server software, just deploy the website.

If the SaaS service is adopted, the website does not need to be developed by itself, and the website developed by the service provider is used directly, and the later upgrade and maintenance are left to the service provider.

Ruan Yifeng’s blog explains the relationship between the three in this way. If you want to start a pizza business, there are three options.

Option one, IaaS.

Others provide the kitchen, stove, and gas. You use these infrastructures to bake your pizza.

Option two, PaaS.

In addition to the infrastructure, others also provide pizza crusts. You just need to sprinkle your own ingredients on the crust. As for the beef or Orleans chicken wings, you decide.

Option three, SaaS.

The pizza is made directly by others, and you get the finished product. All you have to do is sell the pizza, it is best to print your own logo.

4) Domain name

Once you have an application that can provide services, you also need a domain name that can be remembered. The simpler the better. Take Wikipedia as an example. Wikipedia.org is a domain name, which corresponds to the IP address 208.80.152.2. Users can directly visit wikipedia.org instead of the IP address. The Domain Name System (DNS) will convert the domain name into an IP address that is easy for machine identification. .

There was a period of time when domain names were highly speculated, just like real estate speculation. One of my college classmates bought a lot of domain names, but in the end they never sold them.

Xiaomi co-founder Li Wanqiang previously confirmed the transaction price of the Xiaomi domain name (mi.com) on Weibo, which was 3.6 million US dollars, or about 22.43 million yuan. Lei Jun called out "Thieves are expensive"!

I bought the domain name through Tencent Cloud.

http://www.itwanger.com/

it is information technology, and wanger is the pinyin of "Wang Er" in "Silent King Er". But to be honest, I regret buying .com. The annual fee is a bit expensive. I should change to a less popular domain name, such as .top, which is too poor for me.

5)CDN

The full name of CDN is Content Delivery Network, which is a computer network system connected to each other through the Internet. It uses the server closest to each user to quickly and more reliably transfer music, pictures, videos, applications, and Other files are sent to users to provide high performance, scalability and low-cost network content to users.

The more famous CDN service providers include:

  • Cloudflare, the free version of the solution is sufficient to protect small websites from DDoS, and it can also hide the real IP address of the website. It has an excellent response speed overseas, but it seems that it is not good at home.

  • Tencent Cloud has resource reserves in 50+ countries and regions around the world, and the entire network bandwidth is 120Tbps+. 1100+ acceleration nodes in China, covering China Mobile, China Unicom, Telecom and more than a dozen small and medium-sized operators.

  • Alibaba Cloud, 2800+ nodes worldwide, 130T bandwidth capability, coverage on six continents, supported by mainstream domestic operators.

  • Qiniu Cloud has 2000 nodes worldwide, 20+ operators coverage, and access speed is increased by 80%. Application scenarios include audio and video on-demand, large file download, and Web acceleration services.

  • Take the cloud again, with 1100+ nodes worldwide, 10Tbps bandwidth reserve, supported by mainstream domestic operators.

I personally like to use BootCDN to speed up CSS and JavaScript when I am making a website. I remembered that Paiyun and Bootstrap Chinese.com cooperated in the introduction, but now it is Maoyun-I don't know what happened.

6) Mail sending

Basically every application is inseparable from mail sending. The most commonly used mail servers are Tencent Mail and NetEase Mail. Commonly used e-mail protocols include SMTP, POP3 and IMAP. However, the creation and sending of e-mails only requires the SMTP protocol.

Java officially provides a Java class library that encapsulates the email protocol, which is JavaMail, but it is not included in the standard JDK. The GitHub address is as follows:

https://javaee.github.io/javamail/

I remember that I have received such a request before that the emails requested cannot be sent to the spam mailbox, which is quite difficult. Because mail servers, such as Tencent and NetEase, have made mail filters, they will identify some mails and automatically put them in the spam mailbox.

7) SMS sending

Using SMS to send verification codes is almost an indispensable part of every application, as if the phone number represents a person, so losing the phone is a very dangerous thing-you need to report the loss immediately.

SMS needs the support of the operator, so basically you need to rely on a third-party agent. There are many SMS gateway proxies on the market, and Alibaba Cloud Communication is one of the more commonly used ones. It used to be called Alibaba.

The price of Alibaba Cloud Communication is 0.036 yuan per text message. There are some other service providers on the market, some of which are cheaper, but I have not personally evaluated the stability. Many merchants who do SMS are hidden in my technical exchange group.

Application access to Alibaba Cloud Communication is not complicated. I have shared a blog on CSDN before. It is very detailed, with pictures and texts, and with source code examples. Small partners who need it can go and watch.

https://qingmiaogu.blog.csdn.net/article/details/78751698

8) News push

Push refers to the active push of messages to users' mobile devices by operators through their own products or third-party tools. Users can see push notifications on the lock screen and notification bar of their mobile devices. Tap on the notification bar to wake up the APP and go to the corresponding page.

In mobile applications, push has become a standard feature.

iOS establishes a connection with the Apple APNs (Apple Push Notification service) server at the system level. The application registers the following messages with the iOS system through the observer mode, and the system receives the APNs Server message and forwards it to the corresponding application.

Android's C2DM (Android Cloud to Device Messaging) adopts a mechanism similar to that of iOS, which supports message push at the system level. However, because Google's services cannot be accessed stably in China, this solution is basically unavailable for domestic users of.

In view of the unavailability of C2DM push on the Android platform, a large number of third-party push service providers have emerged in China. Currently, the most widely used third-party push service providers include Getuo, Jiguang, Youmeng, Xiaomi, Huawei, BAT, etc. I used a push to make a push demo of a small program, the API call is very simple, and it feels quite easy to use.

Message push is sometimes very annoying, especially some apps, which keep pushing, so the message push permission on my mobile phone is basically turned off-the world has been quiet since then.

9) Open platform

Through the open platform, protocols such as OAuth can be used to obtain user information on third-party platforms to enable third-party platform login. For example, the user wants to log in to the A website, and the A website asks the user to provide data from a third-party website to prove his identity. To obtain the identity data of a third-party website, OAuth authorization is required.

Domestic Weibo, WeChat, and QQ are the most common third-party login methods. Ali products can be authorized to log in through Alipay, and some websites are bound to GitHub login.

There is a GitHub OAuth third-party login example tutorial on Ruan Yifeng’s blog:

https://www.ruanyifeng.com/blog/2019/04/github-oauth.html

10) Payment interface

At present, the payment interfaces with the most access are Alipay and WeChat.

Alipay provides payment interfaces such as face-to-face payment, APP payment, mobile website payment, and computer website payment.

The documentation provided is complete, and there are also Demos in Java, PHP, .NET and other versions.

https://opendocs.alipay.com/open/270

For WeChat payment, I recommend using the open source tool library WxJava:

https://github.com/Wechat-Group/WxJava

Our company’s website uses this, which supports back-end development including WeChat payment, open platforms, small programs, enterprise WeChat/enterprise accounts, and official accounts. It is very complete.

Above, I hope to be helpful to the friends, see you in the next issue.

The second elder brother stayed for two days and two nights. The first edition of "Soft Power Indispensable for Programmers" hits strongly. It is purely hand-knocked and contains 200,000 words of essence. It runs through my more than ten years of programming career and involves life. As with all aspects of work, if you are a confused college student, or a newcomer who just entered the job, I believe my personal experience can bring you some thinking and establish a correct outlook on life and values.

How can I get this PDF?

Baidu Cloud Link: https://pan.baidu.com/s/1o6MY84my0OD0DHnAmZT6rA Password: tx5e

Finally, I sincerely hope that this PDF can be of substantial help to you, and I will continue to improve this e-book in the future, so stay tuned.

Of course, I also ask for a like every day!

Guess you like

Origin blog.csdn.net/qing_gee/article/details/108533541