Sunteți pe pagina 1din 3

A database engine

(or "storage engine") is the underlying software com ponent that a

database m anagement system (DBMS) uses to create, read, update and delete (CRUD) data from a database. Most database m anagement systems include their own application programming interface (API) that allows the user to interact with their underlying engine without going through the user interface of the DBMS. Many of the m odern DBMS support multiple database engines within the sam e database. For example, MySQL supports InnoDB as well as MyISAM.

MyISAM was the default storage engine for the MySQL relational database managem ent
system versions prior to 5.5 . It is based on the older ISAM code but has many useful extensions. The major deficiency of MyISAM is the absence of transactions support. Versions of MySQL 5.5 and greater have switched to the InnoDB engine to ensure referential integrity constraints, and higher concurrency.

InnoDB is the default storage engine for MySQL as of MySQL 5.5. It provides the
standard ACID-compliant transaction features, along with foreign key support (Declarative Referential Integrity). It is included as standard in most binaries distributed by MySQL AB, the exception being some OEM versions. A TRANSACTION comprises a unit of work performed within a database managem ent system (or similar system) against a database, and treated in a coherent and reliable way independent of other transactions. Transactions in a database environm ent have two main purposes: To provide reliable units of work that allow correct recovery from failures and keep a database consistent even in cases of system failure, when execution stops (completely or partially) and many operations upon a database remain uncompleted, with unclear status. To provide isolation between programs accessing a database concurrently. If this isolation is not provided the programs outcom e are possibly erroneous. A database transaction, by definition, must be atomic, consistent, isolated and durable. Database practitioners often refer to these properties of database transactions using the acronym ACID. Transactions provide an "all-or-nothing" proposition, stating that each work-unit performed in a database m ust either complete in its entirety or have no effect whatsoever. Further, the system must isolate each transaction from other transactions, results must conform to existing constraints in the database, and transactions that complete successfully m ust get written to durable storage.

A 'TRANSACTIONAL connectivity loss).

DATABASE is a DBMS where write transactions on the

database are able to be rolled back if they are not com pleted properly (e.g. due to power or Most modern relational database management systems fall into the category of databases that support transactions. In a database system a transaction might consist of one or more data-manipulation statem ents and queries, each reading and/or writing information in the database. Users of database systems consider consistency and integrity of data as highly important. A sim ple transaction is usually issued to the database system in a language like SQL wrapped in a transaction, using a pattern sim ilar to the following: Begin the transaction Execute a set of data m anipulations and/or queries If no errors occur then commit the transaction and end it If errors occur then rollback the transaction and end it

The 2 m ajor types of table storage engines for MySQL databases are InnoDB and MyISAM. To summarize the differences of features and performance, 1. InnoDB is newer while MyISAM is older. 2. InnoDB is more complex while MyISAM is simpler. 3. InnoDB is more strict in data integrity while MyISAM is loose. 4. InnoDB implements row-level lock for inserting and updating while MyISAM implementstable-level lock. 5. InnoDB has transactions while MyISAM does not. 6. InnoDB has foreign ke ys and relationship contraints while MyISAM does not. 7. InnoDB has better crash recovery while MyISAM is poor at recovering data integrity at system crashes. 8. MyISAM has full-text search index while InnoDB has not. In light of these differences, InnoDB and MyISAM have their unique advantages and disadvantages against each other. They each are m ore suitable in some scenarios than the other.

Advantages of InnoDB
1. InnoDB should be used where data integrity comes a priority because it inherently takes care of them by the help of relationship constraints and transactions.

2. Faster in write-intensive (inserts, updates) tables because it utilizes row-level locking and only hold up changes to the same row thats being inserted or updated .

Disadvantages of InnoDB
1. Because InnoDB has to take care of the different relationships between tables, database adm inistrator and scheme creators have to take more time in designing the data models which are more complex than those of MyISAM. 2. Consumes more syste m resources such as RAM. As a matter of fact, it is recommended by many that InnoDB engine be turned off if theres no substantial need for it after installation of MySQL. 3. No full-text indexing.

Advantages of MyISAM
1. Simpler to design and create, thus better for beginners. No worries about the foreign relationships between tables. 2. Faster than InnoDB on the whole as a result of the simpler structure thus m uch less costs of server resources. 3. Full-te xt indexing. 4. Especially good for read-intensive (select) tables.

Disadvantages of MyISAM
1. No data integrity (e.g. relationship constraints) check, which then comes a responsibility and overhead of the database administrators and application developers. 2. Doesnt support transactions which is essential in critical data applications such as that of banking. 3. Slower than InnoDB for tables that are frequently being inserted to or updated, because the entire table is locked for any insert or update. The comparison is pretty straightforward. InnoDB is more suitable for data critical situations that require frequent inserts and updates. MyISAM, on the other hand, performs better with applications that dont quite depend on the data integrity and mostly just select and display the data.

S-ar putea să vă placă și