跟进什么VHF指出,春季启动另一方面,包含对各种 Web 框架和其他 Web 技术的出色支持。看这里:
-
开发网络应用程序: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-developing-web-applications https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-developing-web-applications
-
WebSockets: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-websockets https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-websockets
-
网页服务: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-webservices https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-webservices
另外,客户端:
-
使用 RestTemplate 调用 REST 服务: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-resttemplate https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-resttemplate
-
使用 WebClient 调用 REST 服务: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-webclient https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-webclient
大多数这些引导功能都可以通过“方便地提供”Starters":
https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-starters https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-starters
在典型的 Apache Geode 应用程序架构中,开发人员将像设计任何以数据库为中心的应用程序一样,使用客户端/服务器拓扑 https://geode.apache.org/docs/guide/19/topologies_and_comm/cs_configuration/chapter_overview.html.
那么在这种安排下,春季启动应用程序将是“客户端”,使用ClientCache实例 https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/client/ClientCache.html, which Apache Geode 的 Spring Boot(SBDG) 为您提供 OOTB(参见here https://docs.spring.io/spring-boot-data-geode-build/1.2.x/reference/html5/#geode-clientcache-applications)。服务器端将严格由后端数据存储(即 Apache Geode 服务器)组成,用于缓存、分布式计算、事件流处理,甚至充当应用程序的记录系统(SOR),坚持不懈。服务器集群不会提供任何 Web 视图、数据或其他服务。
Apache Geode 集群确实公开了某些 Web 服务(例如开发人员 REST API https://geode.apache.org/docs/guide/19/rest_apps/book_intro.html),但这是为了在客户端上使用不同的技术(Spring/Java、JavaScript 等)构建各种 Web 客户端。
因此,应用程序架构的所有面向用户的组件都应该驻留在客户端,例如在 1 个或多个春季启动Web 应用程序访问后端 Apache Geode 集群((数据/持久应用程序状态维护)服务器)。
当然,这只是推荐的最佳实践,您可以自由选择,但请记住,客户端和服务器具有非常不同的资源需求,考虑到 JVM 堆管理的变幻莫测,通常不建议将两者混合使用,除其他事项外(例如服务请求(具有不同的有效负载)、频率或请求等等)。
希望这可以帮助!