Harshad Gare

IT Engineer

Full Stack Web Developer

WordPress Developer

SEO Analyst

Freelancer

Harshad Gare

IT Engineer

Full Stack Web Developer

WordPress Developer

SEO Analyst

Freelancer

Blog Post

What is InnoDB and what are the differences to other engines?

November 28, 2020 Databases
What is InnoDB and what are the differences to other engines?

The database systems MySQL and MariaSB are currently the most widespread standard for databases on websites. However, they only define the way in which the system saves the data – as relational tables that are created in accordance with fixed criteria. For the direct handling of the databases and their manipulation, however, MySQL and MariaDB use an external storage subsystem (engine), which represents the interface between the database management system (DBMS) and the information. The InnoDB storage engine has been doing this for both of them for several years.

What is the job of an engine like InnoDB?

The actual task of InnoDB and other storage subsystems is to form an additional intermediate layer (layer) between the software responsible for administration and the stored information. This is used, for example, to administer the accesses, to block data records and to coordinate parallel calls or write processes from different sources. In this context, the DBMS in the form of MySQL or MariaDB merely forms the framework that defines the structure of the data and the type of syntax for commands. This then transfers the tasks including the data to InnoDB or another engine, which maintains direct handling of the data.

What is behind the separation between MySQL and InnoDB?

By using a fixed system with different storage engines, MySQL and MariaDB have a flexibility that could not be achieved with a fixed integration. In abstract terms, InnoDB and other engines take on the role of plug-ins, which allow a modular structure for the core functions of the database server. This separation also facilitates the maintenance and optimization of the source code, since the integration of storage subsystems from external providers allows all resources to be concentrated on the further development of MySQL or MariaDB. InnoDB originally came from the Finnish company Innobase Oy, which the software group fully integrated into its own structure in the course of the following years after its takeover in 2005. Most of the database server does not support the innodb storage engine.

What advantages does InnoDB have over other engines?

Up to version 5.0, MySQL relied on MyISAM (My Indexed Sequential Access Method) as the storage subsystem, but abandoned this as the standard in favor of InnoDB. Most content management systems (CMS) and shop software also use InnodDB as a standard, but many plug-ins still rely on MyISAM. This difference in preference is primarily due to the specific characteristics of the two engines. InnoDB features include:

  • Access only locks a column (row) with a data record instead of a table
  • Secure access through transactions
  • Transactions can be canceled and revoked before the end (rollback)
  • Integrated options for creating and importing backups
  • Automatic write lock for other transactions during write access / li]
  • Recovery of databases after a crash
  • Fast SELECT access (reading of data)
  • Foreign key support for security and integrity of transactions

In contrast, MyISAM have the following properties:

  • Integrated search for full text
  • No support for referential integrity
  • Access to databases in single steps instead of bundled transactions
  • No control of the databases for consistency and completeness of the accesses
  • Fast INSERT and UPDATE accesses (reading data)
  • Efficient use of memory in RAM and on the hard drive

The fact that InnoDB requires significantly longer access times when writing data is due to the strict control of the databases for their consistency. In contrast to Myisam vs Innodb monitors every access until it has been successfully written to memory or a file. MyISAM, on the other hand, only issues an instruction and leaves control of changes exclusively to the operating system.

What is difference between Innodb and Myisam?

Just like the decision for Linux versus macOS or Windows, or vice versa, this decision depends heavily on what preferences you have at the moment. Both storage engines have their advantages and depending on what is needed, MyISAM (My Indexed Sequential Access Method) or InnoDB (Innobase Oy Inc.) is used. With the knowledge of the advantages and disadvantages of both MySQL storage engines, you have a good basis for making decisions about the use in each case.

Find below is the difference between myisam and innodb:

ISAM = Indexed Sequential Access Method and is essentially a flat file (for those DBAs who can remember Btrieve or B-Tree). It’s a very old technology – but don’t let that stop you from using it. Since it is a flat file (more on that later), it is not a relational file and is therefore not an RDBMS. In some situations this is also more appropriate.

InnoDB is the full RDBMS that you are probably familiar with. MyISAM can appear relational by adding another layer that maintains your links, logic, and referential integrity.

ISAM is great when you have a lot of records (say 20 million) and most of the records are self-contained (i.e. you don’t have to create many links to get the related data). It is VERY reliant on indices. If you don’t have the right index, be prepared for very long query times. Case in point, we had a Btrieve ISAM table with over 20 million records, and the retrieval and filtering of data based on an accurate index was almost instantaneous. Using the wrong index was literally 15 minutes.

InnoDB is ideal when you have a lot of relational links. Table A references a field in Table B that references Tables C and D. InnoDB can retrieve these records using all kinds of useful join methods (hash joins, etc), whereas an ISAM database would have to run multiple subqueries for each one, manually arranging and matching the records.

How can databases be assigned to a specific engine like InnoDB?

Working with databases is rarely done manually – if such interventions should be necessary, comfortable web interfaces such as phpMyAdmin are recommended for this purpose . The rule is that this is done via the PHP extension MySQLi (MySQL Improved) – since version 7.0 the programming language no longer supports its earlier version MySQL. The simplest variant is to specify the storage subsystem with the ENGINE = option when creating databases. A subsequent conversion is also possible by executing the following command in MySQL, by MySQLi or in phpMyAdmin:

ALTER TABLE name ENGINE=innodb/myisam;

However, a conversion goes hand in hand with the risk of data loss and mixed operation between InnoDB and other engines is only recommended to a limited extent.

Alternatives to InnoDB are Redis , InfluxDB and MySQLi .

Taggs:
Write a comment