I haven't updated this series of articles for a long time, because of various trivial matters recently. I have not studied for a long time, and it seems that there is only one thing I have learned. I went to the newspaper. Haha, although it is far from being exaggerated by reporters, but it should be okay to show off it. ^_^ http://e.hznews.com/paper/hzrb/20140228/A9/4/
Haha, go to the topic:
And database say goodbye, doesn't mean, don't use the database anymore. Instead, you can store and access "persistent" data in another way.
Next, I want to write this method using a "Mobile backend service platform" developed by bmob. Simply put, developers should focus on the front-end code of mobile applications (web Support) and the database and server logic are handed over to the cloud platform for processing.
There are several advantages:
1: cross-platform. On the PC side, we use http to send and request data, regardless of. net or php. I keep learning the path, that is, ignoring the platform. As long as something is dedicated to a platform, for example, what controls of asp.net, I absolutely don't need it. It will make cainiao dependent. To what extent is this cross-platform powerful! It allows your android or IOS to use it (in fact, this is the advantage ~~ Not through http, but through the Development Kits they provide ). This allows you to easily and quickly share data between PC and mobile applications.
2: high speed and high speed. We don't need to find our own database servers, or we don't need to consider the query speed optimization problem. These are all done by service providers (servers in mainland China ). During development, many cainiao do not know the speed at which their websites or programs run in the real environment. For example, the host I tested is located in Hong Kong and the database is located in Hong Kong. My local program connects to the database and returns some databases, which is really very slow, it takes several seconds for simple functions to be returned, which is unacceptable.
3: zero cost. First of all, the various services of the service provider are free and stable (there are also charges for the enterprise), there are more detailed operation documents, and there is basically no difficulty in all kinds of operations.
But there are also some disadvantages:
1: cainiao who have poor foundations want to learn more about technology first. The introduction to orthodox databases should be learned first.
2: It is suitable for mobile development and is not suitable for users with replication requirements.
3: The "Database" and "backend" are distributed on different servers, so the PC-side Web applications may be slow (I did not process much data during the test, ). It is suitable for native APP development.
Now we will officially introduce this product.
In the previous section, we implemented the QQ login function. This time we stored the user data.
First you have to log on to http://www.codenow.cn/, create an app and get your own key
Create a new database table and field in "data browsing:
View development documentation (I am here using web development instances): http://www.codenow.cn/docs.restful#REST API Quick Start
Because the web documents are not written for a specific language or platform, I also got a rough idea after testing and consulting customer service for a long time. For example:
In. net, you have to write code like this:
String strData = "{\" value \ ": \" aaa \ "}"; // The json data here is based on the table field you created ASCIIEncoding encoding = new ASCIIEncoding (); byte [] byteData = encoding. getBytes (strData); HttpWebRequest http = (HttpWebRequest) HttpWebRequest. create ("https://api.bmob.cn/1/classes/wish"); http. headers. add ("X-Bmob-Application-Id: *********************"); http. headers. add ("X-Bmob-REST-API-Key: ***********************"); http. contentType = "application/json"; http. method = "POST"; http. contentLength = byteData. length; Stream send = http. getRequestStream (); send. write (byteData, 0, byteData. length); send. close ();
Other data operations are also similar. If you are interested, you should find it yourself. I haven't tested cloud-based verification yet. I need to use it again.
Currently, I am working on a project that is also related to database say goodbye, but I am not using this platform. Even if it is done, it will take a while to test its feasibility, so it will take a long time.
The last promotion Shop No. 1 shop (blue green bao shoes): http://shop.yhd.com/html/19810/ dedicated manual do 0 ~ The 3-year-old baby has the support of the baby.