The main link to page

From Expertiza_Wiki
Jump to navigation Jump to search

A Database is a coherent collection of data with inherent meaning. Random assortment of data is not a database. Data is organized in order to model relevant aspects of reality, so that it supports processes requiring this data. Data Migration is related to transfer of data between storage types, formats, or computer systems. This is performed programmatically to accomplish an automated migration so that humans are free from doing this repetitive task.

Content:

Database : A database is nothing more than a collection of meaningful information. Databases can be of multiple types, for example Distributed Databases, Relational Databases, Flat File Databases. A database could be as simple as a text file with a list of names or it can even be very complex as a large relational database management system 1. Banking Systems where accounts are maintained and it is made sure that money does not disappear as a result of system failure. 2. Airline Reservation Systems where the plane details, the airport details and the customer details are maintained. 3. Hotel Management Systems where the availability of rooms, the rates and the customer details are maintained.

(Figures: RDBMS of a Bank)


Every application in reality has a database in the backend to store all the relevant data of the application. We should not test the application on database because it may contain valuable data like customer information in a banking system. So editing that data present in the database is not a good idea. The solution Rails provides for above problem is Defining three different environments: Development, Production and Testing each of which has a separate database and appropriate database types. The Development Environment is what we use while developing the application. The production environment refers to the database that is used when the application is published in the real world. The testing environment is meant for testing tools. Testing of the application is done using Testing tools which automates the entire testing procedure. Since there are different databases in each environment, the problem that occurs is changes made in one Database do not reflect in the other.

The solution for the above problem is Database Migration. In reality Rails migrations are similar to version control of databases. Rails migrations is actually used since databases change requires modifications to both code and data. Hence we cannot use a source code version control system like Subversion or Sourcesafe. Databases of different types can also be migrated. for example, we may use SQLlite in Development environment, but we can still migrate into production environment where heroku may have been used. The source is portable and the backend understands what operations to do on the database