本文是对慕课网上"搞定SSM开发"路径的系列课程的总结,详细的项目文档和课程总结放在github上了.点击查看前端
网站售卖某产品时,规定在某个日期开始售卖限量的产品,最典型的好比小米的开售;这种状况下,可能有不少用户对同一产品在同一时间请求购买,并发数特别高,因此对数据库和网络的设计要求比较高.jquery
秒杀系统最关键的部分是对库存的访问与修改,可能存在同一时间对数据库里的同一字段大量的访问,如何保证查询的时间比较短,让尽量多的用户尽快访问,是此类业务的关键.git
注意要多写注释
***github
<configuration> <!-- 配置全局属性 --> <settings> <!-- 使用jdbc的getGeneratedKeys获取数据库自增主键 --> <setting name="useGeneratedKeys" value="true"/> <!-- 使用列别名替换列名 --> <setting name="useColumnLabel" value="true"/> <!-- 开启驼峰命名转换 下划线命名到驼峰命名的转换--> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings> </configuration>
(如下序号应当从6开始)web
从"使用者"的角度设计接口:redis
使用注解的话,@Service,@Bean,@Autowired等注解实现bean的托管和依赖注入
如下为Spring注解开启的示例文件.spring
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/shcema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- 扫描service报下全部使用注解的类型 --> <context:component-scan base-package="com.ct.maven.SecKill.service"></context:component-scan> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!-- 注入数据库链接池 --> <property name="dataSource" ref="dataSource"></property> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>
[restful] [bootStrap+jquery] [SpringMVC]sql
1:前端cdn访问
2:redis缓存处理;
redis有windows版本可使用
3:并发访问,经过存储过程将一系列的操做一块儿进行,下降由于网络延迟致使的行级锁数据库