Just want to look for ideas, listen to the views of the great God, do not ask others to help make detailed plans, only to point out the direction of research. I will Php/java, can write a little python against Baidu.
In the local area network, there is a server running PHP website, this server is in a deep intranet (dynamic public network ip+ network management does not give Port forwarding); Another server, in the room xx cloud, there is an independent public network IP, run PHP for docking with. Now want to do a function, can send the information channel XX Cloud host to forward to the server on the LAN. XX Cloud Host is a Linux operating system, you can consider the operation of Php/python/java, LAN host is a common pc,windows operating system, can run Php/python/java, both hosts are equipped with MySQL database (also is the database of the problem selected ). I wonder if gentlemen has any more ingenious ideas.
Now I have a few ideas, but also ask you comment, thank you!
Database 1.-> Cloud Host (PHP)
The LAN uses Python or Java polling to get new data to the local database.
2.-> Cloud Host (PHP), cross-process transfer to Python-written socket server
LAN uses Python or Java and cloud host to establish socket link, real-time communication into the database.
Database 3.-> Cloud Host (PHP).
Local database and remote database to create master-slave database synchronization (the key is remote can only write not check)
Database 4.-> Cloud Host (PHP)
The local writer program connects directly to two databases to do some work.
These are some of the results of my thinking on this issue, and I feel that each method will affect the speed and efficiency of the overall system.
Reply content:
Just want to look for ideas, listen to the views of the great God, do not ask others to help make detailed plans, only to point out the direction of research. I will Php/java, can write a little python against Baidu.
In the local area network, there is a server running PHP website, this server is in a deep intranet (dynamic public network ip+ network management does not give Port forwarding); Another server, in the room xx cloud, there is an independent public network IP, run PHP for docking with. Now want to do a function, can send the information channel XX Cloud host to forward to the server on the LAN. XX Cloud Host is a Linux operating system, you can consider the operation of Php/python/java, LAN host is a common pc,windows operating system, can run Php/python/java, both hosts are equipped with MySQL database (also is the database of the problem selected ). I wonder if gentlemen has any more ingenious ideas.
Now I have a few ideas, but also ask you comment, thank you!
Database 1.-> Cloud Host (PHP)
The LAN uses Python or Java polling to get new data to the local database.
2.-> Cloud Host (PHP), cross-process transfer to Python-written socket server
LAN uses Python or Java and cloud host to establish socket link, real-time communication into the database.
Database 3.-> Cloud Host (PHP).
Local database and remote database to create master-slave database synchronization (the key is remote can only write not check)
Database 4.-> Cloud Host (PHP)
The local writer program connects directly to two databases to do some work.
These are some of the results of my thinking on this issue, and I feel that each method will affect the speed and efficiency of the overall system.
You can use the subscription/publishing feature of Redis to deliver messages instantly
I'm going to give you a second thought. Increase the thickness of
Cloud Host (PHP), a RABBITMQ Message Queuing server, throw messages into the queue--LAN host from a RABBITMQ client, remove messages from server side, throw into the database
The entire message transfer process is asynchronous, which links will not be blocked, properly, no need to rebuild the wheel
There are many scenarios, like your own 1, 2, 3, 4, this time to look at the business scenario:
Is the time tight?
Is the amount of data large?
Is the latency requirement high?
How much concurrency?
are hardware and software inputs limited?
Can't you use a peanut shell?
These 4 schemes are theoretically feasible. But here are some things to remember in the actual scenario:
1, all of your programs are write operations, if you have read operations, some of the scheme is difficult to do, by asynchronous polling words will certainly have inconsistent data
2, keep a long connection to communicate, if there is no data in a short time, the firewall will not put your link off. This is a very tricky and very common big problem, especially the network management is not to do port forwarding this bad premise.
3. For scenario 4, your network delay will not cause zombie or dirty data for user operation.
Celestial Network quality is very poor, try to avoid multiple remote servers to handle a linear operation, and try to avoid long-distance remote connection.
Common LAN Server, all through the port forwarding (if it is dynamic IP, but also with dynamic domain name). Now your PHP server essentially does not handle business, only proxy, then I have two scenarios, 1 is to build nginx on the public network server, through the dynamic Domain name technology reverse proxy to your LAN server 2, the use of service intermediate price, such as Java Dubbo, External network server Remote Call service within LAN