Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transfer php to Java

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

It is believed that many inexperienced people have no idea about how to convert php to Java. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Recently, the work at hand is almost completed, and it is possible that as a data development, the latest data is enough to support the current business, so there is no more work schedule. So suddenly received a task, php to Java. Don't get me wrong, it's not my development language, but the enterprise's development language that needs to be transferred from php to Java.

Revolutionized upgrade-change development language

Some people may have seen this sentence, which is a sentence about Taobao used as a menu when it was transformed from php to Java development language. In 2004, Taobao completed the transition from php to Java, and the operator is the first-class expert of Sun. Sixteen years later, there is a company that is also going to transition from php to Java, and the operator is a newcomer.

Why replace PHP with Java?

First of all, I'm not a PHP developer, and I actually work more on data. ETL, data analysis, real-time calculation, offline calculation and so on. So it's hard for me to say 1 / 2 / 3 to replace php with Java. Maybe some of the problems we have encountered recently are the reasons for our choice of replacement.

No php sdk?

Interface with the products of a cloud manufacturer and provide sdk in python,Java and other related languages, but there is no sdk for php. In the end, making a gateway using Java is a request to interpret php. Performance problem

With the development of business, the number of concurrency is getting higher and higher, so is the concurrency performance pressure of php. At the same time, there is no good support for the problem in the community. Ecological problems

In fact, the ecological problem is the same as the first problem. It is said that the ecological content of php is less than that of Java. Especially in the current micro-service scenario, it is not very friendly for php. Normative problem

PHP development is not like Java with strict coding specifications, each with its own style, and api management is also more chaotic. So it's very troublesome to maintain the code, and php doesn't need to be compiled. It may be an advantage in development, but it may be a disadvantage in enterprise application development. You can't see the error directly at an early stage.

Others. Why choose Java?

At present, there are many languages to implement back-end development. Java, PHP, Python and Go all have a group of supporters. In the current environment, the commonly used languages PHP, Java, Python and Scala are the common languages of the company. Among them, PHP accounts for the highest share of all Web-related functions. Java basically implements some gateway or some special data processing or other projects, Python is mainly used in operation and maintenance, and Scala is a common language used by big data.

Mainly considering the language mastery of the internal members and the activity of the community, we chose Java as the alternative language for PHP.

SpringCloud Alibaba

In fact, there are some needs in the selection. So when doing the selection, because of these simple demand tendency, we directly selected the SpringCloudAlibaba.

Configuration Center & Registry distributed Link tracking RPC

In fact, the requirements are relatively simple, but they are all lessons learned from repeated 'disasters':

"distributed link tracking is the customer's request to the final error overall link query get to the configuration center is that some eldest brother submitted the configuration error to github. Cause. "" RPC is relatively simple, just want to replace the http request in the background with rpc "

There may be many options, Dubbo,SpringCloud. SpringCloudAlibaba . Based on the internal situation, we choose SpringCloudAlibaba.

Following in the footsteps of Ali is a mainstream in the domestic developer circle, and Dubbo has been continuously popular for a long time after open source. But then stopped maintenance for a while. SpringCloud ecology is also relatively powerful. It can be said that SpringCloudAlibaba integrates the ecological advantages of RPC and SpringCloud of Dubbo. At the same time, the related components of SpringCloudAlibaba, Nacos and sleuth, realize the requirements of configuration & registry and distributed link tracking. Seata's distributed transaction middleware will also become the main usage scenario. Sentinel realizes the flow control of distributed system.

Java is used to replace PHP. I may not have any say, just a task executor. After all, I didn't move from the highly concurrent environment of PHP to the micro-service ecology of Java. Therefore, the summary may not be perfect. If you have any other ideas or questions about the selection of the Java framework, you can trust me to talk about the conversion of PHP to Java language.

After reading the above, have you mastered the method of how to transfer php to Java? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report