Comparison of data storage and performance in Windows azure (III)

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

 

3. Queue storage. It is a queue implementation similar to MSMQ. A typical scenario of using queue storage is that in a web application, the user submits data to the server through a form, and the server processes the data after receiving the data, this processing will take a lot of time. In this case, the server can store the information submitted by the user in the queue through the queue storage, and then run a program in the background to obtain data from the queue for information processing. The maximum size of a message is 8 KB.

Example:

Add the following code to the main method of a project (for convenience, later called the client project). We will use it to add information to the queue storage.

Static void main (string [] ARGs) {var storageaccount = cloudstorageaccount. developmentstorageaccount; var queuestorage = storageaccount. createcloudqueueclient (); // check whether a queue named helloworldqueue is created. If not, create it var queue = queuestorage. getqueuereference ("helloworldqueue"); queue. createifnotexist (); console. writeline ("client is running... "); While (true) {// insert data to the queue. addmessage (New cloudqueuemessage (string. format ("client sent information: {0}", datetime. utcnow. tostring (); // after each data insertion, the thread takes 3 seconds to rest. sleep (3000 );}}

 

 

Then add the following code to the main method of another project (for the sake of convenience, later referred to as the server project). We will use this code to read and process information from the queue storage.

 

Static void main (string [] ARGs) {var storageaccount = cloudstorageaccount. developmentstorageaccount; var queuestorage = storageaccount. createcloudqueueclient (); // check whether a queue named helloworldqueue is created. If not, create it var queue = queuestorage. getqueuereference ("helloworldqueue"); queue. createifnotexist (); console. writeline ("server is running... "); While (true) {// read a message from the queue // After receiving the message, you can process it according to the received information. For demonstration convenience, we only display the information After a message is sent to IOT platform, the message is invisible to subsequent requests but not deleted. We need to display and delete it. // Otherwise, the message will be visible again after a period of time. This design ensures that all messages can be processed. // If the program terminates abnormally before receiving the message after processing, the data can be processed again after a period of time. // For details, see the msdn documentation var message = queue. getmessage (); If (message! = NULL) {console. writeline (string. format ("message retrieved: {0}", message. asstring); // after the data is processed, the deleted message queue must be displayed. deletemessage (Message);} // after each data read, the thread takes 3 seconds to rest. sleep (3000 );}}

 

4. SQL azure Storage

The above describes three storage methods of Windows azure storage. Storage storage is actually similar to local file storage, but the storage location is a remote ECS. The following describes a SQL-based storage method provided by Azure, similar to the SQL Server service: SQL azure storage.

It is a relational database service (database as a service) built on Windows azure cloud operating system and running cloud computing (cloud computing ), is a cloud storage implementation that provides network-type application data storage services.

(1) connection tools

Developers or administrators can use SQL Server Management studio of SQL Server 2008 R2 to connect to SQL azure server, or use the command line tool sqlcmd.exe to connect to SQL azure server. The connection string for SQL azure can be obtained in the Management window https:// SQL .azure.com of SQL azure.

(2) sqlazure restrictions

SQL Azure is designed based on the architecture and inherent restrictions. The account and security control of SQL azure server have the following restrictions:

  • Only a server-level primary account can change the password,loginmanagerThe member account of the group does not have the permission to change the password. If you want to access the master database, the user account must be mapped to the master database, at the same time, the server-level primary account cannot be changed or deleted. As long as the user is set as the server-level primary account
    dbmanagerOrloginmanagerYou can still create databases and manage users.
  • As long as you log on to the server, the master database is the default database, and us-English is the default logon language.
  • To runCREATE/ALTER/DROP LOGINOrCREATE/DROP DATABASEYou must first connect to the master database.
  • When you want to run the preceding commands in ADO. net, you cannot use parameterized commands. In addition, the preceding commands can only have one (and only one) SQL statement in batch ).
  • To runCREATE USERCooperationFOR/FROM LOGINOption, it must also be the only one in SQL batch.
  • To runALTER USERCooperationWITH LOGINOption, it must also be the only one in SQL batch.
  • Only server-level primary accounts anddbmanagerA role member can only runCREATE DATABASEAndDROP DATABASE.
  • Only server-level primary accounts andloginmanagerA role member can only runCREATE LOGIN,ALTER LOGINAndDROP DATABASE.
  • To access the master database, the Account must correspond to the master database.

(3) performance curve

Performance Curves for adding, updating, and deleting data on SQL azure.

 

Query the performance curve of data on SQL azure.

 

Performance Comparison of adding, updating, and deleting data on SQL azure and table Storage.

 

Performance Comparison of Data Query on SQL azure and table Storage.

 

 

Conclusion

By comparing the storage and SQL azure storage performance, we can know that the overall storage performance of SQL Azure is higher than that of storage. Therefore, when setting up an application service on Windows Azure, you must refer to the price difference between the two storage methods. At the same time, it is more important to weigh what data is stored in SQL Azure, what data is stored in storage, and the impact on the performance of application services within the scope of the entire project budget.

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.