Saturday, July 1, 2017

[Theory] Software craftsmanship Part 1 - Parallel vs united sequential vision

In the series of posts I am going to show important conceptual points for software development.
Part 1 - Parallel vs united sequential vision
Part 2 - Microservices
Part 3 - Deployment pipeline
---------------------------

The whole purpose of a software application is to provide valuable services to its consumers. These valuable services can be constructed from features.

In such a way every backwards-compatible change to the application can be one of the next points:
1) adding a new feature (technical or business request)
2) fixing a bug for the previously added feature

If the modification is not done in a backwards-compatible manner then we can think about the software as a new application. This idea is supported by semantic versioningMAJOR.MINOR.PATCH

The software from a consumer point of view is seen as a presentation of parallel and independent feature blocks:
On the other side coding corresponds to text, and text updating is a sequential operation: some symbols are replaced, some are added, removed or just moved across the text. In addition to this the code from the small "Feature a" often intersects with the small "Feature b" without having strong separation. Thus coding leads to the united and sequential picture of a software, where every bit is appended to the end of a common block: We can think of it as a process of book writing, with all the chapters and the references between its different parts. The idea of a simultaneous text editing by several authors is a source of lots of problems. Let us specify our first problem

Contradiction (1)
As a writer I would like to change a piece of a text without affecting other editors of the same text.

Contradiction (1 strengthen)
As a writer I need to apply changes to a text that is no longer exist (moved, changed or removed).
A text should be changed and should not be changed.

The simple solution is to apply golden Divide and Conquer method and totally eliminate simultaneous editing problem.

Solution (1)
Divide text blocks in such a manner that every writer has its own independent part. 
Books are often divided by chapters where there is no more than one author per chapter.
Applications can be divided in the same manner with a developer being assigned to support a specific software library. Removing the multi-user editing mode can be also done by usage of small services, for example, when one developer is responsible for a bunch of related cloud functions.



Files renaming, moving files across the project, spacious code refactoring, all these steps lead to later painful code merging. If Solution 1 is not accessible then there are some weak solutions, which do not solve the problem but minimize its pain.

Weak solution (1a)
Divide people in small groups, so the teams can provide autonomous and independent deployable services. This approach is called usage of Microservices. We can minimize the impact of a huge sharable code base by presenting small groups of people, which manage small independent micro projects with small code bases. Also the team becomes primarily responsible for the service business logic and will have deeper understanding of the processes than large teams do.

As long as a code merging is inevitable we also can reduce the pain of conflicts resolving by minimizing applied changes.
Weak solution (1b)
The team can make a rule: to commit only small changes to sharable code base and do it often, at least every day. Thus the developers will have only small merge conflicts, which must be simple to resolve.

This weak solution actually leads us to a new contradiction
Contradiction (2)
As a developer sometimes I work on a large task during several days. 
As a developer I have to make small commits to the common code base at least every day, so the other developers can simply merge my changes.
In other words: changes should be large and be applied rarely, changes should be small and be applied often.

Solution (2)
Wrap large changes in a switchable toggle. Make this toggle 'off' by default. Commit small changes to the common code base for the disabled feature. Simply enable the feature when it is ready.
This is a very common principle in software building, which is called Feature Toggle. Now a developer is able to do small and often changes to a common code base.



Sometimes there is a need to do a breaking change that affects a large group of people. For example, a change in the logging library that is used across the whole application; or take, for instance, a field renaming in a live database. If we check the problem carefully then the contradiction is the same as the contradiction (1):
Contradiction (3)
A part of something should be changed and at the same time should not be changed.

One of the solution is to make long-lasting switch to a new breakable change. I call this principle 3-phase switching:
Solution (3)
1) Create the enhanced version of the block. If there is a sharable state (database, cache, external API) then the new version should also support the old state presentation. 
2) Allow or force clients to switch to the new version of the block during some time.

3) Stay with the new version and remove the old block; or stay with the old solution (rollback).
For example, if a developer makes a breakable change in the logging library like method renaming or drastically change method parameters, then he or she can create a new class (a new library) based on the old one. So there will be two blocks: the old one and the new one. The consumers can slowly switch to the new library.

The concept of 3-phase switching is very powerful and is used widely in different aspects:
  • Canary release, which is a process of rolling up a new software to a small group of users and checking whether it works as expected, thus not affecting all customers by a big bang of failure. Rolling up is slowly moving: [10% of customers redirected to the new software, 90% to the old], [20% to new, 80% to the old], ..., [100% to the new software].
  • Beta release or a release for private groups, beta testers. 
  • A-B testing
  • Green/Blue deployment
  • Feature toggle (related)
  • Software package lifecycle: npm, pypi, nuget, ruby gems, php composer and others.

Let's take another example with a table field renaming in a relational database. The process might look as:

1) Add the new field with a proper name to the table.
2) Create a new endpoint for clients (API) in such a manner that data is written to both: the new and the old field. Wait for clients being switched to the new version.
Due the fact that the new API writes data in compatible way to the old field, clients that are using the old field are not affected at all.

3) When there are no more clients using the old API then simply remove it with the old field. Finally there will be only new renamed field.

26 comments:

  1. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.
    Packers And Movers in Chennai

    ReplyDelete
  2. The best movers and packers in Hyderabad will pack your goods with ultimate care to prevent damages while shifting. They use good quality packing material and different methods of packing for various household items. Furniture, appliances, AC, and other such goods that require dismantling is done with proper guidelines before wrapping, and delicate pieces are handled with special attention.
    Please Visit Our Website : http://www.goyalcargomovers.in

    ReplyDelete
  3. If you are new user to sage 50 accounting software and looking for the sage 50 technical support.If yes than you have come to right place as we provide efficient technical support service to customers who show complete faith in us. With our efficient and highly qualified team ,we never disappoint our customers.You can reach us at 1844-871-6289 at any hour of the day. You can also visit our website at https://www.accountingadvice.co/ for the complete knowledge of the sage products and services.


    The Services we offered are following-

    Sage Support Phone Number

    Sage 50 Technical Support

    Sage Technical Support Phone Number

    Sage 100 support phone number

    Sage 100 contractor support

    Sage 50 live chat

    Sage Support Number

    Sage Customer Service Number

    Sage Support Phone Number

    ReplyDelete
  4. If you are new user to sage 50 accounting software and looking for the sage 50 technical support.If yes than you have come to right place as we provide efficient technical support service to customers who show complete faith in us. With our efficient and highly qualified team ,we never disappoint our customers.You can reach us at 1800-961-4623 at any hour of the day. You can also visit our website at https://www.helplinenumber.support/ for the complete knowledge of the sage products and services.

    The Services we offered are following-

    Sage 50 2019 has stopped working

    Sage 50 customer service number

    Sage 50 Technical support number

    Sage 100 Technical support phone number

    Sage 200c Tech support phone number

    Sage fixed assets support number

    Sage 50 customer service number

    Sage 50 support

    Sage 300 Tech Support Number

    ReplyDelete
  5. BuisnessSeattle.us is pretty much known for its best business wide-range solutions for accounting, bookkeeping, business consulting, income tax, and payroll. It helps to easily manage all business operations with cloud-based applications and automated accounting software as well. This makes it easier to handle all business complexities related to accounting activity and easily tracks the financial information to gain the profit as well as you can save time. Moreover, it also provides you 24*7 Technical Support for any further queries or issues.

    ReplyDelete
  6. QuickBooks Desktop often fails to link successfully to the internet, which causes QuickBooks Error 12002 while updating.QuickBooks users may lead to QuickBooks Error 12002 when QB is unable to utilize the internet connection. Have you ever encountered errors while updating QuickBooks or QuickBooks not Working?

    ReplyDelete
  7. We feel satisfied to helping you, and you are consistently welcome here for fixing your undesirable issue on this stage. Error code 1772 and comparative introduce errors may happen at Run-time, and in this manner they are called Run-time Errors, and it is basic to investigate. QuickBooks Error 1772 is a run-time error. This implies when you working with the product, it is conceivable that the screen freeze for a couple of moments, and so on.

    ReplyDelete
  8. When we are talking about QuickBooks Error 6000 82 first question is that why and how this error code occurs. QuickBooks must be updated to the latest release and you can install QuickBooks file doctor tool before proceeding with the solutions. The error message reads: ‘Warning: An error occurred when QuickBooks Desktop tried to access the company file. Please try again. If the problem persists, contact Intuit Technical Support.’ This error is commonly referred to QuickBooks Desktop Error 6000. QuickBooks Error 6000 82 indicates the message, An error occurred when trying to open up the company filer or An error occurred.

    ReplyDelete
  9. The problem has now been resolved after several attempts at altering the registry and installing new installer software etc. This will get the error linked with the “MSIEXEC. EXE” category of the data file. Getting Sage 50 Error 1719 with encounters an error message displaying “The Windows Installer Service could not be accessed”. Sage 50 software or uninstalling. Some users face sage error 1719 with the” MSIEXEC.

    ReplyDelete
  10. While updating payroll and maintenance release, however, the software encounters. Here is the instant solution for you to get rid of your QuickBooks error 15215. Maintenance Release QuickBooks update error. The another reason for occurring this error might be a conflict with another application running in the background when you try to download a payroll update. We can help you solve even the most complex accounting related issues in the least possible time.

    ReplyDelete
  11. QuickBooks can be caused by a damaged Microsoft Windows Installer or due to damaged QuickBooks Desktop installation. QuickBooks installation or your QuickBooks Desktop File Copy Service (FCS) is disabled. It can also be seen due to incorrectly configured system settings or irregular entries in the windows registry. Are you facing QuickBooks payroll update error 15241? then learn the best solution to Fix QuickBooks error 15241 occurs when you try to download an update for payroll or QuickBooks desktop. Whilst the error happens.

    ReplyDelete

  12. Lovely Website, Maintain the fantastic work. Thank you so much!
    Local Packers and Movers Mumbai list, Cheap Packers Movers Mumbai Charges, Affordable, Best Household Shifting Mumbai @ Packers and Movers mumbai

    ReplyDelete
  13. The Packers And Movers Ahmedabad are expert in their work. They offer top-notch and door-to-door moving services for your home, office, domestic, national or vehicle transportation. We have experience to handle and execute all types of relocation services. @ Packers and Movers Ahmedabad

    ReplyDelete
  14. Get Packers and Movers Jaipur List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Jaipur Price Quotation instantly and Save Cost and Time. Packers and Movers Jaipur ✔✔✔Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @ Packers And Movers Jaipur

    ReplyDelete
  15. Choose the Best King Size Pillow this 2021 Who in this world would not like to live like a king? We as a whole wish to carry on with our lives king size. Then why not buy a mattress or even a pillow king size? At whatever point we purchase another sleeping pillow we pay it off the best quality and furthermore remember that it ought to be of King size. However, fail to remember the main segment that gives us continuous sleep. We as a whole frequently disregard or overlook the size of pillows when getting one.

    ReplyDelete
  16. Do you have a great day except ending the day with QuickBooks error 6000 83. It can be very heart-breaking when you loose data because of these bugs inside QuickBooks. We are here to help you, just visit us and take our assistance. or Visit us to know more, and get assisted by our expert team.

    ReplyDelete
  17. QuickBooks Error Code 6000 is an error experienced by users when they are trying to open a company file. QuickBooks Error code 6000 -832 is a 6000 series error code that exists predominantly due to company file corruption. QuickBooks Error 6000 Desktop Error system once the user tries to open, restore and take backup of the company files.

    ReplyDelete
  18. How would I set up email, either through an email application like Outlook, or through Webmail in Sage 50? In the event that you will be you utilizing Sage 50 through terminal administrations or a distant work area program, you should introduce the email program on the host PC and set it as the default email program there. Assuming you are setting up either a Gmail or a Yahoo account, Email Setup and Settings on Sage 50 you will likewise need to arrange the record in the record settings of those applications to 'permit less secure applications. Assuming you are utilizing Microsoft Outlook, when you attempt to email records from Sage Accounts or Sage 50 Payroll one of the accompanying messages might show up.

    You can make fill-in variants of Forms W-2 and W-3 for documenting with SSA. You may likewise print out duplicates for documenting with state or neighborhood legislatures, dissemination to your representatives, and for your records. Step by step instructions to Print Sage W2 Forms in Sage 50. Click on the current year W-2/W-3 tax document in the Payroll Tax Form Selector window. Print Sage 50 W2 Forms proposition business the executives, finance, accounting, charge planning, advance planning, and so on.

    ReplyDelete