简体   繁体   中英

How to design micro-services in the below scenario :-

I have to design an application using micro services architecture using Java-Spring boot which has the below use cases :-

  1. The user should be able create account in the portal.
  2. User should be able to view / browse the online educational courses and add the courses to shopping cart.
  3. The user should be able to buy the courses by doing an online payment.
  4. The user should be able to view / play the courses which he/she has purchased.

Queries :-

  1. How many micro services should be created and what will be those?
  2. How do we relate the data so that we can map which user has purchased which courses? ( In RDBMS we usually we use a foreign key constraint ) . How is data usually related in such scenarios using micro services architecture?
  3. Which database will be suitable for such architecture and how many data stores will be there?

Request you all to be as specific as possible in the solution.

Answer1: As per your Requirement you can create following micro services

  1. Registration
  2. Login
  3. Education Courses
  4. Shopping Cart
  5. User Courses

Answer2: In User Courses table you can store User info as well as course info(both Id's)

Answer 3: You can use mysql or mongodb or combination of this depends on your requirement. If you will create 5 schema or will take 5 different database it would be good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM