Tuesday, January 5, 2016
Pitfalls of Object Oriented Programming
Wednesday, May 13, 2015
Why Database is not suitable for a Queue
1) Work distribution : As the number of messages flowing through the system increases the work distribution has to be managed by using locks or by using a Z axis scaling i.e. partition the message table and let different processes handle it. It becomes difficult to manage the failure cases e.g. if the process responsible to manage a particular partition goes down how do I bring up another process to pick up that partition. This is a problem which can be easily solved by event driven queues with horizontal scaling.
2) Database loads : As the messages passing through the system increase the load on the database starts increasing. This means that the database needs a scaling which is much more costly then scaling a queue bases solution.
3) Deleting and archiving the queue related tables is expensive as they are indexed.
4) Database has to be polled to see the pending work items while an event driven queue can simply call the worker process when a new message pops into the queue.
So while it may be enticing and easy to use database to orchestrate queue related workflows one should refrain from taking this technical debt as it would be really hard to pay it back in the future...
Abhishek
Tuesday, November 19, 2013
My struggles with a Mac
1) The Eclipse installation on Mac was not picking the proxy from the Safari settings so I had to set them myself. That can be done by downloading the Pac file from the automatic configuration script URL and then setting the right proxy in the Eclipse Network Connection Preferences section.
2) My Lync for Mac is not working for some reason. This still needs to be figured out. I will update this section once I am able to sort that out.
3) There is no Propose New Time functionality in the Outlook Calendar. (Sad :()
4) The Outlook Calendar in Mac shows 1 hour slot as big as 2 hours in my Outlook Calendar in Windows which I am used to. This can be changed by going to Organize Menu and playing with the Scale.
There will be more and I will keep updating this blog post for the small tweaks :).
nJoi!!!
Abhishek
Wednesday, September 25, 2013
Server Side Image Generation from SVG
There's one little problem which keeps you awake though and that is the fact that sometimes there are requirements to send the same graphics in and email as a image or a pdf and that becomes impossible because of the fact that there are no headless webkits available on the server side to do the rendering and convert them to image. Faced with this problem I explored a few options. The path I chose is
1) Use EnvJS as a server side DOM.
2) Using EnvJS create a Batik SVGDOM everytime you encounter a SVG Element.
3) Use Rhino to host EnvJS (the server is a java server)
4) Use Batik to convert the Batik SVGDOM into an image.
And it works just fine..
Happy Coding!!
Abhishek
Thursday, September 13, 2012
ACS With Windows Azure Webrole
I always wanted to make the ACS work in an Azure webrole. Somehow I was not able to put a sample together.
Seems like someone else has done it for us . Check http://social.technet.microsoft.com/wiki/contents/articles/2590.aspx for step by step guide on how would you deploy azure ACS authenticated webrole on Azure.
~Abhishek
Friday, August 24, 2012
Performance Counters in Windows Azure Web Role
I tried adding some performance counters for Windows Azure Web Role in the OnStart method of the WebRole and interestingly it was not getting enabled. The code just executed fine with no results present in the “WADPerformanceCountersTable”.
There are a few things which need to be done correctly to ensure that this works
1) The WebRole code should be running in the elevated context. In order to make sure this happens you should add a tag in ServiceDefinition.csdef file under the WebRole which is trying to add the counter. See screenshot below
2) If you are trying to update an existing deployment the new performance counters may not be picked up. To ensure that they are delete the existing deployment and create a new one. It seems that that the performance counters are picked up based on an xml file under the “wad-control-container” blob. This xml file is made for each deployment and for some reason it was not getting updated for my case.
Hope this helps…
¬Abhishek
Tuesday, August 14, 2012
Block Blob Vs. Page Blob
Windows Azure storage services provide ability to store large binary files using Blob storage. So if I have a large binary file which I want to store on Azure I can use the Blob Storage.
But now comes a tricky part. There are 2 types of blob storage available on Azure viz. you can store a large file as a Block Blob or a Page Blob.
The scenarios in which to use Page Vs. Block Blob according to MSDN documentation here is that Block Blobs are to manage the upload of large files in parallel while Page Blobs are good for Random read and write operations on a Blob. This one went right over my head.
What if I have a conflicting scenario e.g. I have a huge VHD file which I want to be uploaded in parallel and once uploaded do random read and write on it as needed. So I am not really sure which one should I use in such a case. I guess I would go for the Page Blob because upload is a one time operation for VHD file and after that my hypervisor will keep modifying the file for the life of the file. So it is more important that the random read and write operations are faster then the upload speed.
The technical difference can be summarized in the below table
Factor | Block Blob | Page Blob |
Max Size | 200 GB | 1 TB |
Chunk Size | Each Block can be 4 MB | Each Page can be 512 Bytes |
Write Operation | Multiple blocks can be modified and then a Commit Operation commits the modifications in a single go | The write operations happens in place and the commit is done then and there rather then waiting for a separate. |
So all in all.
Parallel upload == Block Blob
Random Read Write == Page Blob
Hope this helps
¬Abhishek