Java-ee-There is a large load of projects, like the front desk with PHP, backstage with Java

Source: Internet
Author: User
Using Java to do background is mainly to consider
1: Large Data volume
2: More systems to be connected

But do not know how to structure, the current idea is a URL to the way the 2 together, you have any good ideas

Reply content:

Using Java to do background is mainly to consider
1: Large Data volume
2: More systems to be connected

But do not know how to structure, the current idea is a URL to the way the 2 together, you have any good ideas

Front desk PHP Background Java architecture is still relatively popular, I recommend the connection is RPC
Java directly provides Web services, generally with JSON to do the interaction, so that PHP and JS can be directly called, more flexible.
and the LAN Web service performance is also good, generally do not have problems.

P.s. Another point, is to do Web services, PHP can be used in PHP, can not use Java without Java

Java Data Services provides a rest interface for data compression using PROTOBUF.
The high-concurrency data interaction between PHP and Java uses the rest interface to interact, data using PROTOBUF compression, and Redis as a queue, reducing the impact of instantaneous pressure on the server.
PHP provides all external interfaces and page implementations, hiding Java implementations.
Cache system considerations: Multilevel Cache, hot and cold separation, data separation by service, horizontal expansion.
Database considerations: Horizontal/Vertical segmentation, hot and cold separation, considering the cost of database level expansion.
All architectures, in the final analysis, look at your system features and scale, without the right ones, only the right ones.

Web services use PHP to do the basic processing of foreground templates and data logic, there are several ways to call and calculate data:
1.php directly calls the underlying service (DB/MQ), does its own application service layer, Java is responsible for consolidating other services through the Unified RPC service interface for PHP calls, RPC scheme can be used (Facebook Thrift/google protobuffer/ Apache's Avro) the programmatic benefit of RPC is that the message transfer efficiency is higher than the rest HTTP traffic. (PHP is the main application, Java provides external service integration)
2.java do all the data business logic processing Unified interface, PHP through the RPC interface call Java to write the application layer service. (Java is the main application service, PHP provides a flexible display of the foreground) back end if necessary, you can also provide a restful interface directly to call.

Intermediate use of Message Queuing, asynchronous and easy scale-out

Wipe, are big God ah, want to ask a question, we want to use Java back end to save PHP log, is the PROTOBUF protocol, want to ask how PHP and Java communication?
Is that every time PHP sends a log, it calls the Java-provided interface, generating an HTTP request, so?

  • Related Article

    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.