Posts

Showing posts from August, 2021

Database Sharding

 What is Sharding? Sharding is a database architecture pattern related to horizontal partitioning — the practice of separating one table’s rows into multiple different tables, known as partitions. Each partition has the same schema and columns, but also entirely different rows. Likewise, the data held in each is unique and independent of the data held in other partitions. It can be helpful to think of horizontal partitioning in terms of how it relates to vertical partitioning. In a vertically-partitioned table, entire columns are separated out and put into new, distinct tables. The data held within one vertical partition is independent from the data in all the others, and each holds both distinct rows and columns. Should I Shard ?  Whether or not one should implement a sharded database architecture is almost always a matter of debate. Some see sharding as an inevitable outcome for databases that reach a certain size, while others see it as a headache that should be avoided unless it’s

Postman test cases on Jenkins

Image
 1. Download and install postman - https://www.postman.com/downloads/    2. Open postman and click on collection       Create new folder and start writing test cases -    This will generate test suit for you ( postman collection for test cases ) 3. Click on Environments and add key, value pair for the environment variables  Example - We can specify environment details here so that same test case by changing env can be executed on multiple environments like - DEV, QA, UAT and PRD  4. Now export postman collection and environment      postman.collection.testcases.json      postman.collection.env.json 5. Now install node js -  https://nodejs.org/en/download Install below node packages also -       sudo npm install -g newman      sudo npm install -g newman-reporter-htmlextra 6. Now go to the folder where postman collection and environment json are store  7. Run below commands -  newman run postman.collection.testcases.json -e postman.collection.env.json -r htmlextra --reporter-htmlextra-ex

SOLID Principles in programming

  If you follow, these principles you can improve the reliability of your code by working on its structure and its logical consistency. The SOLID principles are: The Single-Responsibility Principle (SRP) The Open-Closed Principle (OCP) The Liskov Substitution Principle (LSP) The Interface Segregation Principle (ISP) The Dependency inversion Principle (DIP) In general, the SOLID principles are basic learning steps for every code developer but are usually ignored by those who does not consider the highest quality of code their absolute priority. 1) The Single-responsibility principle (SRP) In other words, every component of your code (in general a class, but also a function) should have  one and only one responsibility . As a consequence of that, there should be only a reason to change it. Too often you see a piece of code that takes care of an entire process all at once. I.e., A function that loads data, modifies and, plots them, all before returning its result. 2) The Open–closed princ