0
8.0kviews
What is code migration? What are the reasons for migrating the Code?

Subject :- Data Structures

Topic :- Processes

Difficulty :- Medium

1 Answer
2
524views


Code Migration :-

  • Code migration is the movement of programming code from one system to another. There are three distinct levels of code migration with increasing complexity, cost and risk. Simple migration involves the movement from language to a newer version. A second, more complicated level of migration involves moving to a different programming language. Migrating to an entirely new platform or operating system is the most complex type of migration.

  • The first type of code migration is a simple movement from one version of a language to a newer, but syntactically different version. This is the easiest of migration routes as the basic structure and much of the programming constructs usually do not change. In many cases, the old code would actually work, but new and improved routines or modularization can be improved by retooling the code to fit the nature of the new language. Therefore migrating the code would lead to more efficiency in execution.

  • The second level of code migration would be migrating to a completely different programming language. This could be caused by porting to a new software system or implementing a different relational database management system (RDMS). This type of migration often requires that programmers learn an entirely new language, or new programmers be brought in to assist with the migration. In this case, the entire program must be rewritten from the ground up. Even though most of the constructs are likely to exist in both languages, the precise syntax is usually completely different.

  • The most complex example of code migration is migrating to an entirely new platform and/or operating system (OS). This not only changes the programming language, but also the machine code behind the language. While most modern programming languages shield the programmer from this low level code, knowledge of the OS and how it operates is essential to producing code that is efficient and executes as expected.



Reasons for Migrating Code :-

  • Traditionally, code migration in distributed systems took place in the form of process migration in which an entire process was moved from one machine to another. Moving a running process to a different machine is a costly and intricate task, and there had better be a good reason for doing so. That reason has always been performance. The basic idea is that overall system performance can be improved if processes are moved from heavily-loaded to lightly-loaded machines.

  • Load is often expressed in terms of the CPU queue length or CPU utilization, but other performance indicators are used as well. Load distribution algorithms by which decisions are made concerning the allocation and redistribution of tasks with respect to a set of processors, play an important role in compute-intensive systems. However, in many modern distributed systems, optimizing computing capacity is less an issue than, for example, trying to minimize communication. Moreover, due to the heterogeneity of the underlying platforms and computer networks, performance improvement through code migration is often based on qualitative reasoning instead of mathematical models.

  • Consider, for example, a client-server system in which the server manages a huge database. If a client application needs to do many database operations involving large quantities of data, it may be better to ship part of the client application to the server and send only the results across the network. Otherwise, the network may be swamped with the transfer of data from the server to the client. In this case, code migration is based on the assumption that it generally makes sense to process data close to where those data reside.

  • This same reason can be used for migrating parts of the server to the client. For example, in many interactive database applications, clients need to fill in forms that are subsequently translated into a series of database operations. Processing the form at the client side, and sending only the completed form to the server, can sometimes avoid that a relatively large number of small messages need to cross the network. The result is that the client perceives better performance, while at the same time the server spends less time on form processing and communication.

  • Support for code migration can also help improve performance by exploiting parallelism, but without the usual intricacies related to parallel programming. A typical example is searching for information in the Web. It is relatively simple to implement a search query in the form of a small mobile program that moves from site to site. By making several copies of such a program, and sending each off to different sites, we may be able to achieve a linear speed-up compared to using just a single program instance

Please log in to add an answer.