Posts

NETCONF - YANG

Image
  Netconf :  - Device Management Protocol like CLI / SNMP.  - Provides a mechanism to configure / Query the configuration and status  of the network devices.  - Similar to SNMP which uses MIB metadata, Netconf uses Yang to describe the interaction models between Netconf client and servers.  - Default port is 830 - Uses XML based data encoding - The traditional  CLI/SNMP  mode  does not meet  the requirements of  cloud-based networks .  Yang : - Data Modeling Language - Git hub  : https://github.com/YangModels/yang - pyang (pip install pyang) can be used to view the yang file content in tree format. - IETF defines the standard model and it is going to be consistent for all the vendors. Enable Netconf on the device:  (config) > netconf-yang Connect Netconf :  ssh -p 830 admin@10.77.126.171

Design

  Principles of Object-Oriented Design Single Responsibility Principle (SRP) The SRP requires that a class should have only a single responsibility. Open-Closed Principle (OCP) The OCP requires that each software entity should be open for extension, but closed for modification. Liskov Substitution Principle (LSP) The LSP requires that objects in a program should be replaceable with instances of their subclasses without altering the correctness of that program. Interface Segregation Principle (ISP) The ISP requires that clients should not be forced to depend on interfaces that they do not use. Dependency Inversion Principle (DIP) The DIP requires that high-level modules should not depend on low-level modules, both should depend on abstraction. Also, abstraction should not depend on details, details should depend on abstractions. Test-driven development  (TDD)  Test-driven development  (TDD) is a software development process relying on software requirements being converted to test cases

latest Tools difference , advantages

Image
  SQL vs NoSQL: SQL :  - Relation database, Structured, Vertically scalable ( you can increase the load on a single server by increasing things like RAM, CPU, or SSD ).  - Table based -  PostgreSQL, MySQL, Oracle and Microsoft SQL Server No Sql : -  Distributed, Unstructured, Horizontally scalable  - Key-value pair, document-based, Graph database -  Redis, RavenDB Cassandra, MongoDB, BigTable, HBase, Neo4j and CouchDB Key highlights on SQL vs NoSQL:     SQL NoSQL RELATIONAL DATABASE MANAGEMENT SYSTEM (RDBMS) Non-relational or distributed database system. These databases have fixed or static or predefined schema They have dynamic schema These databases are not suited for hierarchical data storage. These databases are best suited for hierarchical data storage. These databases are best suited for complex queries These databases are not so good for complex queries Vertically Scalable Horizontally scalable Follows ACID property Follows CAP(consistency, availability, partition tolerance) Ra

Java Memory Management

Image
Garbage Collection: Garbage Collection is the process of freeing space in the heap for the allocation of new objects. One of the best features of Java is automatic garbage collection.  Garbage Collector is the program running in the background that looks into all the objects in the memory and find out objects that are not referenced by any part of the program. All these unreferenced objects are deleted and space is reclaimed for allocation to other objects. One of the basic ways of garbage collection involves three steps: Marking:   This is the first step where the garbage collector identifies which objects are in use and which ones are not in use Normal Deletion:  Garbage collector removes the unused objects and reclaims the free space to be allocated to other objects Deletion with compacting:  For better performance, after deleting unused objects, all the survived objects can be moved to be together. This will increase the performance of allocation of memory to newer objects Java Mem

Kubernetes

  Cheat Sheet:   https://www.mirantis.com/blog/kubernetes-cheat-sheet/ Why kubernetes? 

Java Collections

ArrayList Vs HashSet: Load Factor: The default load factor of an ArrayList is 0.75f.  For example, the current capacity is 10. So, loadfactor = 10*0.75=7 while adding the 7th element array size will increase.   Growth Rate: current_size + current_size/2 Example: package com.vasanth.java.collections; import java.util.ArrayList; import java.util.HashSet; /**  *   * @author Vasanth  *  */ public class ArrayListVsHashSet { public static void main (String args[]) { /* ArrayList * - Implements List Interface * - Baked by Array * - Insertion order will be maintained * - Duplicates are allowed * - Null allowed , no restriction. * - Index based. we can retrieve/remove object using index. get(index)/remove(index) */ ArrayList<Object> arrayList = new ArrayList<>(); System.out.println("===== ArrayList====="); arrayList.add("hello"); arrayList.add(20d); arrayList.add(1); arrayList.add(10L); arrayLi

Spring Data JPA Using Hibernate

  ORM  (Object Relational Mapping): - Process of mapping a Java class to Database tables .  - Developers can deal with Objects instead of writing SQLs.    JPA (Java Persistence API) :  - Its a standard from Oracle to perform ORM in Java EE applications. - JPA comes with Specification & API             Specification -> For JPA Vendors/Providers like Hibernate, Open JPA , Eclipse Link and etc..               API -> For developers Why JPA: Before JPA, we have to learn each ORM tool like Hibernate / Open JPA and etc depends on the ORM  we used in our application.  Now, we can learn one single API (JPA). All the vendors/Providers implements JPA. So, we can switch from one vendor to another without making any code change in our application,  JPA API : Two important classes: EntityManagerFactory EntityManager Spring Data will hide these APIs, we need not deal with the above classes :)       Also, a lot of annotations are available. For Eg:                     To Map java classe