Monday, September 3, 2018

Public cloud providers make it easy to write application gateways in the cloud without requiring the gateway to be part of the object storage. Such application gateway has path-based rules with path mappings that are essentially url rewrites such as /video or /image. These application gateways are minimal and equivalent static gateway routing requiring the attention from administrators to where copies of objects are maintained and the lifetime of these rules. By pushing the gateway into the object storage, we require that this maintenance no longer applies.
Since the gateway service in our case is part of the object storage, we wanted the url rewritten to the site where the object would be found. Since the object storage with a gateway is mostly used for deployments where there are three or more sites, the url is written to the site-specific address where the site is the closest to the origin of the incoming request. 

In this kind of url rewrite, we are leveraging the translation to the site. Since the gateway is part of the object storage from the discussions in our previous posts, even the namespace-bucket-object part of the address is also candidate for address translation. In this case, an object located within a bucket and part of a namespace ns1 may now be copied to another namespace, bucket and object which is now made available to the request. This destination object storage may have been setup temporarily for the duration of a peak load. The gateway therefore enables object storage to utilize new and dynamic sites within a replication group that has been created to increase geographical content distribution. 

The object storage is a no-maintenance storage. Although it doesn't claim to be a content-distribution network, our emphasis was that it is very well suited to be one given how it stores objects and their copies. All we needed was a gateway service.  And we said we don't need to maintain it outside because the url rewrites can be done automatically by pushing the gateway into the object storage tier. As the load on an object increases, copies may temporarily be made and the url mappings may be added to distribute the load. Then these rules may subsequently be removed as the copies of the objects are decommissioned. This is triggered only when an object has sufficiently aged without modification and the traffic has increased above a threshold. Alternatively the top ten percent of the most heavily read objects may be subject to this load distribution The load distribution may even be site specific so that the content distribution network continues to work as before.
#codingexercise
A semi-perfect number is the sum of some of its divisors. We can determine if a number is a sum of its subset with dynamic programming: 
Bool IsSubsetSum(ref List<int> factors, int sum) 

If (sum == 0) return true; 
If (sum < 0) return false; 
if (factors.Count() == 0 && sum != 0) return false; 
Var last = factors.last(); 
factors.RemoveAt(factors.Count() - 1); 
if (last> sum)  

Return IsSubsetSum(ref factors, sum); 

Return IsSubsetSum(ref factors, sum) || IsSubsetSum(ref factors, sum-last); 

No comments:

Post a Comment