Monday, October 2, 2017

MongoDB Overview

MongoDB is a free and open-source, cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document, in simple terms JSON (JavaScript Object Notation) format at high level and at low level it’s BSON (Binary JSON). Before we understand we need to understand what it means when we say MongoDB works on concept of collection and document. In this article I’ll try to help you out with setup and basic commands for MongoDB. Let’s begin with understanding what makes MongoDB.

ACID Database Transactions
ACID (Atomicity, Consistency, Isolation and Durability) is a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc. We have used many RDBM databases designed on ACID properties.

CAP Theorem
CAP theorem states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency. Availability. Partition tolerance.



Based combination of consistency, availability and partition tolerance new generation of databases are designed. MongoDB is designed considering consistency and partition tolerance. When we want scalable NoSQL database MongoDB stands very clear in choice.


MongoDB:
MongoDB works on concept of collection and document. We need to understand following basic terms before we start MongoDB

  • Database: Database is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases.
  • Collection: Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose.
  • Document: A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data.

MongoDB uses Sharding to be partition tolerance it’s the process of storing data records across multiple machines and it is MongoDB's approach to meeting the demands of data growth.

MongoDB Installation:
You can download setup from https://www.mongodb.com/ or opt for MongoDB Atlas, it allows to Deploy, operate, and scale a MongoDB database in the cloud.  Basically database as a Service. Latest version of MongoDB DB is 3.4 at this time... Once you downloaded setup mongodb-win32-x86_64-enterprise-windows-64-3.4.9-signed.msi, simply next clicks will install server and client in your machine




In Bin folder you will get Database Server and Client which is mongod.exe and mongo.exe.

These are exes which will allow you to run shell version of MongoDB.
 --dbpath parameter in MongoDB will allow you to control what directory MongoDB reads and writes its data from.

 

Once data path is configured you are good to go.

MongoDB collection and document:
·         To make collection you need to run db.createCollection command e.g.

>db.createCollection("Products")
{ "ok" : 1 }
·         The basic syntax of insert() command is db.COLLECTION_NAME.insert(document)
>db.Products.insert({itemName: “Pen”, QOH: 1000,Price:5.00 })
For multiple insert you need to pass JSON array... Any document inserted into MongoDB get assigned _id for indexing which you can use while fetching or searching records.

·         The basic syntax of find() command is db.COLLECTION_NAME.find(document)
>db.Products.find()
Similar way you can update and other commands.Refer https://docs.mongodb.com/manual/reference/mongo-shell/

Additional tool
Robo 3T is the free lightweight GUI for MongoDB. It’s formerly known as Robomongo and can be downloaded from https://robomongo.org/


Advantages of MongoDB over RDBMS:
1) Schema less − MongoDB is a document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another.
Structure of a single object is clear
No complex joins.
Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL.
Ease of scale-out − MongoDB is easy to scale.Conversion/mapping of application objects to database objects not needed.
Uses internal memory for storing the (windowed) working set, enabling faster access of data.

This is to begin with MongoDB...What do you think? Let me know your suggestions and inputs.



Courtesy: Several online blogs & other resources 

Sunday, May 21, 2017

Kanban-Vs-Scrum


What is Kanban
Kanban is Japanese for “visual sign” or “card.” It is a visual framework used to implement Agile that shows what to produce, when to produce it, and how much to produce. It encourages small, incremental changes to your current system and does not require a certain set up or procedure. Kanban is called the “pull system.” When looking at Kanban vs Agile, it’s important to remember that Kanban is one flavor of Agile. It’s one of many frameworks used to implement agile software development.
In the context, Kanban board is easy to learn and understand, it improves flow of work, and minimizes cycle time. The benefits of Kanban include:

  •         Increases flexibility: Kanban is an evolving, fluid model. There are no set phase durations and priorities are reevaluated as new information comes in.
  •          Reduces waste: Kanban revolves around reducing waste, ensuring that teams don’t spend time doing work that isn’t needed or doing the wrong kind of work.
  •          Easy to understand: The visual nature of Kanban helps to make it incredibly intuitive and easy to learn. The team doesn’t need to learn a completely new methodology, and Kanban can be easily implemented on top of other systems in place.
  •          Improves delivery flow: Kanban teams optimize the flow of work out to customers. Like continuous delivery (CD), Kanban focuses on the just-in-time delivery of value and delivering work to customers on a regular cadence.
  • ·         Minimizes cycle time: Cycle time is the amount of time it takes for work to move through the team’s workflow. In Kanban projects, the entire team helps to ensure the work is moving quickly and successfully through the process.
What is Scrum
Scrum is a subset of Agile. It is a lightweight process framework for agile development, and the most widely-used one. A “process framework” is a particular set of practices that must be followed in order for a process to be consistent with the framework.
In the context, Scrum is a highly prescriptive framework with specific roles and ceremonies. While it can be a lot to learn, these rules have a lot of advantages. The benefits of Scrum include:
  •          More transparency and project visibility: With daily stand-up meetings, the whole team knows who is doing what, eliminating many misunderstandings and confusion. Issues are identified in advance, allowing the team to resolve them before they get out of hand.
  •          Increased team accountability: There is no project manager telling the Scrum Team what to do and when. Instead, the team collectively decides what work they can complete in each sprint. They all work together and help each other, improving collaboration and empowering each team member to be independent.
  •          Easy to accommodate changes: With short sprints and constant feedback, it’s easier to cope with and accommodate changes. For example, if the team discovers a new user story during one sprint, they can easily add that feature to the next sprint during the backlog refinement meeting.
  •          Increased cost savings: Constant communication ensures the team is aware of all issues and changes as soon as they arise, helping to lower expenses and increase quality. By coding and testing features in smaller chunks, there is continuous feedback
Scrum vs Kanban:
Scrum and Kanban are both flavors of Agile, but they have some distinct differences.
  • Scrum requires specific roles whereas Kanban has no required roles.
  • Scrum board is reset after each sprint. A Kanban board is continuously used.
  • Scrum is based on time boxed iterations, combining planning, process improvement, and release. In Kanban, you can choose to do these activities on a regular cadence or whenever you need.
  • Scrum limits work in progress (WIP) in each iteration, whereas Kanban limits WIP in each workflow.
  • Scrum resists change, whereas Kanban easily accommodates and embraces change. In Scrum, once the team has committed stories to a sprint, you can’t add additional stories later on. In Kanban, you can add or change stories as you please, assuming that it’s within WIP limits.
  •  A Scrum team is cross-functional and one team owns the Scrum board. In Kanban, teams don’t need to be cross-functional and anyone can own the Kanban board.
  •  Estimation forms the basis for Sprint Planning in Scrum whereas Kanban is a continuous model of delivery, so estimation doesn't hold significance.
And Scrum and Kanban also have some similarities: 
  •          They are empirical. You have to experiment with the process to see what works for you.
  •          They are Lean and Agile.
  •          Both allow team members to work on multiple products at once.
  •          They both limit WIP (although the way they each limit WIP is different)
  •          They use pull scheduling
  •          They focus on delivering software early and often
  •          Both use transparency to improve process
Scrumban:
Scrumban combines the principles of Scrum and Kanban into a pull-based system. The team plans out the work that was established during initiation and continually grooms the backlog. The same Scrum meetings should take place, but the frequency can change depending on context and need. The most important part of Scrumban is making sure that work in progress limits (WIP limits) are followed.

Scrumban takes bits and pieces from both Scrum and Kanban. For example, it includes the defined roles, daily Scrum, and other meetings from Scrum. And from Kanban, it takes the Kanban board, continuous flow, and ability to add changes as needed to the board.

Scrumban can look more like Scrum on the technical level, but at the cultural level, it will more closely resemble Kanban. Instead of big changes all at once, Scrumban encourages incremental changes. If your team is looking to migrate from Scrum to Kanban, Scrumban can provide a gentle transition.

Which One Is Best?
When comparing Kanban versus Scrum, there is no definitive winner. The best framework depends on your project, team, and your goals. Because both Kanban and Scrum are flexible agile methodologies, you could easily take principles from each and apply them as you see necessary.

It’s important to remember that true Scrum is a much bigger shift than Kanban. The team will have to learn about the ceremonies, the specific roles, and iterations. On the other hand, Kanban encourages incremental improvements. You can apply Kanban principles to any process you already have in place, even Scrum. Nothing needs to change significantly to get started with Kanban…

Courtesy: Several online blogs, Books & other resources,Image Credit to "Grow"

Friday, October 28, 2016

DynaTrace - Application Performance Management Solution

Recently I used DynaTrace, it’s a leading application performance management tool and is being widely used.It comes with advanced features for monitoring Java and .NET applications, which aids to identify bottlenecks or errors in the application easily. Pure Path technology used in DynaTrace provides end-to-end transaction level details; from browser, across all tiers and database. It helps to uncover performance issues even at the code level and also details of transactions invoking external services. This tool detects abnormalities in response time, transaction rate, through put and system usage
Magic of Pure Path:
A Pure Path is the horizontal view of a transaction in a monitored application environment and is the basis for top down analysis, which is defined by analyzing how an application or transaction is impacted by the underlying infrastructure.
Typically, a Pure Path is composed of data sent asynchronously by many different Dynatrace Agents, which then send the data to the Dynatrace Collector. The Collector buffers and enriches the data and passes it on to the Dynatrace Server, which is responsible for Pure Path construction, analysis, and offline storage. Pure Paths provide the superset of data for creating specific Business Transactions and high-level Measures
Once your Collector is configured, Agent is in place and Dynatrace Client is installed, In Navigation pane there will be options for Diagone Performance & Diagnose Runtime, these two are used for Pure Path analysis and Memory leak analysis…












Pure Path:
Go to Diagnose Performance à Pure Path menu item when double click on Pure path dash-let it opens dashboard, with option of filtering on last 5 minutes, 30 minutes, 1 day etc. With filter option last five minutes up, you need to  visit your application page then Dynatarce agent is going to capture every single request made to worker process and display result in very neat and clean tabular format as shown below



I have removed page name & server details but you can see its very simple table displaying response time for page, suspension time, GC Size etc .. When right click on any request you get option to see detailed drill down of request.. Dynatarce client capture request from every single request to the very end of response










You only need to scroll up and down.  You can always right click on each element to have more contextual information like on which server it was running on.  In our case we added the IP address of the remote user and its username.  By default it’s showing you only the relevant nodes (method calls where most of the time was spent) but you can chose to see all of them.
Check out the YouTube Tutorial they have on “PurePath Deep Dive” if you want to learn more about it.
Here I tried to cover basic steps for pure path analysis, in next blog of this series I will capture steps to analyze memory leak for identification of classes and objects causing memory leaks.

Courtesy: Several online blogs & other resources https://www.dynatrace.com/community/blogs/

Tuesday, April 12, 2016

Backlog Prioritization

Let's start with Agile Manifesto, it says
  1. Individuals and interactions over processes and tools
  2. Working software over comprehensive documentation
  3. Customer collaboration over contract negotiation
  4. Responding to change over following a plan
Where there is value in the items on the right, we value the items on the left more.  Reason is simple Agile focuses on Kaizen (Continuous Improvement), which is a strategy where employees at all levels of a company work together proactively to achieve regular, incremental improvements in the product.
Backlog grooming or refinement is the process which focuses on   Continuous Improvement on the product being developed.
What is product backlog refinement?
Product backlog refinement is the process through which product backlog items are reviewed by the Scrum team and revised, providing more detail and ensuring that there is greater clarity in the requirements for that item.
What product backlog items should be refined?
Any product backlog item should be refined as and when additional information is known about it. However, priority should be given to refining the product backlog items that are likely to be taken into the next sprint. This will ensure that enough information is known about each item to allow for it to be sized, for the plan to be generated during sprint planning as to how the selected product backlog item can be delivered, and to allow for the team to commit to delivering that and other items in the next sprint.
When should product backlog refinement take place?
Product backlog refinement should be an ongoing process. However, some teams find it useful to have a planned mid-sprint session that allows for product backlog items that are candidates for the next sprint to be discussed.
There are several ways to prioritize the requirements in the backlog. Some of the most popular ones include
1.     MoSCoW
M - MUST have this.
S - SHOULD have this if at all possible.
C - COULD have this if it does not affect anything else.
W - WON'T have this time but would like in the future.
Each requirement will have the priority which would be tagged to MSCW. "M" being the highest and "W" being the lowest.
2.   Business Value Based
In this case, each requirement carries a business value it could potentially generate to the company. The business value would be decided either by the Product Owner or the Product owner team.
The requirement with highest business value is implemented during earlier releases.
3.   Technology Risk Based
In this method, requirements are prioritized based on the risk associated in implementing it. The risk is typically based on the technology.
The requirement with highest technology risk is implemented during the earlier iterations. 
4.   Kano Model 
In this method, the requirements are prioritized based on the customer preferences. Mr. Noriaki Kano developed Kano model as valuable technique helping to recognize that. Applying this method the product owner can identify importance of stories by asking questions like these:
Is the feature mandatory? We will not earn additional revenue once we have it but without it the product doesn't fulfill existence principles.
Having a feature, will customer say: "Hey, that's nice! I like this approach and it seems to be really helpful." This feature is excitement. It is possible differentiator.
Well, guys improved a performance of the application. This is valuable.  Comparing to other products, this product is one I would like to use.
Hmm, this feature is indifferent. It doesn't matter if this feature is or is not implemented. If vendor provides it, ok, I accept it. If it's not implemented, no problem then.
This feature is really questionable. I am not sure if I am going to pay for product with such feature. It'll probably slower me. Also, I assume it will complicate usability in my company. Let's think about different product.
Ohhh no! Not the feature like that. You are kidding. These features reverse me to really find a different product. Such perspective is great way to identify priorities in complex backlog.
  • Attractive
  • One-Dimensional
  • One-Dimensional
  • Must-Be
  • Indifferent
  • Reverse

5.    Walking Skeleton 
In this method, the requirements are selected such that minimal carefully selected end to end features are built within a short span of time.

6. Validated Learning 
In this method, features are chosen based on the highest market risk i.e. something that is not experimented yet. Release it to the market, get the feedback and apply the learning onto the new feature
In this blog I covered basic definitions of Backlog Prioritization techniques ,  I would suggest please refer several blogs and eBooks available out there on internet for more details.

Please let me know you inputs, Suggestions or questions on this.

Courtesy: several online resources i.e. Blogs, Tutorials etc.

Wednesday, July 8, 2015

MVC 5 New Features

ASP.NET MVC is Microsoft’s latest web application development technology based on the principle of the separation of concerns. MVC stands for Models, Views and Controllers, respectively. Prior to MVC pattern, Web Forms was the prime Microsoft technology for web application development. However, Web Forms lacked flexibility of development and loose coupling. MVC addressed these concerns. We’ll discuss some of the new features offered by ASP.NET MVC 5, which is the 5th version of the Microsoft MVC technology
  1. Scaffolding
  2. ASP.NET 
  3. IdentityOne ASP.NET 
  4. Bootstrap
  5. Attribute Routing
  6. Filter Overrides
    Some of these features like ASP.NET Identity etc. are not exactly new features of the core MVC 5 framework, but are worth looking at, as they directly affect/change the way we create MVC 5 applications.

    Scaffolding

    Visual Studio 2013 includes a new Scaffolding Framework for ASP.NET MVC 5 and the ASP.NET Web API 2. Simply put, Scaffolding is a code generation framework provided for ASP.NET Web Applications. Using this framework, you can quickly generate code that interacts with your data models. This feature reduces the amount of time required to build MVC application with standard data operations. Scaffolding uses code-first approach for data operations.
    Basically we need to add model class in project and on the project, right-click and select Add > New Scaffolded item as shown there, we can select API or controller. Then it will generate required classes automatically.  It will help in moving ahead quickly with Code First Approach.

    ASP.NET Identity

    In earlier days of ASP.NET 2.0 programming, a membership provider approach was introduced. This allowed the application to store user’s data in a SQL Server database. This membership model has changed over the years. The notion that a user can log-in by only using a user-name and password registered in the application, can now be ignored. In today’s world, the web has become more social and users connect to each other, and with applications, using social sites like Facebook, Twitter etc. So considering these social integrations, web applications too need to be enhanced to allow users to log-in using their social media credentials.

    To get this done, the modern membership framework is now extended to integrate with social credentials and for this purpose, ASP.NET Identity has been introduced. The advantages of the ASP.NET Identity are explained as follows:
    - One ASP.NET Identity System: Can be used across all the ASP.NET Frameworks like Web Forms, MVC, Web Pages, Web API and SignalR etc.
    - Ease of plugging-in profile data about the user: The user’s profile schema information can be integrated with the web application.
    - Persistence Control: ASP.NET Identity system stores all user information in the database.
    - Social Login Provider: Social log-in providers such as Microsoft Account, Facebook, Twitter, Google, and others can be easily added to the web application.
    - Windows Azure Active Directory (WAAD): The Login-in information from WAAD can also be used for authenticating a web application.
    - OWIN Integration: ASP.NET Identity is fully compliant with OWIN Framework. OWIN Authentication can be used for login. If you are new to OWIN, read this article.
    All these features in the ASP.NET Identity membership system are available if you are using Visual Studio 2013. Alternatively, you can also obtain it via NuGet packages Microsoft.Aspnet.Identity.Core and Microsoft.Aspnet.Identity.EntityFramework.

    One ASP.NET

    One ASP.NET is a new unified project system for .NET Web Developers. This system makes it easier to work with multiple frameworks like Web Forms, MVC, Web API etc., in a single project. So essentially using the One ASP.NET project system, you can use ASP.NET Web Forms and MVC together, and can easily add ASP.NET Web API and SignalR too; in the same Web application.
    In Visual Studio 2013, the ASP.NET MVC project template integrates with this new system. One of the useful features while creating a MVC project is that the authentication mechanism can be configured using following steps.
    Step 1: Open VS 2013 and select File > New > Project, select Web from installed template
    Step 2: Make sure that .NET Framework 4.5.1 is selected; click OK, New ASP.NET Project window displays various Web Templates, and based upon the selection of template, the necessary references will get added in the project. Checkboxes indicates the necessary folder structure and core references for the project.
    Step 3: Click on Change Authentication and the authentication provider windows will be displayed. There are four different authentication types that can be set for the application:

    1. No Authentication: The application does not require authentication.
    2. Individual User Accounts: SQL Server database is used to store user profile information. This authentication can also be extended to provide the end-user with the option to make use of their social profiles like Facebook, Google, Microsoft, Twitter or any other customized provider.
    3. Organizational Accounts: The application can authenticate users using the user profiles stored in Active Directory, Windows Azure Active Directory, or Office 365. This provides Single Sign-on access level to the application. The Organizational Accounts require the following details:
    ·         Cloud-Single Organization
    ·         Cloud-Multi Organization – This and the previous one can be used when the user authentication information is stored on the Windows Azure Activity Directory (WAAD)
    ·         On-Premises - Used for the Active Directory on-premises.
    ·         Domain - The WAAD domain for setting application in it.
    ·         Access Level - The application needs to query or update directory information.
    ·         Application ID URI - Created by appending the project name to the domain.
    4. Windows Authentication: Used for intranet applications.

    Attribute Routing

    The major difference in ASP.NET MVC and ASP.NET web forms is the way incoming requests are handled. In Web Forms, incoming requests map to a file or resource on the web server. For instance, the requested URL can be of the form www.abcd.com/xyz.aspx. Here, the URL refers to an ASP.NET Web Form named xyz.aspx, located at the root directory. There is a one-to-one mapping between the URL and the page that is accessed, which must physically reside on the server.
    On the other hand, MVC routing pattern maps URLs with action methods, resulting in cleaner and more SEO-friendly URLs (for instance, www.abcd.com/xyz/buy). This URL refers to the action method “buy” of the controller “xyz” on the domain “abcd”.


    To see where these routes are configured, go to the solution explorer of your ASP.NET MVC application and find App_Start folder and find the RouteConfig.cs file. It contains a method named RegisterRoutes which takes a collection of type RouteCollection as a parameter. Inside this method are routes that are to be ignored; routes that are to be added can be defined. This is shown in the following code snippet:
    public static void RegisterRoutes(RouteCollection routes){
       routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
       routes.MapRoute(
          name: "Default",
          url: "{controller}/{action}/{id}",
          defaults: new { controller = "Home", action = "Index", id = UrlParameter.Option }
          );
    }
    Apart from defining routes in the RouteConfig.cs file, ASP.NET MVC 5 has introduced a new feature known as attribute routing which allows developers to specify a route as an attribute of the action method. To enable attribute based routing, you need to modify the RegisterRoutes method of RouteConfig.cs file as follows:
    public static void RegisterRoutes(RouteCollection routes){
         routes.MapMvcAttributeRoutes();
    }
    To add a route on any action method, you simple have to add an attribute named Route and pass the route as parameter to it. For instance:
    [Route("Products/Sports/{id}")]
    public ActionResult GetSportsItems(string id){
          ViewBag.Id = id;
          return View();
    }


    Optional Parameter
    We can also specify if there is any optional parameter in the URL pattern defined by the Route attribute with the “?” character.
    [Route("Products/Sports/{id?}")]
    public ActionResult GetSportsItems(int? id){
          ViewBag.Id = id;
          return View();
    }
    Route Prefix & Route constraints
    If we have multiple action methods in a controller all using the same prefix we can use Route Prefix attribute on the controller instead of putting that prefix on every action method & We can also specify parameter constraints placing the constraint name after the parameter name separated by colon
     [RoutePrefix("Products")]
    [Route("Sports /{id:int}")]
    public ActionResult GetSportsItems(int? id){
          ViewBag.Id = id;
          return View();
    }

    Filter Overrides

    MVC 5 provides a filter overrides feature which we can apply to the action method or controller which selectively excludes the global filter or the controller filter for the specified action method or controller.
    Now if want to override our global action filter in one of our action method's then we just need to apply the OverrideActionFilters attribute. Below we have applied the attribute to the default About method in the HomeController.
    [OverrideActionFilters]      
     public ActionResult About(){          
     ViewBag.Message = "Your application description page.";        
     return View();   } 


    Courtesy: ASP.NET MVC 5 & several other online resources.