|
|
@ -2,10 +2,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
- [About](#about)
|
|
|
|
- [About](#about)
|
|
|
|
- [🗂️DCM](#dcm)
|
|
|
|
- [🗂️DCM](#dcm)
|
|
|
|
|
|
|
|
- [`Trainer`](#trainer)
|
|
|
|
|
|
|
|
- [`Pokemong`](#pokemong)
|
|
|
|
|
|
|
|
- [`Move`](#move)
|
|
|
|
|
|
|
|
- [`Type`](#type)
|
|
|
|
- [🧬UML Class diagram](#uml-class-diagram)
|
|
|
|
- [🧬UML Class diagram](#uml-class-diagram)
|
|
|
|
- [🗺NoSQL Schema Versioning Strategy](#nosql-schema-versioning-strategy)
|
|
|
|
- [🗺NoSQL Schema Versioning Strategy](#nosql-schema-versioning-strategy)
|
|
|
|
- [Schema Versioning Pattern](#schema-versioning-pattern)
|
|
|
|
- [Schema Versioning Pattern](#schema-versioning-pattern)
|
|
|
|
- [Incremental Document Migration](#incremental-document-migration)
|
|
|
|
- [Incremental Document Migration](#incremental-document-migration)
|
|
|
|
|
|
|
|
- [📇Indexes](#indexes)
|
|
|
|
- [🐕🦺Services](#services)
|
|
|
|
- [🐕🦺Services](#services)
|
|
|
|
- [🌺Special requests](#special-requests)
|
|
|
|
- [🌺Special requests](#special-requests)
|
|
|
|
- [`Pokemong` by nickname](#pokemong-by-nickname)
|
|
|
|
- [`Pokemong` by nickname](#pokemong-by-nickname)
|
|
|
@ -46,15 +51,21 @@ Let's cover the entities and relationships in this Data Concept Model:
|
|
|
|
These are the individuals who capture and train `pokemongs`. They can engage in battles with other `trainers.`
|
|
|
|
These are the individuals who capture and train `pokemongs`. They can engage in battles with other `trainers.`
|
|
|
|
|
|
|
|
|
|
|
|
* a `trainer` has fought between 0 and many `trainers`
|
|
|
|
* a `trainer` has fought between 0 and many `trainers`
|
|
|
|
|
|
|
|
* we will use *referencing*, since this is a reflexive relationship
|
|
|
|
* a `trainer` owns between 0 and many `pokemongs`
|
|
|
|
* a `trainer` owns between 0 and many `pokemongs`
|
|
|
|
|
|
|
|
* we will use *referencing with denormalizing*, since `pokemongs` have lifecycles of their own
|
|
|
|
|
|
|
|
|
|
|
|
#### `Pokemong`
|
|
|
|
#### `Pokemong`
|
|
|
|
|
|
|
|
|
|
|
|
These are the creatures that `trainers` capture and train. They can be trained or wild.
|
|
|
|
These are the creatures that `trainers` capture and train. They can be trained or wild.
|
|
|
|
|
|
|
|
|
|
|
|
* a `pokemong` is owned by 0 or 1 `trainer`
|
|
|
|
* a `pokemong` is owned by 0 or 1 `trainer`
|
|
|
|
|
|
|
|
* we will use *referencing*, since `trainers` have lifecycles of their own, but no denormalizing, since no queries
|
|
|
|
|
|
|
|
need that
|
|
|
|
* a `pokemong` has 1 or 2 `types`
|
|
|
|
* a `pokemong` has 1 or 2 `types`
|
|
|
|
* a `pokemong` knows between 0 and 4 `moves`,
|
|
|
|
* we will use *embedding*, since `types` don't have lifecycles of their own
|
|
|
|
|
|
|
|
* a `pokemong` knows between 0 and 4 `moves`
|
|
|
|
|
|
|
|
* we will use *referencing with denormalizing*, since `moves` have lifecycles of their own
|
|
|
|
|
|
|
|
|
|
|
|
#### `Move`
|
|
|
|
#### `Move`
|
|
|
|
|
|
|
|
|
|
|
@ -62,14 +73,18 @@ These are the abilities or actions that a `pokemong` can perform. This covers th
|
|
|
|
different `moves` can have different effects and powers depending on the type of the `pokemong` and the `move`.
|
|
|
|
different `moves` can have different effects and powers depending on the type of the `pokemong` and the `move`.
|
|
|
|
|
|
|
|
|
|
|
|
* a `move` can be known by between 0 and zillions of `pokemongs`
|
|
|
|
* a `move` can be known by between 0 and zillions of `pokemongs`
|
|
|
|
|
|
|
|
* we will let `pokemongs` refer to `moves`, and not the other way around
|
|
|
|
* a `move` has 1 and only 1 `type`
|
|
|
|
* a `move` has 1 and only 1 `type`
|
|
|
|
|
|
|
|
* we will use *embedding*, since `types` don't have lifecycles of their own
|
|
|
|
|
|
|
|
|
|
|
|
#### `Type`
|
|
|
|
#### `Type`
|
|
|
|
|
|
|
|
|
|
|
|
These define the elements or categories that a `pokemong` or a `move` can belong to.
|
|
|
|
These define the elements or categories that a `pokemong` or a `move` can belong to.
|
|
|
|
|
|
|
|
|
|
|
|
* a `type` can define between 0 and zillions of `pokemongs`
|
|
|
|
* a `type` can define between 0 and zillions of `pokemongs`
|
|
|
|
|
|
|
|
* see [`Pokemong`](#pokemong)
|
|
|
|
* a `type` can define between 0 and zillions of `moves`
|
|
|
|
* a `type` can define between 0 and zillions of `moves`
|
|
|
|
|
|
|
|
* see [`Move`](#move)
|
|
|
|
|
|
|
|
|
|
|
|
<img src="./docs/mcd.png" alt="Data Concept Model" title="Data Concept Model">
|
|
|
|
<img src="./docs/mcd.png" alt="Data Concept Model" title="Data Concept Model">
|
|
|
|
|
|
|
|
|
|
|
@ -195,6 +210,10 @@ allowing the schema migration to happen gradually over time.
|
|
|
|
|
|
|
|
|
|
|
|
However, note that this strategy increases write operations to the database, which could affect application performance.
|
|
|
|
However, note that this strategy increases write operations to the database, which could affect application performance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 📇Indexes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO pick it up here
|
|
|
|
|
|
|
|
|
|
|
|
### 🐕🦺Services
|
|
|
|
### 🐕🦺Services
|
|
|
|
|
|
|
|
|
|
|
|
Each entity (`Pokemong`, `Trainer`, `Move`) in the application has a corresponding service class. These service
|
|
|
|
Each entity (`Pokemong`, `Trainer`, `Move`) in the application has a corresponding service class. These service
|
|
|
|