Skip to main content
toptal-blog-image

MySQL Master-Slave Replication on the Same Machine

MySQL replication is a process that enables data from one MySQL database server (the master) to be copied automatically to one or more MySQL database servers (the slaves). It is usually used to spread read access on multiple servers for scalability, although it can also be used for other purposes such as for failover, or analyzing data on the slave in order not to overload the master. (more…)

php-elephant

PHP Best Practices and Tips

This resource contains a collection of the best PHP practices and PHP tips provided by our Toptal network members. As such, this page will be updated on a regular basis to include additional information and cover emerging PHP techniques. This is a community driven project, so you are encouraged to contribute as well, and we are counting on your feedback. (more…)

toptal-blog-1_C

SQL Database Performance Tuning for Developers

Database tuning can be an incredibly difficult task, particularly when working with large-scale data where even the most minor change can have a dramatic (positive or negative) impact on performance.

In mid-sized and large companies, most SQL database tuning will be handled by a Database Administrator (DBA). But believe me, there are plenty of developers out there who have to perform DBA-like tasks. Further, in many of the companies I’ve seen that do have DBAs, they often struggle to work well with developers—the positions simply require different modes of problem solving, which can lead to disagreement among coworkers. (more…)

php-elephant

Installation PHP5-FPM with Apache 2 in Ubuntu 14.04/10, 15.04/10

PHP FPM

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

These features include:

  • Adaptive process spawning (NEW!)
  • Basic statistics (ala Apache’s mod_status) (NEW!)
  • Advanced process management with graceful stop/start
  • Ability to start workers with different uid/gid/chroot/environment and different php.ini (replaces safe_mode)
  • Stdout & stderr logging
  • Emergency restart in case of accidental opcode cache destruction
  • Accelerated upload support
  • Support for a “slowlog”
  • Enhancements to FastCGI, such as fastcgi_finish_request() – a special function to finish request & flush all data while continuing to do something time-consuming (video converting, stats processing, etc.)

(more…)

mysql-no-password

MySQL Command line login with inline password & Executing SQL Statements

Login with inline password in command line

Normally we don’t need to use inline password to login or we don’t do that. But sometimes it is a must when you need to login from a bash script or when we need to execute some SQL Statements from bash script or run them in a cron. If you check MySQL manual they have just included the simple command :

mysql --host=localhost --user=myname --password=mypass mydb

Or

mysql -h localhost -u myname -pmypass mydb

(more…)

Zend is the leading PHP Web Application Platform. (PRNewsFoto/Zend Technologies)

Using Zend Server’s PHP for Command line (CLI) in Ubuntu 14.10

By default when you install Zend Server, it does not allow to use PHP directly from command line though the configured PHP applications work with web server (Apache or nginx). Try:

$ php -v

It will ask you to install PHP separately.

Solution

Though you can install another PHP and use it for all command line scripts but there is a quick work around to use Zend Server’s PHP itself.

(more…)

pma-logo

Using phpmyadmin for multiple local and remote MySQL Servers

Normally we need a client software to access MySQL server whether it is remote server or local. Most of the developers who use MySQL as back end database use phpmyadmin which is a web application. But when it comes to access the remote database, we use different client applications. MySQL Workbench is the official MySQL Client application/software which does pretty much good job for most of the cases. That’s why I think most of the developers choose this. In Windows I used to use SQLYog which is not yet free. (more…)