雲端運算 (cloud-computing) 在各大廠宣布要開始推廣的情況下,儼然已經成為下一代的運算標準,Microsoft 也正在為雲端運算技術推廣做準備,第一個產品就是 SQL Server Data Service,不過筆者要談的不是這個,而是可能未來會內建到 SQL Server Data Service 中,負責在雲端中做資料流繞送以及快取工作的元件,代號為 Velocity 的專案。
Velocity 專案是實作給 .NET 應用程式所使用的智慧型記憶體內快取 (in-memory cache) 機能,它在後端資料提供者前提供了一個一致化的存取端點,讓應用程式可以在不需要知道後端資料來源配置 (database source allocation) 的狀況下,就可以存取到快取中的資料,看起來是很像 Proxy Server 快取 HTML 的架構,不過它快取的是資料。
Velocity 預計提供下列功能:
Caches any serializable CLR object and provides access through simple cache APIs. Supports enterprise scale: tens to hundreds of computers. Configurable to run as a service accessed over the network or run embedded with the application. Supports common cache configurations. Supports dynamic scaling by adding new nodes. Configurable number of backup copies to provide high availability. Automatic load balancing. Integration with administration and monitoring tools such as ETW, System Center, etc. Provides tight integration with ASP.NET to be able to cache ASP.NET session data in the cache without having to write it to source databases. It can also be used as a cache for application data to be able to cache application data across the entire Web farm. Follows the cache-aside architecture (also known as Explicit Caching) for V1. That is, you must decide explicitly which objects to put/remove in your applications and “Velocity” does not synchronize with any source database automatically. Support for multiple client languages (for example, PHP, C#, C++, etc.).對於 Velocity 來說,資料分為參考型資料(具版本化,基本快取的資料,鎖定使用 Shared),資源資料(經常變更型的資料)以及活動資料(交易進行中的快取資料,鎖定使用 exclusive write),最具挑戰性的應該要算是資源資料和活動資料吧,主要還是快取的鎖定問題,在雲端運算中,資料庫的存取壓力會更重,快取機能就是可有效分散資料庫運算壓力的機能,Velocity 所負責的就是這一項。
另外在雲端運算中,資料可能分散在許多的資料庫伺服器中(load balancing),快取機能必須要能夠正確的對應到正確的伺服器以及正確的資料列,才能夠得到正確的資料,因此 Velocity 必須要能做到這一點。
更多的 Velocity 資訊:http://msdn.microsoft.com/zh-tw/library/cc645013(en-us).aspx