Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Database storage engines

714 views

Published on

database storage engines, transactional tables, storage engine types, innodb, myisam

Published in: Education
  • Be the first to comment

Database storage engines

  1. 1. Database Storage Engines Sarmad Soomro Hidaya ID: 6672
  2. 2. Contents • Storage Engine • DBMS and Database Engines • Types • Storage Engines • Usage • Pros & Cons
  3. 3. Storage Engine • A storage engine is a software module that a database management system uses to create, read, update (CRUD) data from a database. • MySQL supports several storage engines that act as handlers for different table types
  4. 4. Database Storage Engines • Database Storage Engines are categorized into two types of Tables: • Transactional Tables • While executing a query if a failure occurs, system crash, DBMS error or hardware problem these tables will auto recover the data. • Non Transactional • These tables does not auto recover .
  5. 5. Some of the Storage Engines • MyISAM (Indexed Sequential Access Method) • MEMORY • ARCHIEVE • InnoDB • BLACKHOLE • CSV
  6. 6. MyISAM • Pros: • Default Storage Engine for MySQL 5.5 and earlier • High speed storage and retrieval • Can lock the entire table • Switch everything to offline processing without taking down to database • Cons: • Does not supports transactional tables • Storage Limit 256TB • No save points • Does not supports the Foreign Key Constraint
  7. 7. MEMORY (formerly called HEAP Engine) • Stores all data in RAM for extremely fast access • Creates tables in memory • Memory storage engine is ideal for creating temporary tables or quick lookups. • The data is lost when the database is restarted. • It does not support transactions.
  8. 8. ARCHIEVE • Provides the perfect solution for storing and retrieving large amounts of seldom (rarely) historical, archived, or security audit information. • It compresses data as it is inserted
  9. 9. InnoDB • InnoDB is the most widely used storage engine with transaction support. • It supports row-level locking. • crash recovery. • It is the only engine which provides foreign key referential integrity constraint.
  10. 10. Blackhole • The Blackhole storage engine accepts but does not store data. Retrievals always return an empty set. The functionality can be used in distributed database design where data is automatically replicated, but not stored locally. This storage engine can be used to perform performance tests or other testing. • Anything you write/insert into table it just disappears and while fetching record it returns an empty set.
  11. 11. CSV • The CSV storage engine stores data in text files using comma- separated values format. • Stores data in CSV files. It provides great flexibility, because data in this format is easily integrated into other applications. • You can use the CSV engine to easily exchange data between other software and applications that can import and export in CSV format.
  12. 12. Comparison of Storage Engines
  13. 13. Specifying and Altering the Engines • `SHOW ENGINES` command used to list down all the Storage Engines supported by MySQL. • `SHOW VARIABLES` command used to list down all the variables and their default values as in php.ini • SHOW VARIABLES • LIKE 'storage_engine‘; command used to see the default storage engine of MySQL
  14. 14. To find the DB Engine of table: • mysql> SELECT ENGINE FROM information_schema.TABLES • -> WHERE TABLE_SCHEMA='mydb' • -> AND TABLE_NAME=‘table'; (this query does not worked in my MySQL, taken from internet) • +--------+ • | ENGINE | • +--------+ • | InnoDB | • +--------+
  15. 15. Altering the Engine • mysql> ALTER TABLE table ENGINE='MyISAM'; • mysql> SELECT ENGINE FROM information_schema.TABLES • -> WHERE TABLE_SCHEMA='mydb' • -> AND TABLE_NAME=‘table'; • +--------+ • | ENGINE | • +--------+ • | MyISAM | • +--------+
  16. 16. Conclusion: • MySQL provides several different storage engines. Some perform best under certain conditions and perform worse in other situations. • Whenever we are dealing with some payment systems, We cannot afford to loose such sensitive data. InnoDB is Best. • If we want full-text search, than we must choose MyISAM. • When you are dealing with database for testing purpose Memory is for you. • And just like that so on,, according to your need…
  17. 17. References • http://zetcode.com/databases/mysqltutorial/storageengines/ • https://dev.mysql.com/doc/refman/5.1/en/storage-engine-compare- transactions.html • http://www.slideshare.net/Compare2011/mysql-and-db-engines • http://www.slideshare.net/prkart/mysql-storage-engines-16271655 • https://www.cs.duke.edu/csl/docs/mysql-refman/storage-engines.html • https://answers.yahoo.com/question/index?qid=20071221140205AAw5Ur G • http://dba.stackexchange.com/questions/17246/diff-in-transactional- and-non-transactional-tables
  18. 18. Thanks  QUESTIONS/SUGGESTIONS ??

×