Skip to main content

Posts

Decoding Json Web Tokens (JWTs) | Purpose, Solution and application

Well, I have used a bunch of user authentication and authorization web applications in my tenure on the Internet. And its the time, while working on one of the related projects, I was introduced to this amazing term "JWT". And this is how my journey of exploration began! What is JSON Web Token(JWT)? As defined on the official website, on an abstract level,  JWT  is a standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. 😐 If you got it, skip the blog! If you are still reading, buckle up the belts, time to dissect it further! Let's understand why do we need it in the first place! HTTP as per the design is a stateless protocol. This means the server while serving a request does not know anything about the previous request. Thus, for applications which majorly relies on user authentication and authorization suffers a big problem. Pre-context | Authorization vs Authentication

A case study on Dynamo | Highly available key-value store by Amazon

How e-commerce giants like Amazon , eBay scales? was the question I had for a long time. And Meanwhile, I stumbled upon this amazing paper  by Amazon. The paper highlights the design and implementation of Dynamo, a highly available key-value store that some of Amazon's core services use to provide a seamless user experience.  When it comes to building applications at large scale,  Reliability and scalability  are the biggest challenges these services face in their day-to-day business. Amazon operates on an infrastructure of tens of thousands of servers and networking components located across many data centers worldwide. Designing such applications starts right from the understanding of the requirements and objectives of the business.  Requirements: Dynamo is mainly for applications that need an ' always writable ' datastore where no updates are rejected due to failures or concurrent writes. Dynamo is built for infrastructure within a single administrativ

DI : The Buzzword

On the last Monday morning, when I was reading " this blog " I came across this term 'injector' for enough time to give it a thought and dig into it. and That's how I got started with it. DI: stands for Dependency Injection (ugh! what a fancy and confusing name!) It is a very famous code pattern to make the codebase more cohesive and loosely coupled. Often, while coding, we write some classes which internally initialize the objects of other classes. And thus the earlier class become dependent on the object creation of the later class. But, thoughtfully speaking, a class should be cohesive and should do nothing more than it's a purpose. For example, we have a class Employee and a class Address . Where an object of class Address is aggregated inside Employee class. Thus, Employee class, while providing a blueprint of an Employee object, now manages the creation of Address object too. This adds up the dependency and makes the class, less cohesive.

The stuff you should know about InnoDB | MySQL storage engine

It's been quite a while after the first blog about Storage Engines . But after that blog, the thing that hit me was how the databases like the great MySQL and the legend PostgreSQL works(subjective). While exploring MySQL I came across the famous, and default storage engine of MySQL , i.e. InnoDB . Whenever you create a table without mentioning 'ENGINE' attribute in a query, you are telling MySQL to go and use InnoDB to create the table. Well, there are many amazing/awesome/mind-forking storage engines that can be used instead of InnoDB . But, as InnoDB is the default, we should not hesitate to explore it. What is InnoDB?               InnoDB is the general-purpose storage engine that balances high reliability and high performance. Reliability is the fault tolerance quotient of the system. In MySQL 8.0 , InnoDB is the default MySQL storage engine, unless you configure it with other storage engines. What the hell InnoDB has? B-Tree indexes (u

Partitioning | Key Partitioning, Hash Partitioning and Request Routing

Concept       In distributed systems, it is often normal that data is replicated on other nodes to provide resiliency and high fault tolerance.  But at the same time, storing all of the data on a single node and keeping its copies across others might increase the query time and might affect query throughput. Well, While working with a large amount of data, in order to increase the query throughput, data needs to be distributed or partitioned across the nodes. This makes it easy to leverage the compute power of all the nodes involved.          A node having all the data is often known to be a "hot-spot". If the data is being queried, it will get queried from one of the nodes, depending upon the query type and type of replication i.e. leader-follower replication or leader-leader replication. If a node has all the data, then query throughput will suffer as it will have to refer all of the data unnecessarily. And that's where partitioning comes to rescue. Key-Range

Configuring systems in Multiple VLANs | concepts, use-case, conclusion

Preface When it comes to Networking, I always thought it's so boring and never ever gave a thought about how cool it can be! Well, as a human, psychologically, we all tend to have some biases, towards clothes, brands, things, opinions, judgments, emotions, the language to code in :P, etc which all contribute to some stubborn prejudices in our mind and which in turn creates conjectures. Well, in my opinion, Conjectures aren't healthy(subjective), as you tend to live in your hypothetical world without giving damn about facts and proofs. And the only way out is to cross-examine every decision, opinion, and judgment you make. Well, it's not a psychology blog, let's just leave it here. :) This is my experience of getting out of my prejudice with networking.  While working for a network feature, I came across this amazing use case. Thought of writing it down after I get done with it. Now I think it's the time. Grab your chair and popcorn, here it goes! Con

SSTables and Its Wonders!

Recap: In the last blog, we mentioned about the log structured based storage engine. Where the log-structured storage segment is a sequence of key-value pairs. These pairs appear in the order that they were written and values later in the log take precedence over the values for the same key earlier in the log. A step ahead... what if we modify its way of storage and store the data in sorted order of their keys? We call this format as Sorted String Table or SSTable as an abbreviation. Where we store keys in its sorted order. But wait! What about sequential writes that made bitcask faster? you might have this doubt. Let's keep that doubt as it is for now. Benefits with the approach: This would, undoubtedly, in turn, improve the performance of compaction(the process of eliminating duplicate values) and merging of the segments. Compaction would be more of a merge function in the famous MergeSort. While merging the segments, if we come across the same keys, then we cho