Skip to main content

Posts

AWS Architect Associate Notes - EC2

  EC2 - Elastic Compute Cloud Resizable compute capacity Pricing models On demand Low, flexible, no upfront cost Suitable for short term spike Reserved Suitable for steady state Pricing Standard reserved instance - 75% cheaper Convertible reserved instances - 54% cheaper Scheduled reserved instances SPOT For application have low compute usage Upto 90 % cheaper compared to on DEMAND Flexible start and end time You are not charged for the hour if AWS terminates your instance but are charged if you terminate the instance Suitable for fault tolerant or HPC application where downtime on short notice is acceptable. You get 2 minutes notice before an instance is terminated SPOT blocks stops an instance from being termina...

AWS S3 Transfer acceleration

AWS S3 Transfer Acceleration is a service provided by AWS to speed up the upload of file to S3. It basically uses Edge locations to upload the files and then uses AWS backbone to transfer the file to S3. You can view the results of a test I ran from London. As you can see there is no benefit of using it when you are uploading to a region closer to you but 25% gain for other regions https://s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/accelerate-speed-comparsion.html?result=3424-5714-9638-19209&identityId=unknown

AWS Architect Associate Notes - S3

S3 is a simple key based object store. S3 has globally unique namespace i.e. bucket name has be unique across all region but S3 bucket is created in a region. The data is stored on multiple devices spanning at least 3 AZs S3 has three URL scheme Global (legacy) Virtual Domain Based Path Based File size 0 bytes to 5 TB. Largest PUT 5GB Successful uploads produces a HTTP 200 Consistency Read after write for PUTS of new objects Eventual consistency for overwrites PUTS and DELETES S3 as objects and has following properties Key Value Version id Metadata Sub resources Access control list Torrents 99.99% availability, Amazon guarantees 99.9% and  99.999999999% durability (unlikely it will be lost) Tiered storage Standard S3 - IA S3 - one Zone - IA S3 - Intelligent Tierin...

More than one way to skin a cat

Software Engineering is one engineering field where there is always more than one way to solve a problem. Now this can be a blessing or a curse depending on the situation. There are so many instances I have seen where developers argue to nth degree which is the right way to solve a problem or write code. Should code be centralised or should be near to place where it is used? How do we make sure we dont miss updating the code if the code changes somewhere else in future? How do we make sure if someone else picks up the code and doesn't follow the convention? It is like as if you are building an extension to your house and the builder will use complete different bricks and not check what colour of bricks were already there even though it is right there in front of his eyes. So how do we solve the problem? How can we help the team to focus on the solution and not gold plate the solution? This is where patterns and principles come in. People have solved problems, If you study ...

Reboot 2020

Wow! it has been two years since I have written a post here. Time to Reboot/ Restart here. Lots has changed in last two years. I have changed couple of jobs. Learnt a lot from leading different teams - from a mature team of site reliability Engineers working for a multinational Fintech to a young team of developers working for a start up. It has been a journey of ups and downs in last two years. 2020 has been a challenging year with lockdown and working from home. Again lots of learning and working on new stuff like mobile development echo system.... So time to kick things off....

Running a Asp.Net Core MVC app in IIS locally

.Net core MVC app by default run either in IIS Express or self hosted using Kestrel. The address is usually https://localhost:5001 or some random port. Now this is fine unless you want to test the app with some other services like social login with Twitter or Google. They dont like address with port numbers. As Asp.Net core apps runs out of process, you cannot just add a virtual directory in IIS to make your app work. The wiring up is little bit more convoluted. If you would like a deeper understanding, read this article. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module?view=aspnetcore-2.1 Here are the steps to test your MVC app in IIS Enable IIS server roles. See steps here https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1#iis-configuration Install ASP.Net Core module from here https://www.microsoft.com/net/permalink/dotnetcore-current-windows-runtime-bundle-installer Restart your IIS Cr...

Closure and Captured variables

Here is a sample code. Can you guess what the output would be ? public static class TasksExample { public static void Execute() { Task[] tasks = new Task[10]; for (int i = 0; i < 10; i++) { tasks[i] = Task.Run(() => CalculateResult(i)); } Task.WaitAll(tasks); //ask.Wait(); //Console.WriteLine(tasks[i].Result); Console.WriteLine("Next work..."); } public static int CalculateResult(int i) { Console.WriteLine($"work starting {i}"); Thread.Sleep(10000); Console.WriteLine($"Completed work {i}"); return 100; } } Pat yourself if your answer was like this work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 work starting 10 Completed...

How to be more productive?

Are you one of the those who wants to do something you really like but feel that you are too busy and don’t have enough time. Do you feel that only if there were 48 hours in a day? Guess what you are not alone. These days always ON and connected world has helped us to peek into someone’s life on the other side of the world but has left no time for our own life. So how do you find the time? Step 1: Ask yourself: Are you productive or just active? Every task you do, think about the value it is generating. Are you just doing the task to keep yourself busy? Could you delegate the task? Does the task really need to be done? Bin any task that is not adding value and help you achieve your goals. Step 2: Do only the important but not urgent tasks Divide the tasks into four quadrants along  axis of important and urgent . Do the task while they are important but not urgent. Ignore the tasks that are not important and not urgent. Step 3: Learn to ignore Ignore any information ...

How to get started with mobile app?

Are you new to mobile development and wondering where to get started in this saturated and complex world of frameworks? Are you wondering whether to go native, hybrid or new kid on the block: PWA ? I would suggest don't waste any time and just get your hands dirty.... When I started looking at mobile development, I went through the same experience. So to save you the time, I would suggest start with Ionic framework to start building Hybrid apps. You should be comfortable with HTML, JavaScript, some CSS and some Angular (SPA framework) knowledge would help but you can learn this as you go along. You can get started with Ionic in 3 simple steps . You can test you app locally in your browser or on your device using DevApp That's all you need to get started!!! Your career as mobile developer started in under 10 mins!! Happy development. Feel free to share any more similar frameworks in comments below.