Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting

Posts Tagged ‘mysql’

Cloud database


2013
Feb 02

Everyone should hear the word “cloud” for recent years. most people should try the cloud storage like box.net, dropbox, etc. Few people may even try the cloud hosting.

Since cloud is popular nowadays and even database, it become a cloud solution. For a web architecture, the most time consumption process is the database and image generation.

To improve the performance, using CDN for images is one of the solution.

To improve the reliability without downtime, web server could choose cloud service plan.

To further improve the back-end performance, you may even consider cloud database solution.

However, each cloud solution is like that, you have to pick up one primary data-center. To reduce the latency, you have to choose the right data-center for your solution, otherwise the performance may not be improved.

several vendors for Mysql Cloud:
Rackspace Cloud databases
Amazon Relational Database Service
Google Cloud SQL
xeround mysql cloud
cleardb mysql cloud

google cloud mysql would still be free until June 2013. if you really want to try the performance of the mysql cloud, you may try xeround and cleardb, they provided free service below:
xeround: DB Size: 10MB, Connections: up to 5
cleardb: DB Size: up to 5MB, Connections: 10

since the connections is limited, you may not use it for production web site, you may just use it for testing purpose.

capitalize each first letter through MySQL


2011
Mar 25

if you want to capitalize each first letter through MySQL, you can write a function, and write SQL directly to update the column, here is the sample code:

DELIMITER $$
CREATE FUNCTION CAP_FIRST_CHAR (input VARCHAR(255))
RETURNS VARCHAR(255)
BEGIN
DECLARE length INT;
DECLARE i INT;

SET length = CHAR_LENGTH(input);
SET input = LOWER(input);
SET i = 0;

WHILE (i < length) DO
IF (MID(input,i,1) = ‘ ‘ OR i = 0) THEN
IF (i < length) THEN
SET input = CONCAT(LEFT(input,i),UPPER(MID(input,i + 1,1)),RIGHT(input,length – i – 1));
END IF;
END IF;
SET i = i + 1;
END WHILE;

RETURN input;
END$$
DELIMITER ;
update table set table_col=CAP_FIRST_CHAR(table_col);