Skip to content

4.1. Problem domain PD1

Haris Chaudhry Mendívil edited this page Jan 6, 2024 · 5 revisions

Location in code

./problem-domain-pd1/

Title

CRUD problem domain

Summary

This problem domain is going to be about a common set of API's that solve a typical set of CRUD operations over some sample topic like ecommerce, school organization or any other. It also has a DB solution which will be common to all backends.

Tags

CRUD, Sakila, MySQL, OpenAPI / Swagger

Choosing the DB solution

The DB should be a standalone solution not tied to any backend, also a lightweight one to enable rapid testing / prototyping.

  • MySQL running in docker

Location of sakila db:

./problem-domain-1/db/

Choosing the topic

We can start choosing the topic from a sample db in order to accelerate the process.

  • We could use a well-known one for testing like sakila

Sakila DB model

Here we can find some details about the sakila db schema and the entity diagram, the ER-diagram looks like the following.

sakila-ER-diagram

As we can see we have some clusters of common themes, we can choose one for our implementation.

  • For example, the 'Inventory' cluster

API specs

We can use the OpenAPI specification (yaml file) in order to define the required APIs that the backend solutios would implement. In this case, we are defining a set of endpoints for 'films' in sakila db (film table description).

Location in code:

./problem-domain-1/api/

Additionally, we could use the openAPI generator to generate server stubs as described here, for a Spring based Java app in this case.

Clone this wiki locally