background preloader

DBA

Facebook Twitter

Top 20+ MySQL Best Practices. Database operations often tend to be the main bottleneck for most web applications today.

Top 20+ MySQL Best Practices

It's not only the DBA's (database administrators) that have to worry about these performance issues. We as programmers need to do our part by structuring tables properly, writing optimized queries and better code. In this article, I'll list some MySQL optimization techniques for programmers. Before we start, be aware that you can find a ton of useful MySQL scripts and utilities on Envato Market. Most MySQL servers have query caching enabled.

The main problem is, it is so easy and hidden from the programmer, most of us tend to ignore it. The reason query cache does not work in the first line is the usage of the CURDATE() function. Using the EXPLAIN keyword can give you insight on what MySQL is doing to execute your query. The results of an EXPLAIN query will show you which indexes are being utilized, how the table is being scanned and sorted etc... After adding the index to the group_id field: What is ACID (atomicity, consistency, isolation, and durability)? - Definition from WhatIs.com. Database House Wants You to Stop Dropping ACID. Nick Lavezzo, Dave Rosenthal, and Dave Scherer — the founders of FoundationDB.

Database House Wants You to Stop Dropping ACID

Photo: FoundationDB NoSQL databases have made it possible to store more data faster and cheaper than ever before. Web giants like Google, Amazon and Facebook have come to depend on them in a big way. But they have some fundamental drawbacks that prevent them from handling many software applications. And FoundationDB wants to change that. FoundationDB is the company behind the new proprietary database of the same name, and it claims to offer the performance benefits of NoSQL without many of the well-known trade-offs.

The NoSQL movement grew out of papers published in 2006 and 2007 by Amazon and Google that described data storage systems distributed across hundreds or even thousands of cheap servers. ACID stands for “atomicity, consistency, isolation, durability.” Relational databases have followed this model for years. Not that it was easy. Still, it could have a tough road ahead. The ACID Model. The ACID model is one of the oldest and most important concepts of database theory.

The ACID Model

It sets forward four goals that every database management system must strive to achieve: atomicity, consistency, isolation and durability. No database that fails to meet any of these four goals can be considered reliable. ACID. Set of properties (atomicity, consistency, isolation, durability) of database transactions intended to guarantee validity even in the event of errors, power failures, etc.

ACID

According to Gray and Reuter, IMS supported ACID transactions as early as 1973 (although the term ACID came later).[3] Characteristics[edit] The characteristics of these four properties as defined by Reuter and Härder are as follows: Atomicity[edit] An example of an atomic transaction is a monetary transfer from bank account A to account B.

Consistency[edit] Isolation[edit] Durability[edit] Examples[edit] The following examples further illustrate the ACID properties. CREATE TABLE acidtest (A INTEGER, B INTEGER, CHECK (A + B = 100)); Atomicity[edit] Atomicity is the guarantee that series of database operations in an atomic transaction will either all occur (a successful operation), or none will occur (an unsuccessful operation). Consistency failure[edit] Isolation failure[edit] Combined, there are four actions: Implementation[edit] Mapeo objeto-relacional. El problema[editar] Implementaciones[editar] Los tipos de bases de datos usados mayoritariamente son las bases de datos SQL, cuya aparición precedió al crecimiento de la programación orientada a objetos en los 1990s.

Mapeo objeto-relacional

Las bases de datos SQL usan una serie de tablas para organizar datos.