Skip to content

Commit 4bfbf05

Browse files
committed
docs: updating readme and fixing links
1 parent a4b51c1 commit 4bfbf05

File tree

1 file changed

+35
-72
lines changed

1 file changed

+35
-72
lines changed

README.md

Lines changed: 35 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ Using the `uids-postgres` extension for generating unique IDs in PostgreSQL offe
2121
The extension supports multiple methodologies for generating unique IDs, including UUID v6, UUID v7, NanoId, Ksuid, Ulid, Timeflake, PushId, and Cuid2. This flexibility allows you to choose the most suitable ID generation strategy for your specific use case, whether you need time-based IDs, lexicographically sortable IDs, or IDs with custom prefixes.
2222

2323
### 2. **Enhanced Data Integrity and Uniqueness**
24-
Using unique identifiers like UUIDs ensures data integrity and uniqueness across distributed systems. This is particularly important for applications that require federated data or need to avoid collisions in a multi-node environment [2].
24+
Using unique identifiers like UUIDs ensures data integrity and uniqueness across distributed systems. This is particularly important for applications that require federated data or need to avoid collisions in a multi-node environment.
2525

2626
### 3. **Performance and Efficiency**
27-
Generating unique IDs within the database can be more efficient than handling this in the application layer. This reduces the overhead of network communication and ensures that ID generation is consistent and centralized [1].
27+
Generating unique IDs within the database can be more efficient than handling this in the application layer. This reduces the overhead of network communication and ensures that ID generation is consistent and centralized.
2828

2929
### 4. **Ease of Use**
3030
The extension provides simple SQL functions to generate and validate various types of unique IDs. This makes it easy to integrate into existing SQL workflows without requiring significant changes to your application code.
3131

3232
### 5. **Compliance and Security**
33-
For applications that require compliance with data security standards, using IDs like UUIDs can help meet these requirements. The extension ensures that IDs are generated in a secure manner, reducing the risk of predictable or duplicate IDs [1].
33+
For applications that require compliance with data security standards, using IDs like UUIDs can help meet these requirements. The extension ensures that IDs are generated in a secure manner, reducing the risk of predictable or duplicate IDs.
3434

3535
### 6. **Community and Ecosystem**
36-
PostgreSQL has a rich ecosystem of extensions that enhance its capabilities. By using `uids-postgres`, you leverage the power of PostgreSQL's extensibility, allowing you to tailor your database to meet specific needs without altering its core architecture [4].
36+
PostgreSQL has a rich ecosystem of extensions that enhance its capabilities. By using `uids-postgres`, you leverage the power of PostgreSQL's extensibility, allowing you to tailor your database to meet specific needs without altering its core architecture.
3737

3838
### 7. **Scalability**
39-
Unique IDs like UUIDs and Ksuid are designed to be scalable and can handle large volumes of data efficiently. This is crucial for applications that need to maintain good performance as they grow to handle billions of rows [1].
39+
Unique IDs like UUIDs and Ksuid are designed to be scalable and can handle large volumes of data efficiently. This is crucial for applications that need to maintain good performance as they grow to handle billions of rows.
4040

4141
### 8. **Compatibility with Modern Applications**
42-
Many modern applications, especially those involving microservices, distributed systems, and IoT, benefit from using unique identifiers. The `uids-postgres` extension supports various ID types that are well-suited for these environments, ensuring compatibility and ease of integration [4].
42+
Many modern applications, especially those involving microservices, distributed systems, and IoT, benefit from using unique identifiers. The `uids-postgres` extension supports various ID types that are well-suited for these environments, ensuring compatibility and ease of integration.
4343

4444
By using the `uids-postgres` extension, you can enhance your PostgreSQL database with robust, flexible, and efficient unique ID generation capabilities, making it a valuable tool for a wide range of applications.
4545

@@ -51,16 +51,16 @@ Choosing ULID or TypeID/ etc over UUID can offer several advantages depending on
5151
### Advantages of ULID over UUID
5252

5353
1. **Lexicographical Sortability**
54-
- ULIDs are designed to be lexicographically sortable, which means they can be sorted in alphabetical order. This is particularly useful for databases and systems that need to quickly sort and search large numbers of identifiers [1][2].
54+
- ULIDs are designed to be lexicographically sortable, which means they can be sorted in alphabetical order. This is particularly useful for databases and systems that need to quickly sort and search large numbers of identifiers.
5555

5656
2. **Faster Generation**
57-
- ULIDs use a cryptographically secure pseudorandom number generator (CSPRNG) for the random component, which is faster than the method used for generating UUIDs. Benchmarks have shown that ULID generation can be up to 50% faster than UUID generation, making them suitable for high-volume environments [1].
57+
- ULIDs use a cryptographically secure pseudorandom number generator (CSPRNG) for the random component, which is faster than the method used for generating UUIDs. Benchmarks have shown that ULID generation can be up to 50% faster than UUID generation, making them suitable for high-volume environments.
5858

5959
3. **Compactness and URL-Safety**
60-
- ULIDs are more compact, requiring only 26 characters compared to UUIDs' 36 characters. They are also URL-safe, meaning they can be used in URLs without the need for encoding or escaping, which is beneficial for web applications and APIs [1][2].
60+
- ULIDs are more compact, requiring only 26 characters compared to UUIDs' 36 characters. They are also URL-safe, meaning they can be used in URLs without the need for encoding or escaping, which is beneficial for web applications and APIs.
6161

6262
4. **Timestamp Encoding**
63-
- ULIDs include a timestamp component, which allows them to be sorted by creation order. This feature is useful for tracking the order of events in distributed systems and for data partitioning and indexing in NoSQL databases [2].
63+
- ULIDs include a timestamp component, which allows them to be sorted by creation order. This feature is useful for tracking the order of events in distributed systems and for data partitioning and indexing in NoSQL databases.
6464

6565
### Advantages of TypeID over UUID
6666

@@ -73,10 +73,10 @@ Choosing ULID or TypeID/ etc over UUID can offer several advantages depending on
7373
### When to Use UUID
7474

7575
1. **Cryptographic Security**
76-
- If your application requires identifiers that are truly random and have no predictable pattern, such as for cryptographic or security purposes, UUIDs are a better choice. ULIDs, by design, are not intended to be cryptographically secure and should not be used for sensitive applications [1].
76+
- If your application requires identifiers that are truly random and have no predictable pattern, such as for cryptographic or security purposes, UUIDs are a better choice. ULIDs, by design, are not intended to be cryptographically secure and should not be used for sensitive applications.
7777

7878
2. **Standardization**
79-
- UUIDs are standardized by RFC 4122, which means they are widely supported and recognized across different systems and platforms. This can be important when working with vendors or integrating with third-party systems [2].
79+
- UUIDs are standardized by RFC 4122, which means they are widely supported and recognized across different systems and platforms. This can be important when working with vendors or integrating with third-party systems.
8080

8181
### Summary
8282

@@ -156,41 +156,10 @@ This Postgres extension is made possible thanks to [`pgrx`][pgrx].
156156

157157
## Installation
158158

159-
Use [pgrx][https://github.com/pgcentralfoundation/pgrx]. You can clone this repo and install this extension locally by following [this guide](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#installing-your-extension-locally).
159+
Use [pgrx](https://github.com/pgcentralfoundation/pgrx). You can clone this repo and install this extension locally by following [this guide](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#installing-your-extension-locally).
160160

161161
You can also download relevant files from [releases](https://github.com/spa5k/uids-postgres/releases) page.
162162

163-
164-
### Non-Docker Environment
165-
166-
1. **Install Rust via rustup:**
167-
168-
```bash
169-
curl https://sh.rustup.rs -sSf | sh
170-
```
171-
172-
2. **Prepare your PostgreSQL installation.**
173-
174-
3. **Install pgx:**
175-
176-
```bash
177-
cargo install cargo-pgx
178-
```
179-
180-
4. **Initialize pgx for your PostgreSQL version:**
181-
182-
```bash
183-
cargo pgx init --pg14 $(which pg_config)
184-
```
185-
186-
5. **Clone the repository and install the extension:**
187-
188-
```bash
189-
git clone https://github.com/spa5k/uids-postgres
190-
cd uids-postgres
191-
cargo pgx install
192-
```
193-
194163
### Docker Environment
195164

196165
Refer to the included [Dockerfile](./docker/Dockerfile) for the installation template.
@@ -528,31 +497,25 @@ This setup provides a comprehensive set of functions to generate and validate va
528497

529498

530499
### References
531-
- [1] Timescale Blog: Top 8 PostgreSQL Extensions
532-
- [2] Stack Overflow: What is uuid-ossp in Postgres
533-
- [4] Dev.to: Exploring PostgreSQL Extensions
534-
- [5] Medium: UUID vs ULID, How ULID improves write speeds
535-
- [6] Solwey: IDs: Integer Vs UUID Vs ULID
536-
537-
Citations:
538-
- [1] https://www.timescale.com/blog/top-8-postgresql-extensions/
539-
- [2] https://stackoverflow.com/questions/21709800/what-is-uuid-ossp-in-postgres
540-
- [3] https://www.reddit.com/r/PostgreSQL/comments/mi78aq/any_significant_performance_disadvantage_to_using/
541-
- [4] https://dev.to/nilelazarus/exploring-postgresql-extensions-enhance-your-database-capabilities-576o
542-
- [5] https://github.com/fboulnois/pg_uuidv7
543-
- [6] https://www.postgresql.org/docs/current/uuid-ossp.html
544-
- [7] https://dba.stackexchange.com/questions/102448/how-should-i-index-a-uuid-in-postgres
545-
- [8] https://pganalyze.com/blog/5mins-postgres-uuid-vs-serial-primary-keys
546-
- [9] https://news.ycombinator.com/item?id=36429986
547-
- [10] https://www.postgresql.org/docs/current/extend-extensions.html
548-
- [11] https://medium.com/@sammaingi5/uuid-vs-ulid-how-ulid-improves-write-speeds-d16b23505458
549-
- [12] https://www.solwey.com/posts/ids-integer-vs-uuid-vs-ulid
550-
- [13] https://news.ycombinator.com/item?id=40016413
551-
- [14] https://www.reddit.com/r/programming/comments/1ckklm9/why_choose_ulids_over_traditional_uuids_or_ids/
552-
- [15] https://www.linkedin.com/pulse/should-i-use-uuid-ulid-unique-ids-systems-pablo-puma-ihdoc
553-
- [16] https://dev.to/0xfedev/the-uniquity-chronicles-exploring-the-cosmos-of-unique-id-algorithms-31d6
554-
- [17] https://blog.hassam.dev/ulid-uuid-integer-ids/
555-
- [18] https://github.com/jetify-com/typeid
556-
- [19] https://stackoverflow.com/questions/59919519/mysql-is-an-unique-index-necessary-on-a-uuid-column
557-
558-
> In recent additions to this project, the new ids, and the dockerfile were taken from (pgx_ulid)[https://github.com/pksunkara/pgx_ulid], alongside some help from (pg_idkit)[https://github.com/VADOSWARE/pg_idkit].
500+
- [Timescale Blog: Top 8 PostgreSQL Extensions](https://www.timescale.com/blog/top-8-postgresql-extensions/)
501+
- [Stack Overflow: What is uuid-ossp in Postgres](https://stackoverflow.com/questions/21709800/what-is-uuid-ossp-in-postgres)
502+
- [Dev.to: Exploring PostgreSQL Extensions](https://dev.to/nilelazarus/exploring-postgresql-extensions-enhance-your-database-capabilities-576o)
503+
- [Medium: UUID vs ULID, How ULID improves write speeds](https://medium.com/@sammaingi5/uuid-vs-ulid-how-ulid-improves-write-speeds-d16b23505458)
504+
- [Solwey: IDs: Integer Vs UUID Vs ULID](https://www.solwey.com/posts/ids-integer-vs-uuid-vs-ulid)
505+
- https://github.com/fboulnois/pg_uuidv7
506+
- https://www.postgresql.org/docs/current/uuid-ossp.html
507+
- https://dba.stackexchange.com/questions/102448/how-should-i-index-a-uuid-in-postgres
508+
- https://pganalyze.com/blog/5mins-postgres-uuid-vs-serial-primary-keys
509+
- https://news.ycombinator.com/item?id=36429986
510+
- https://www.postgresql.org/docs/current/extend-extensions.html
511+
- https://medium.com/@sammaingi5/uuid-vs-ulid-how-ulid-improves-write-speeds-d16b23505458
512+
- https://www.solwey.com/posts/ids-integer-vs-uuid-vs-ulid
513+
- https://news.ycombinator.com/item?id=40016413
514+
- https://www.reddit.com/r/programming/comments/1ckklm9/why_choose_ulids_over_traditional_uuids_or_ids/
515+
- https://www.linkedin.com/pulse/should-i-use-uuid-ulid-unique-ids-systems-pablo-puma-ihdoc
516+
- https://dev.to/0xfedev/the-uniquity-chronicles-exploring-the-cosmos-of-unique-id-algorithms-31d6
517+
- https://blog.hassam.dev/ulid-uuid-integer-ids/
518+
- https://github.com/jetify-com/typeid
519+
- https://stackoverflow.com/questions/59919519/mysql-is-an-unique-index-necessary-on-a-uuid-column
520+
521+
> In recent additions to this project, the new ids, and the dockerfile were taken from [pgx_ulid](https://github.com/pksunkara/pgx_ulid), alongside some help from [pg_idkit](https://github.com/VADOSWARE/pg_idkit).

0 commit comments

Comments
 (0)