简体   繁体   English

在以下情况下如何设计微服务:-

[英]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 :- 我必须使用Java-Spring启动使用微服务架构设计应用程序,该应用程序具有以下用例:-

  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 ) . (在RDBMS中,我们通常使用外键约束)。 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:根据您的要求,您可以创建以下微服务

  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) 答案2: 在“用户课程”表中,您可以存储用户信息以及课程信息(包括ID)

Answer 3: You can use mysql or mongodb or combination of this depends on your requirement. 答案3: 您可以使用mysql或mongodb,也可以结合使用这取决于您的要求。 If you will create 5 schema or will take 5 different database it would be good. 如果您要创建5个架构或采用5个不同的数据库,那就太好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在典型的微服务体系结构中,如何在微服务的单独的RDBMS数据库中链接相关数据? - How to link the related data in the separate RDBMS databases of the micro-services in a typical micro-services architecture? Zuul 不向其他微服务转发请求 - Zuul not forwarding requests to other micro-services 微服务项目中的Maven可传递依赖项 - Maven transitive dependencies in micro-services project App Engine中微服务的更好性能 - Better performance for Micro-services in App Engine springcloud多模块项目的服务模块如何调用其他微服务 - How the service module of springcloud multi-module project calls other micro-services Java Spring-boot 微服务异常处理 - Java Spring-boot micro-services Exception handling 减少微服务架构中假装调用的使用 - Reduce the use of feign calls in micro-services architecture 多个pods/微服务更新/插入同一条记录 - Multiple pods/micro-services update/insert the same record 内部微服务通信是否应该通过zuul网关? - Should internal micro-services communication goes through zuul gateway? 授权:动态组,基于权限的内容列表,基于微服务的架构? - Authorization with: dynamic groups, permission based content lists, micro-services based architecture?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM