For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Web
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
https://maven.apache.org/download.cgi Update POM with pacakage Jar and plugins for maven In Plugins do compile and then jar Copy from target to root path, then type:
mvn install:install-file -Dfile=target/OnlineShopping-1.0.jar -DgroupId=com.qiuzhitech -DartifactId=OnlineShopping -Dversion=1.1 -Dpackaging=jar
- 异步化处理数据。Asynchronous data processing.
- 削峰处理 - 流量控制和顺序处理。
- 下单和付款解耦 - 遵循Least Knowledge Principle。
- 限制每个用户只下一笔订单。
Key: ROCKETMQ_HOME,
Val: rocketmq-4.9.3
- Enter CMD go to Folder
/rocketmq-4.9.3/bin
- Start RocketMQ with:
./mqnamesrv
ornohup sh bin/mqnamesrv &
- Launch a new terminal with:
sh mqbroker -n localhost:9876 -c ../conf/broker.conf autoCreateTopicEnable=true
netstat -ano | findstr "9876"
mqshutdown broker
mqshutdown namesrv
./mqadmin deleteTopic -c DefaultCluster -n localhost:9876 -t {topicName}
倒排索引 Inverted Index in Distributed NoSQL DBMS.
- Enter CMD go to Folder
/elasticsearch-7.4.2/bin
- Type
./elasticsearch
- Enter CMD goto folder
/kibana-7.4.2-darwin-x86_64/bin
- Type
./kibana
Visit http://127.0.0.1:9200/ to check ElasticSearch status
Visit http://127.0.0.1:5601/ to manage database via Kibana console
字段,文档,映射,索引,节点,分片
text, keyword
监控流量的QPS或并发数量,当达到设定的threshold时,阻止流量访问。用于处理:
- 某个用户请求量过多(DDoS/恶意刷屏)
- 整体请求量过多,服务器无法承受
实现高可用性(high availability): 保护后端系统不被冲垮,抵挡恶意攻击。
分库:单机数据库存储和并发连接数有限, 分表:单表数据量大时影响sql执行性能。
Distributed ID System - Snowflake
优点:
- 保证id安全性
- 数字类型搜索比字符串id快
- 支持依据id搜索,保证
分布式服务发现和配置管理工具。 Distributed service discovery and configuration management tool.
- Download Consul https://developer.hashicorp.com/consul/downloads
- Start with
./consul agent -dev
- Visit Web http://localhost:8500/
CDN Thymeleaf Ngix服务器 反向代理
分布式部署,模拟多机器的服务注册和服务发现 用RPC call,比api或http快,因为少了安全性检测
外部和内部用api 内部和内部用RPC
长连接 WebSocket Long Polling Http Keep Alive
Please see Project SpringCloudDemo
Load Balancer 网关 设置routing
order和commodity注册在consul上, request经过gateway,和consul沟通,重定向到特定服务上