Which database can safely use the GUID as the primary key besides SQL Server?

The reason I want to use Guid is because when I need to partition the database, I will not have primary keys that overlap in both databases. Therefore, if I use Guid, there will be no overlap. I also want to use the GUID in the url, so Guid needs to be indexed.

I will use ASP.NET C # as my web server.

+3
source share
9 answers

As others have said, you can use a GUID / UUID in almost any modern database. The GUID generation algorithm is pretty simple, and you can be pretty sure you won’t cheat, but there are some considerations.

+) Although the GUIDs are usually 128 bit values, the actual format used is different from implementation to implementation β€” you may want to normalize them by removing non-essential characters (usually dashes or spaces).

+) To ensure uniqueness, you can also add a value to guid. For example, if you are worried that MS and Oracle are facing conflicts, add β€œMS” to the former and β€œOr” to the latter β€” now, even if the guides themselves collide, their keys will not.

, , : (128 ) ( ).

( , ), , , .

, , - . , , :

1) , . , , , , . .

2) "" , ( ). , , (, ).

( ) .

- , - DB - , , . .

. , , ..

, , , , , a) b) ( , ). , " + ".

+5

Postgres UUID. MySQL UUID. Oracle SYS_GUID.

+12

RDBMS, , PK. , GUID CHAR (n) n, . , , , CHARs , .

, .

+3

, GUID int128.

mySQL, postgres, , GUID ( , UUID, ).

+1

, 3 + ints GUID UUID . ints/GUIDS/UUIDS , .

, , , .

, , , , GUID ( ) . , - .

0

, . , .

google " " .

0

SQLite. Guid .Net SQLite . .

, , , / / SQL Server.

0

, , MS SQL ASP.net, , , , Google :

MySQL

MySQL 2

SqlLite

0

If you are using other MS technologies already, you should consider Sql Server Express. http://www.microsoft.com/express/sql/default.aspx This is a real implementation of MS Sql Server, and it is free. This has significant limitations, as you can imagine, but if your product can fit inside those you get support from, the developer community and Sql Server stability and a clear upgrade path if you need to grow.

0
source

Source: https://habr.com/ru/post/1716738/


All Articles