What are the differences between MyISAM and InnoDB?

July 2nd, 2010

Wait… hold on. Firstly, what are MyISAM and InnoDB?

MyISAM and InnoDB are the two commonly used MySQL engines for database tables. MyISAM is the default database engine for new tables created in MySQL 4 and 5.

So, why would I want to use one over the other?

Good question. Perhaps it is best answered by going through the differences between the two database engines.

  1. InnoDB is a more modern database engine than MyISAM, so some could say MyISAM is more reliable due to this, although there is very little evidence to support this.
  2. However! Even though InnoDB is newer, it has much better error recovery. Corrupt tables are (with all hope) quickly restored to a functional state when the  InnoDB engine is in use, however recovery of MyISAM powered tables is significantly slower and less reliable. Corrupt MyISAM tables have been known to hold up the starts and restarts of the MySQL daemon.
  3. InnoDB supports foreign keys natively, meaning you can enforce referential integrity at a database level rather than ensuring integrity at the application level.
  4. Insertions and updates in InnoDB utilise row level locking, whilst MyISAM only supports full table locking. This means that mass inserts and updates, MyISAM table access can become significantly slowed down as MySQL has to wait for the database engine to release the lock on the table caused by the insert or update. InnoDB defaults to locking only the rows which are affected by the insert or update query, meaning the rest of the table can still be accessed without waiting for a lock release.
  5. MyISAM supports full-text indexing. This means MyISAM tables can have text fields indexed, which significantly increasing SELECT queries which contain text type fields. The InnoDB table has no support for full-text indexing.

It looks like there is no clear winner?

You’re right. Even though InnoDB is, as said, much more modern, both database engines still have their place in modern database structures. In fact, your choice should be dependant on how you anticipate the table will be used.

So, when would I want to use an InnoDB table?

If data integrity is important to you, multiple related InnoDB tables inherently take care of the data integrity between tables due to their support of foreign keys and enforcement of referencial integrity. Additionally, if your table will be used for intensive write operations (inserts and updates) the InnoDB engine can handle this much better than MyISAM, due to row level locking.

InnoDB does fall down however in the fact that it does utilise more memory than MyISAM and as previously mentioned it lacks full text indexing.

InnoDB sounds great. What need do I have for the MyISAM engine?

You don’t need to deal with referential integrity or building DBMS enforced relationships between tables with MyISAM, simply because the engine does not support it. One could argue this makes MyISAM tables quicker to create and useful for smaller, quicker tasks as well as initial system prototyping.

MyISAM also tends to be faster at many operations, especially large scale SELECT queries returned many results. For tables which will be used mainly for data retrieval with less in the way or inserts or updates, the performance of MyISAM may be a deciding factor. As well as this generalised speed, the MyISAM engine supports full-text indexing, which would be useful for large tables that contain textual data that needs to be fully searched and/or sorted on a regularly basis.

Okay. So, which would you suggest? Give me a quick summary.

InnoDB should be chosen where data is written reguarly and data integrity and security is critical.

MyISAM is the best choice for tables in which there is large amounts of data, especially textual data, that is read from significantly more than written to.

Thanks!

No problem. :)

HTML 5 Content Tags

May 28th, 2010

HTML 5 introduces several new tags which focus of defining the content of a page in a machine readable fashion.

In today’s websites, if a computer program attempts to pick out a particular part of a page, such as the main article, the sidebar or the top navigation, it would have difficulty. This is because every website structures its HTML differently, and most modern websites use <p>, <div> and <span> tags to surround their content. These tags generally define style. The new HTML 5 tags define content.

Defining content makes websites easier to parse by computer programs. This could benefit accessibility readers for the blind and allow content aggregating systems and ‘mash-up’ websites to easily parse, link to and cite your articles.

Here is a list of some of the HTML 5 tags that define content.

  • <article> – Defines a main article on a page. Can include cite (citation) and pubdate (publishing date) attributes.
  • <details> – States content details for a specific section. Can include an open attribute defining whether or not the details within are visible to the end-user.
  • <figcaption> – States the caption for a figure as defined by the figure tag.
  • <figure> – Usually used to group a set of elements.
  • <footer> – Footer layout element. This is used to contain the footer content of the page, usually contains the website name, author and copyright information.
  • <header> – Header layout element. This tag is designed to contain the top header of a document, usually showing the website logo, page and/or company title and subtitle.
  • <hgroup> – A tag used to group together heading tags such as <h1>, <h2>, <h3> and so on.
  • <keygen> – A key generation tag which defines a generated (encryption) key that can be associated with a HTML form.
  • <meter> – The <meter> tag contains content which is deemed to be a measurement of some sort.
  • <nav> – The <nav> tags stands for navigation and is designed to surround navigation links, such as those present in a sidebar bar or navigational header/footer.
  • <summary> – The <summary> tag defines the title of a <details> element.
  • <time> – This tags contains content which is a statement or measurement of time and/or date/time.

More information about HTML 5 tags is available from W3Schools. See the HTML 5 Tag Reference for more details on these tags and the other new tags in HTML 5.

The Nudge (beta)

May 18th, 2010

The Nudge logo

The Nudge lets you exchange and manage brief reviews with people you know on everything that’s happening in your City, and beyond.

Let your starting point in choosing anything (from a hotel in San Francisco or a restaurant in London, to a new book or a concert in New York) be the reviews of people you know, whose opinion you trust.

The Nudge is also launching weekly City Editions for London and New York. These can be accessed through the site or subscribed to via email and will combine our favourite member recommendations with some insider knowledge of what’s new and happening in your City each week.

The Nudge will launch over the summer of 2010. If you’d like to be involved as one of the first to have access to the beta version of the site, please let us know by subscribing below.”

Rapid Web is proud to be working with The Nudge, to create a new social networking abstraction, which focuses on the recommendation of consumer products and services, dependant upon a well defined and focused network of local social knowledge.

The Nudge teaser site is now live and contains a custom made web design, a themed blog system and other dynamic contact, such as a form to allow users to sign up for the up and coming beta.

If you are interested in what The Nudge will have to offer in the future, take a look at the new blog post on The Nudge Blog, ‘Why Subscribe to Join the Nudge?‘.

To apply for The Nudge beta, just head to thenudge.com and fill in the ‘Apply for the beta’ form.

Body Sculpt Gravitational Training

April 29th, 2010

Rapid Web is pleased to announce the recent redesign of a long term client’s website, Body Sculpt UK.

The new web design of Body Sculpt UK features an entirely custom web design, templating and integration into both existing and brand new textual content. The new website design also features the use of a dynamic blog system to go alongside the static content of the main site. Links also exist to various social networking and social media websites such as Facebook and Twitter allowing easy promotion of the the Body Sculpt brand.

Body Sculpt UK have been working with us at Rapid Web for several years now, and we are delighted to see them continue to work with us into the new development of their brand and website.

If you’re interested in getting a new web design for your website, feel free to give us a call on 01785 250222 or contact us directly.

Nokia releases first open-source Symbian device

April 28th, 2010

Nokia N8I previously posted on how Nokia open-sourced the Symbian mobile operating system and the advantages this will bring to mobile web developers. Nokia has now released their first mobile device based on the open-source version of Symbian, the Nokia N8 phone.

It is the first version of the software since the Symbian foundation announced that it had made its code open source in February.

The Foundation – which includes Nokia, Motorola and Samsung amongst others – gave away the code to developers for free in the hope that it would help speed up the pace of improvements. Any organisation or individual can now use and modify it.

The software in the N8 allows the phone to have multi-touch and multi-tasking, meaning more than one application can be open at any one time.

The device will be Nokia’s flagship smartphone. It can be plugged into home theatres and supports surround sound as well as high-quality video.

Social networks, such as Twitter and Facebook, can be displayed on the home screen in a single application.

Lee Williams, executive director of the Symbian Foundation, said he was “stoked” that Nokia had chosen to use the operating system on its phone.

BBC News article

The Nokia N8 will ship in the third quarter of this year, 2010. Hopefully the improved software will bring advantages both for its end-users, and the software ‘app’ and web application developers.