Author: Manuel Lemos
Last month viewers: 13
Categories: PHP Tutorials, Notable Packages
Therefore, they may use multiple servers to still respond to many Web requests very quickly.
Read this article and watch a short video that is included to learn how use a good GUID generator to handle better the accesses of many users using multiple Web servers and storing database records in database servers that may be running in different machines.
If you want to know more about what is a GUID, why do you need to GUIDs and and how you can use them in PHP, keep watching this short tutorial video or continue reading the article below.
What Are GUID numbers?
GUID means Globally Unique Identifier. GUIDs are 128 bit numbers represented as strings that are used as unique identifiers, for instance to distinguish different records stored in a database table.
Why you need to use GUIDs?
When you use a single database server, it is usual to use an integer number as primary key to locate database records.
Often you use auto-increment fields to assure that each table record has a unique value, so the record can be quickly located by the database server.
However, when your application grows and you start using multiple database servers to handle the load caused by the accesses of multiple simultaneous users, using auto-increment fields may not be a suitable solution.
What may happen is that different database servers may want to try to use the same key value for the next records to be inserted in the tables when there are multiple simultaneous users performing actions that may require adding new records to the same tables.
This may cause database server locks that slow down the applications that access those database tables.
One possible solution for this problem is to use GUIDs generated by the application as primary keys for the database tables.
How You Can Use GUID numbers in PHP?
This package can generate GUIDs using that COM object on Windows. It falls back to use a pure PHP based solution to generate GUIDs when the package is running on non-Windows systems, like Linux for instance
This way you can implement Web applications that are more scalable.
This package can run well on multiple systems by using a GUID generator approach that takes advantage of the operating system resources that are available in your server environment.
About the PHP GUID Generator Package
The basic purpose is: Generate a globally unique identifier string
Here follows in more detail what it does:
This class can generate a globally unique identifier string.
The class can check if the MicroSoft Windows COM extension function com_create_guid exists and use it to generate a GUID string that represents an 128 bit number.
If the com_create_guid does not exist, the package can generate a GUID string using pure PHP functions available in all platforms.
This package was considered notable for implementing its benefits in a way that is worth noticing.
Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.
If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.
One nice prize that many PHP developers want and you may like is the PHP elePHPant mascot plush.
You need to be a registered user or login to post a comment
Login Immediately with your account on:
No comments were submitted yet.