Posts

Showing posts from 2019

Two Sum

Problem: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. https://leetcode.com/problems/two-sum/ Solution1:  https://leetcode.com/submissions/detail/277898249/ Solution2:  https://leetcode.com/submissions/detail/277899522/

Jumping in Microservices

Monolith Vs Microservices: Knowing The Difference What is a Monolith? A monolithic application is built as a single, unified unit. Often a monolith consists of three parts: a database , a client-side user interface (consisting of HTML pages and/or JavaScript running in a browser), and a server-side application. The server-side application will handle HTTP requests, execute domain-specific logic, retrieve and update data from the database, and populate the HTML views to be sent to the browser. Another characteristic of a monolith is that it’s often one massive code base. Server side application logic, front end client side logic, background jobs, etc, are all defined in the same code base. This means if developers want to make any changes or updates, they need to build and deploy the entire stack all at once. Monolith Pros: Fewer Cross-cutting Concerns: A major advantage associated with monolithic architecture is that you only need to worry about cross-cutting conce

Monolithic Architecture

Image
A monolithic architecture is the traditional unified model for the design of a software program. Monolithic, in this context, means composed all in one piece. Monolithic software is designed to be self-contained; components of the program are interconnected and interdependent rather than loosely coupled as is the case with modular software programs. In a tightly-coupled architecture, each component and its associated components must be present in order for code to be executed or compiled. Furthermore, if any program component must be updated, the whole application has to be rewritten  Module Monolith If you have a module monolith then all of the code for a system is in a single codebase that is compiled together and produces a single artifact. The code may still be well structured (classes and packages that are coherent and decoupled at a source level rather than a big-ball-of-mud) but it is not split into separate modules for compilation. Conversely a non-monolithic module d

Load Balancing & Consistent Hashing

Load Balancing: Load Balancing Basics   (YouTube Video) What is Load Balancing   (YouTube Video) Comparing Load Balancing Algorithms (YouTube Video) Load Balancing (Article) Load Balancer Algorithm  (Article) Sticky and Non-Sticky Session  (Article) What is Sticky Session  (Article)  Consistent Hashing: A Brief Introduction to Consistent Hashing    (YouTube Video) What is Consistent Hashing   (YouTube Video) Consistent Hashing (Article)

What is Scaling of a system?

Scaling: Horizontal vs Vertical Scaling  (YouTube Video) Horizontal and Vertical Scaling in Distributed Environment  (YouTube Video) How to explain vertical and horizontal scaling in the cloud  (Article) Vertical vs horizontal (Quora explanation) Pro and Cons for Vertical and Horizontal scaling (Article) Vertical scaling can essentially resize your server with no change to your code. It is the ability to increase the capacity of existing hardware or software by adding resources. Vertical scaling is limited by the fact that you can only get as big as the size of the server. Horizontal scaling affords the ability to scale wider to deal with traffic. It is the ability to connect multiple hardware or software entities, such as servers so that they work as a single logical unit. This kind of scale cannot be implemented at a moment’s notice.