Javascript-No Background Development Process

Source: Internet
Author: User
I have read some ideas about meteor. I want to use php to implement meteor. The following are some guesses about meteor, for example, 100 people accessing a page. If someone modifies the page, then the 100 people will not see the latest data unless they refresh the page, and meteor can... I have read some ideas about meteor,
I want to use php to implement the meteor function. Below are some of my guesses about meteor.

For example, if 100 people access a page and some people modify the page, the 100 people will not see the latest data unless they refresh the page.
Meteor can.
I hope to have a technology that allows users to directly operate databases while editing the interface, instead of having to write an interface for each operation in the background,
I think it should be like this.
There are three things
Browser client, redis, mysql
For example, the data is in the form of user information, name, age, sex
This information was originally stored in mysql.
Now it is stored in redis as a json string.
When the browser accesses the page, it displays the redis content data to the browser and establishes a websocket link,

When the browser edits the data, it directly updates the edited new data to redis in json format,
At this time, the server sends a message to all browser clients (because the websocket link has been established), saying that the data has been updated,
At this time, all the browsers will update it by themselves.
At the same time, the server synchronously updates the information to mysql for permanent storage.

Technical conditions:
1. angular can be used for binding dom nodes and data on the browser. The interface is automatically updated only when angular data is updated.
2. javascript directly operates on the background (Hrpose and javascript can be used to call php functions)
3. Establish websocket (swoole already has this function)

I don't know whether meteor is the pattern I have imagined,
I'm curious to know

  1. As the middle layer, how does redis design the data storage form to facilitate data updates on the front and back ends?
  2. When the data is updated, how can the php program be designed to adapt to the synchronized update to the corresponding table and record (because I want a set of programs to synchronize the content of all the tables, instead of writing each table separately)
  3. Can this light background development method improve the current development progress?

Reply content:

I have read some ideas about meteor,
I want to use php to implement the meteor function. Below are some of my guesses about meteor.

For example, if 100 people access a page and some people modify the page, the 100 people will not see the latest data unless they refresh the page.
Meteor can.
I hope to have a technology that allows users to directly operate databases while editing the interface, instead of having to write an interface for each operation in the background,
I think it should be like this.
There are three things
Browser client, redis, mysql
For example, the data is in the form of user information, name, age, sex
This information was originally stored in mysql.
Now it is stored in redis as a json string.
When the browser accesses the page, it displays the redis content data to the browser and establishes a websocket link,

When the browser edits the data, it directly updates the edited new data to redis in json format,
At this time, the server sends a message to all browser clients (because the websocket link has been established), saying that the data has been updated,
At this time, all the browsers will update it by themselves.
At the same time, the server synchronously updates the information to mysql for permanent storage.

Technical conditions:
1. angular can be used for binding dom nodes and data on the browser. The interface is automatically updated only when angular data is updated.
2. javascript directly operates on the background (Hrpose and javascript can be used to call php functions)
3. Establish websocket (swoole already has this function)

I don't know whether meteor is the pattern I have imagined,
I'm curious to know

  1. As the middle layer, how does redis design the data storage form to facilitate data updates on the front and back ends?
  2. When the data is updated, how can the php program be designed to adapt to the synchronized update to the corresponding table and record (because I want a set of programs to synchronize the content of all the tables, instead of writing each table separately)
  3. Can this light background development method improve the current development progress?

How does meteor synchronize data between the front and back ends?
Meteor uses a Protocol named Distributed Data Protocol (DDP) to process real-time communication. It uses a new WebSockets browser and Asynchronous JavaScript + XML (Ajax) long polling old browsers support this protocol.

You can directly operate the database while editing the interface, instead of writing an interface for each operation in the background.
This requirement is very strange, and the front-end cannot directly operate the database. If you do not want to write an interface for each operation in the background, Use ORM.

Javascript directly operates on the background (Hrpose and javascript can be used to call php functions)
Isn't this the operation background? Can the subject summarize the language.

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.