Updating many json files in Azure blob storage? -
I have ~ 1,000,000 JSON files, I would like to update every 30 minutes. Update is only enclosing a new array at the end of the existing content.
Uses the same code as a single update:
CloudBlockBlob blockBlob = container.GetBlockBlobReference (blobName); Jobbject jObject = null; // If the blob is present, then we may need to update it. If (blockBlob.Exists ()) {MemoryStream memoryStream = new MemoryStream (); BlockBlob.DownloadToStream (MemoryStream); JObject = JsonConvert.DeserializeObject (encoding.UTF8.GetString (MemoryStream. ToArray ()) functioning; } // End of Blease is present if (null == jObject) {jObject = new Jobbject (); JObject.Add (new JProperty ("identifier", identifier)); } // Closing of the block did not exist JArray jsonArray = new JArray (); JObject.Add (New JProperty (string.Format ("Entries {0}", Timestamp. ToString ()), jsonArray); Foreign Currency (Miscellaneous Entries in New Entry) {JSNARRA.ed (new JobTech (new JPPrint ("Some ID", Entry.), New JProperty ("Some Value", Value)); } // the end of the loop string jsonString = JsonConvert.SerializeObject (jObject); // upload blockblock Properties Type Content = "Text / Jason"; Blockblock UploadFomstream (new memorystream (encoding.utf 8.gatebites (jasonstring)); Basically: - Check if the blob exists,
- If this happens, download the data and create a Jason object.
- If it has not, create a new object with the details.
- Push the blob update.
Problems with it is performance demonstrations I have done a lot that I can do to increase the performance (updates run in five parallel threads and I use ServicePointManager.UseNagleAlgorithm
Is set to false.
It still runs at a slow pace, however, approximately 100,000 updates can take up to one hour.
So I was basically guessed , My question will be:
- Do I use blue blob for this
- If yes, any suggestion for improving performance?
Note: the original in the file There is a history of events and I can not re-generate the full file based on the existing data. Therefore, content is downloaded prior to updating.
Comments
Post a Comment