Optimization of Web services

发布时间 :2025-10-12 13:01:49 UTC      

This section describes how to improve Web Quality of Service (QoS). Service quality mainly includes the following important indicators.

  • Performance: Describe the response efficiency of the system, usually measured in response time.

  • Scalability: Describing whether the system can maintain high performance as the number of users increases, usually measured by the number of users it can support at the same time.

  • Availability: Describes the accessibility and operability of a system, usually measured as a percentage of the system’s running time. If a system’s availability is 99.99%, the system can only have a maximum of 9 seconds of downtime per day (including unexpected downtime caused by faults and human downtime required for system maintenance)

  • Security: Describe the confidentiality and defense capabilities of the system.

Preprocessing (caching) #

Preprocessing, also known as caching, means that the system generates maps or performs other tasks in advance and stores the results for later use, rather than generating maps or performing tasks in real time when a user request is received during the system operation. As shown in Figure 3.18, if there is a cache, the Web server can quickly retrieve the results from the cache without having to read the data from the database and complete mapping and other processing in real time. Caching reduces the burden on GIS servers and database servers, and is an effective way to improve the service quality of WebGIS.

Web servers can quickly find results from caches, respond quickly to user requests, This reduces the pressure on GIS servers and databases and improves the quality of services

Fig. 39 Web servers can quickly find results from the cache and quickly respond to user requests, thereby reducing pressure on GIS servers and databases and improving the quality of services #

Caching technology is mainly used to generate maps. Map cache, also known as map tiles or tiles, is a series of map tiles (or tiles) that are predetermined to generate according to a series of scales for quick display (Figure 3.19). The main reasons for making a map cache are:

Map caching pre-generates map tiles (A) according to a series of scales. The map caching scheme includes scale stages, scale of each layer, Tile size, tile starting point, tile area and picture format. (Thanks: National Park Service)

Fig. 40 Map caching pre-generates map tiles (A) according to a series of scales. The map caching scheme includes scale stages, scale of each layer, tile size, tile starting point, tile area and picture format. (Thanks: National Park Service) #

  • Improve system performance, scalability and availability: Caching reduces the burden on the server, and users can get fast responses, saving users time.

  • Improve mapping quality: Advanced symbols and complex layers can be used to generate high-quality maps in advance.

  • Industry practice: In current Web map applications, caching is widely used for basic basemaps. This has become an industry practice and has also changed users ‘expectations for WebGIS. They expect all WebGIS to provide a better user experience of caching.

Before creating a cache, some planning needs to be made, such as which coordinate system to use and which tile scheme to adopt. The tile scheme includes the scale level, the scale of each level, the size of the tile (such as 256 pixels x 256 pixels), the starting point coordinates of the tile, the tile area, and the picture format (such as JPEG, PNG8, PNG24 or PNG32). If your map will be used with ArcGIS Online, Google Maps, or Microsoft Bing Maps, your map should use the same coordinate system as them, WGS84 Web Mercator, and your tiling plan should match them. The creation of the cache may take a long time to complete, depending on the complexity of the map and the tile scheme, especially the number of scales and the size of the scale. The largest scales generally occupy most of the time spent creating the cache. Caching is best for maps that change infrequently, such as street maps, image maps, topographic maps, and other basic basemaps. If your data changes frequently, you can update the cache regularly to ensure the current nature of the tiles, or you can use dynamic maps instead of tiles.

In addition to map caching, caching can also be used for tasks such as querying and geoprocessing. For example, geographical processing is cached in the Boston Solar Project WebGIS (see Chapter 2). The app allows users to view the light potential of each roof in Boston, which is a high-intensity calculation because it requires many environmental and atmospheric factors to be considered. The project uses ArcGIS spatial analysis tools to calculate in advance the monthly light potential of each roof and the amount of C02 that can reduce emissions each year, and stores these results in a table. When a user wants to calculate the lighting potential of a certain roof, the system does not need to calculate anymore. Instead, it directly reads the results from the cache table and immediately presents them to the user (Figure 2. 11), this hides the complexity of geographical processing, improves system performance, and obtains a better user experience.

Optimization of algorithms and systems #

WebGIS should carefully consider the optimization of software algorithms and software and hardware systems to achieve optimal performance. There are many different implementation methods for each GIS task, and discovering and adopting the best algorithm can greatly improve system performance. For example, when map caching is not feasible or optimal, dynamic drawing of maps becomes necessary, and dynamic generation of maps is generally slow. ArcGIS for Severl〇. 1 Abandon the original MXD-based map rendering engine and adopted a high-performance drawing engine based on Service Definition, which can quickly generate maps and maintain good mapping quality.

GIS database debugging is also an important part of WebGIS. Some basic techniques include:

  • Unify geographical data into required projections (such as Web Mercator);

  • Create indexes, including spatial indexes and attribute indexes;

  • Maintain efficient table space;

  • Clean up the fragmentation of table space and server drives;

  • Preload indexes and even data into memory;

  • Update database statistics in a timely manner (so that the database can choose the best execution path when executing queries).

The system configuration plan needs to consider how many users there are, how many people may be using the system at the same time, what work they are using the system to do, how much data the system has, how the data volume will grow in the future, and the response speed and usability required by the project., and configure enough software and hardware based on these factors.

failover and load balancing #

Failover and load balancing are two deployment methods to improve system reliability and availability through redundant configuration. Failover means that when one server fails or requires maintenance, the system can automatically or manually redirect a Web user’s request to another server. Load balancing is the distribution of user requests to two or more servers, allowing multiple servers to share the work of the system. Large WebGIS systems should consider failover and load balancing. For example, the ArcGIS for Sever site provides both failover and load balancing capabilities. The site uses a Web gateway to accept incoming requests and distributes these requests to multiple GIS servers to achieve load balancing. If a GIS server computer becomes unavailable, the Web Gateway can distribute requests to the remaining GIS servers, creating a “high-availability” architecture.

Reduce pressure on Internet bandwidth #

Web services receive requests from clients and return results to the clients. Data transmission between the two, especially geographical data, often requires considerable Internet bandwidth; otherwise, the quality of the Web services will be affected. The following methods can reduce the pressure on Internet bandwidth and thus improve the quality of Web services.

  • Leverage browser-side caching: Browser-side caching is different from server-side caching. The server-side caching mainly refers to pre-generating map tiles or other results, while the browser-side caching mainly refers to not downloading content that has already been downloaded into the browser again. The cached content on the browser side is often marked by a URL, so REST-style Web services allow the system to make full use of the browser-side cache to improve system performance.

  • Adopt HTTP compression: Enable the compression option of the Web server to compress the requests and results of the Web service and then deliver them. This can reduce the data transmission volume by 50% and improve the transmission efficiency of the system.

  • Choose the appropriate data format: For example, in many cases, JS0N and AMF are lighter and easier to transfer than XML.

Security protection of Web services #

Many geographical Web services are public and free, but the Web services published by some enterprises, governments and other institutions may contain content that involves confidentiality of the company, involves customer privacy, or requires fees. These Web services need to be protected. Here are some basic techniques for protecting the security of Web services.

  • Use private networks and virtual private networks: In this solution, the Web service and its users are jointly located in the internal network of an organization, and are isolated from the external network through firewalls and other methods, so external network users cannot access it. A virtual private network (VPN) creates a secure channel over the Internet. Through VPN, even if the client is not in the office, it can still log in to the intranet and use Web services on the intranet.

  • Authentication: Protect Web services through user roles and permissions. User identities can be managed using Lightweight Directory Access Protocol (LDAP), Windows Active Directory, etc. 0. Security tokens: A token is an encrypted string that contains encrypted authorization information. Tokens are obtained on request or when the user logs in.

  • Secure Hypertext Transfer Protocol (HTTP S) : HTTP S encrypts data transmitted between Web services and customers to prevent information from being intercepted and tampered with.

  • Reverse proxy: Use a proxy server to accept connection requests on the Internet, then forward the request to a server on the internal network, and return the results from the server to the client. In this way, the proxy server can hide the GIS server in the intranet, providing a barrier between the GIS server and possible malicious attacks and providing a layer of protection (Figure 3.20).

Geospatial Web services can be protected through firewall JHTPS, reverse proxy, and user rights

Fig. 41 Geospatial Web services can be protected through firewall JHTPS, reverse proxy, and user rights #

Web services technology is an important development in distributed computing and GIS, and is the core of modern WebGIS. Geospatial Web services are the driving force for the transformation of GIS applications from closed systems to open, loosely coupled architectures. They are a component for building geoaggregation applications (see Chapter 4), an important form of cloud GIS services, and the foundation of the next generation of spatial data infrastructure (see Chapter 7), providing a collaborative approach based on geographical information. Governments and enterprises can provide their data and functions into Web services and build a Web service ecosystem. On this basis, a large number of applications with new value can be bred. This form of mutual cooperation can enable investment in the geospatial field to maximize social benefits.

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.