Skip to content

Commit

Permalink
Merge pull request #13 from tonybka/enhancement/tonybka/edit-readme-2…
Browse files Browse the repository at this point in the history
…0230415

Update README.md
  • Loading branch information
tonybka authored Apr 14, 2023
2 parents 02a1134 + ca59005 commit bd7b5e9
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Fundamental elements of DDD implementation in Golang microservice


# Components
## Application Layer
- DTOs, Mapper & Presenter
- Request handlers
- Event handlers
- Message Publisher
## Domain Layer
### Entity
- Mutable, has identity
Expand All @@ -16,18 +21,3 @@ Fundamental elements of DDD implementation in Golang microservice
## Persistence Layer
- Data Model
- Repository


# Q&A
## Why UUIDv1 for entity's identity?
### Reasons (short)
- Need to have random, unique identity values for entities
- To decouple domain layer from persistence layer, we should not use table row's id for entity's identity
- MySQL support storing UUIDv1 as BINARY(16) in database which saves storage space
- Comparing UUIDv1 values is faster than comparing values of the other versions (they have common dash-separated groups if they are generated on a same machine)

### References
- [Making UUIDs More Performant in MySQL](https://emmer.dev/blog/making-uuids-more-performant-in-mysql/)
- [Storing UUID Values in MySQL Tables](https://dev.mysql.com/blog-archive/storing-uuid-values-in-mysql-tables/)
- [GUID/UUID Performance Breakthrough](http://mysql.rjweb.org/doc.php/uuid)
- [Storing UUID Values in MySQL](https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/)

0 comments on commit bd7b5e9

Please sign in to comment.