Most commonly used engines (MS SQL Server, Oracle, DB2, MySQL, etc.) will not experience noticeable problems using a surrogate key system. Some may even experience increased productivity from using a surrogate, but performance issues are very platform specific.
In general terms, the natural key (and, in addition, the complex key) verses of the surrogate key debate has a long history without a visible “right answer”.
Arguments for natural keys (singular or compound) usually include the following:
1) They are already available in the data model. Most objects that are modeled already include one or more attributes or attribute combinations that meet the needs of the key in order to create relationships. Adding an additional attribute to each table involves unnecessary redundancy.
2) They eliminate the need for certain associations. For example, if you have customers with customer codes and invoices with account numbers (both of which are “natural”), and you want to retrieve all the account numbers for a specific customer code, you can simply use "SELECT InvoiceNumber FROM Invoice WHERE CustomerCode = 'XYZ123'" . In a classic surrogate key approach, SQL would look something like this: "SELECT Invoice.InvoiceNumber FROM Invoice INNER JOIN Customer ON Invoice.CustomerID = Customer.CustomerID WHERE Customer.CustomerCode = 'XYZ123'" .
3) They contribute to a more universally applicable approach to data modeling. With natural keys, the same design can be used largely unchanged between different SQL engines. Many surrogate key approaches use specific SQL engine methods to generate keys, which requires more specialization of the data model for implementation on different platforms.
Surrogate key arguments tend to revolve around SQL-specific issues:
1) They make it easier to change attributes when changing business requirements / rules. This is because they allow you to isolate data attributes to a single table. This is primarily a problem for SQL engines that inefficiently implement standard SQL constructs such as DOMAIN. When an attribute is defined by the DOMAIN statement, changes to the attribute can be made in the general schema using the ALTER DOMAIN statement. Different SQL engines have different performance characteristics for changing a domain, and some SQL modules do not implement DOMAINS at all, so data modeling compensates for these situations by adding surrogate keys to improve the ability to make changes to attributes.
2) They make it easier to implement concurrency than natural keys. . In the case of the natural key, if two users simultaneously work with the same information set, such as a client line and one user changes the value of the natural key, then updating the second user will fail, because the client code that they update is no longer exists in the database. In the surrogate key case, the update will be successfully processed, because immutable identifier values ​​are used to identify rows in the database, and not mutable client codes. However, it is not always advisable to allow the second update - if the client code has changed, it is possible that the second user is not allowed to continue changing them, because the actual "identifier" of the line has changed - the second user may update the wrong line. Neither surrogate keys nor natural keys alone solve this problem. End-to-end concurrency solutions need to be addressed outside of the key implementation.
3) They work better than natural ones. Performance is most dependent on the SQL engine. The same database schema, implemented on the same hardware using different SQL mechanisms, often has dramatically different performance characteristics, thanks to the mechanisms for storing and retrieving SQL data. Some SQL modules come close to flat file systems, where data is actually stored redundantly when the same attribute, such as client code, is displayed in several places in the database schema. This redundant storage using the SQL engine can cause performance problems when you need to make changes to the data or schema. Other SQL engines provide a better separation between the data model and the storage / retrieval system, which allows for faster data and schema changes.
4) Surrogate keys work better with certain data access libraries and graphical interfaces. Due to the homogeneity of most surrogate key constructs (for example, all relational keys are integers), data access libraries, ORMs, and graphical interfaces can work with information without requiring special knowledge of the data. Natural keys due to their heterogeneity (different data types, size, etc.) Do not work also with automated or semi-automatic tools and libraries. For specialized scenarios, such as embedded SQL databases, creating a database with a specific set of tools may be appropriate. In other scenarios, databases are enterprise information resources that are simultaneously accessible by several platforms, applications, reporting systems, and devices and therefore do not work when they are concentrated on a particular library or structure. In addition, databases designed to work with specific tools become responsibility when the next great toolkit is introduced.
I tend to fall on the side of natural keys (obviously), but I'm not fanatical. Due to the environment in which I work, where any particular database that I help with development can be used by various applications, I use natural keys for most data modeling models and rarely make surrogates. However, I'm not going to try my best to repurpose existing databases that use surrogates. Surrogate systems work very well - no need to change something that already works well.
There are several excellent resources that discuss the merits of each approach:
http://www.google.com/search?q=natural+key+surrogate+key
http://www.agiledata.org/essays/keys.html
http://www.informationweek.com/news/software/bi/201806814