- 博客(342)
- 资源 (18)
- 收藏
- 关注
转载 mysql(多级分销)无限极数据库设计方法
闭包表是解决分层存储一个简单而又优雅的解决方案,它记录了表中所有的节点关系,并不仅仅是直接的父子关系。 在闭包表的设计中,额外创建了一张TreePaths的表(空间换取时间),它包含两列,每一列都是一个指向Comments中的CommentId的外键。 1 2 3 4 5 6 CREATETABLEComments( CommentIdintPK, ArticleIdint, Comme...
2021-06-28 21:29:05 1429
转载 手把手教你集成spring cloud + shiro微服务框架
背景假设我们有很多java实现的项目,认证授权用的是shiro框架,可能还有一个sso单点登录平台突然有一天,你的项目经理说要做微服务然后,你就给了你领导很多建议,什么dubbo、什么spring cloud等等;涉及的内容可能方方面面但是! ????该项目经理说:小明,你晚上加加班,花点时间来改造一下现有的项目就好了,我们现有的项目改造起来也不是很麻烦,另外,项目改造微服务不能影响原有的项目计划进度哦 ????此时,你的心里万马奔腾目标总的来说一句话:用最少的工作量,改造基于s
2020-11-08 10:44:41 5923 1
转载 微服务全流程分析
转自:https://zhuanlan.zhihu.com/p/101417273转眼已经2020,距离微服务这个词落地已经过去好多年!(我记得2017年就听过这个词)。然而今天我想想什么是微服务,其实并没有一个很好的定义。为什么这样说,按照微服务的定义:微服务架构就是将一个庞大的业务系统按照业务模块拆分成若干个独立的子系统,每个子系统都是一个独立的应用,它是一种将应用构建成一系列按业务领域划分模块的,小的自治服务的软件架构方式,倡导将复杂的单体应用拆分成若干个功能单一、松偶合的服务,这样可以降低开
2020-11-07 18:23:58 1070
转载 电商商品表设计
一、了解下商品中的两个概念:SPU和SKUSPU(Standard Product Unit):标准化产品单元。是商品信息聚合的最小单位,是一组可复用、易检索的标准化信息的集合,该集合描述了一个产品的特性。通俗点讲,属性值、特性相同的商品就可以称为一个SPU。SKU=Stock Keeping Unit(库存量单位)。即库存进出计量的基本单元,可以是以件,盒,托盘等为单位。举个例子:i...
2019-11-12 21:20:33 3452 1
转载 Redis慢查询设置和查询
Redis 慢查询 (配置文件中需要设置两个参数)转自:https://segmentfault.com/a/1190000009915519 config set slowlog-log-slower-than 100 (单位ms) config set slowlog-max-len 1024 日志最多存个数 config rewrite...
2019-09-13 16:01:58 373
转载 使用redis实现搜索引擎
场景大家如果是做后端开发的,想必都实现过列表查询的接口,当然有的查询条件很简单,一条 SQL 就搞定了,但有的查询条件极其复杂,再加上库表中设计的各种不合理,导致查询接口特别难写,然后加班什么的就不用说了(不知各位有没有这种感受呢~)。下面以一个例子开始,这是某购物网站的搜索条件,如果让你实现这样的一个搜索接口,你会如何实现?(当然你说借助搜索引擎,像 Elasticsearch 之类的,...
2019-09-13 15:18:59 861
转载 activemq、rabbitmq、kafka原理和比较
一、activemq 虽然是java写的消息队列,但是提供Java, C, C++, C#, Ruby, Perl, Python, PHP各种客户端,所以语言上是没什么问题的。配置和使用,基本上是java xml这一套。同时对jms、spring之类的支持很友好。 而且因为是Java写的,所以可以作为一个jar包,放到java项目里,用代码启动和配置,这个对于java开发者而言是不是...
2018-04-14 18:16:53 65393 8
转载 并发减库存 redis vs mysql
https://github.com/zhugw/cocurrent_update_stock/blob/master/src/main/java/com/zhugw/CocurrentUpdateStockApplication.java
2017-05-30 20:07:00 1895
转载 两年后,再议“站内信”的实现
两年前,万仓一黍在博客园发了两篇关于站内信的设计实现博文,《群发“站内信”的实现》、《群发“站内信”的实现(续)》,其中阐述了他关于站内信群发的设计思想,很具有借鉴意义。他在设计时考虑到用户量和存储空间的占用等问题。当然,在他的两篇博文中强调了站内信的设计要考虑具体情况,没有理想的设计方案,他的设计只是对于群发(点到面)的解决方案。 在此简述一下他的设计方案,详细的可以移步万仓一黍的博客。
2016-04-07 09:55:17 6077 3
转载 Swagger与SpringMVC项目整合
为了方便的管理项目中API接口,在网上找了好多关于API接口管理的资料,感觉目前最流行的莫过于Swagger了,功能强大,UI界面漂亮,并且支持在线测试等等,所以本人仔细研究了下Swagger的使用,下面就如何将Swagger与个人的SpringMVC项目进行整合做详细说明:最终API管理界面:详细步骤:Step1:项目中引入相关jar包:?
2016-03-18 11:15:39 872
转载 微信第三方登录接口
随着手机微信的崛起,腾讯发布的微信联登确实很诱惑pc端的伙伴们,现在就说说在pc端用微信扫一扫实现微信第三方登陆的方式。 第一步:获取AppID AppSecret (不做解释,自己去微信公众平台申请)第二步:生成扫描二维码,获取codehttps://open.weixin.qq.com/connect/qrconnect?appid=A
2016-02-22 10:20:47 5922
原创 mysql 如何给大表添加字段
create table xx_order_bak like xx_order;alter table xx_order_bak add column `unit` int(10) DEFAULT 1;INSERT INTO xx_order_bak(`id`, `create_date`, `modify_date`, `address`, `amount_paid`)select *
2015-12-10 22:59:33 6795 1
转载 Mondrian 使用教程
目录(?)[-]Mondrian是什么1 Mondrian的体系结构Architecture11 表现层the presentation layer12 维度层the dimensional layer13 集合层the star layer14 存储层the storage layer2 API一个简单的Mondrian例子1 准备开发工具及环境2 准备M
2015-10-28 21:38:02 1346 1
转载 OLAP的学习与实例搭建
http://blog.csdn.net/qzp1991/article/details/44016959OLAP的学习与实例搭建理论准备工作:一. OLAP1.什么是OLAPOLAP(On-LineAnalysis Processing)在线分析处理是一种共享多维信息的快速分析技术;OLAP利用多维数据库技术使用户从不同角度观察数据;OL
2015-10-28 20:33:04 1077
转载 shiro在springmvc,hibernate,ehcache里面的集成使用
如果项目是hibernate的,以前的时候ehcache可能不是单例的,因为shiro里面也使用到了ehcache做缓存,和hibernate的ehcache缓存配置有冲突,所以需要对hibernate的ehcache部分做些调整,调整如下:bean id="sessionFactory" class="org.springframework.orm.hibernate4.Loca
2015-09-24 10:35:50 3715
转载 Mysql 会导致锁表的语法
最近再找一些Mysql锁表原因,整理出来一部分sql语句会锁表的,方便查阅,整理的不是很全,都是工作中碰到的,会持续更新笔者能力有限,如果有不正确的,或者不到位的地方,还请大家指出来,方便你我,方便大家。此测试环境Mysql 5.5 基于innodb 引擎[sql] view plaincopyinsert i
2015-08-23 12:08:02 7211
转载 阿里云centos6.5安装 mysql
原文http://ninghao.net/blog/1368安装 mysqlmysql 可以管理网站用到的数据库,WordPress 和 Drupal 也都支持 mysql 数据库。所以我们的 Web 运行环境里,需要安装一个 mysql 。之前我们已经添加了资源库,所以可以直接使用 yum 命令去安装 mysql :yum install mys
2015-08-06 14:04:16 939
转载 mysql主从复制(超简单)
怎么安装mysql数据库,这里不说了,只说它的主从复制,步骤如下:1、主从服务器分别作以下操作: 1.1、版本一致 1.2、初始化表,并在后台启动mysql 1.3、修改root的密码2、修改主服务器master: #vi /etc/my.cnf [mysqld] log-bin=mysql-bin //[必须]启用二进
2015-07-04 14:48:15 540
转载 中间件技术及双十一实践·消息中间件篇
消息中间件——分布式消息的广播员综述消息中间件是一种由消息传送机制或消息队列模式组成的最典型的中间件技术。通过消息中间件,应用程序或组件之间可以进行可靠的异步通讯来降低系统之间的耦合度,从而提高整个系统的可扩展性和可用性。3.1、NotifyNotify是淘宝自主研发的一套消息服务引擎,是支撑双11最为核心的系统之一,在淘宝和支付宝的核心交易场景中都有大量使用。消息
2015-05-27 09:14:05 1213
转载 mysql的分区技术
一、概述当 MySQL的总记录数超过了100万后,会出现性能的大幅度下降吗?答案是肯定的,但是,性能下降>的比率不一而同,要看系统的架构、应用程序、还有>包括索引、服务器硬件等多种因素而定。当有网友问我这个问题的时候,我最常见的回答>就是:分表,可以根据id区间或者时间先后顺序等多种规则来分表。分表很容易,然而由此所带来的应用程序甚至是架构方面的改动工作却不>容小觑,还包括将来的扩展性等。
2015-05-24 17:02:17 534
转载 使用hibernate SQLQuery实现动态表
我在实际的项目应用中,有时会设计出这样的一种数据表,每个时间段产生一个新表,例如是按年或月或日。相同类型的表中,所有的字段结构都是一样的。而 hibernate 提供的类与表的映射,是只能映射到一个具体表的,在程序的运行过程中,很难去动态修改一个 hbm 对应的表名。我在网上也有看到一实现,但是很复杂,并且不符合我的要求。因此我就想到直接用 jdbc 去操作数据库,这样的做法是绕过 hib
2015-05-24 16:38:50 477
转载 mysql分表的3种方法
一,先说一下为什么要分表当一张的数据达到几百万时,你查询一次所花的时间会变多,如果有联合查询的话,我想有可能会死在那儿了。分表的目的就在于此,减小数据库的负担,缩短查询时间。根据个人经验,mysql执行一个sql的过程如下:1,接收到sql;2,把sql放到排队队列中 ;3,执行sql;4,返回执行结果。在这个执行过程中最花时间在什么地方呢?第一,是排队等待的时间,第二,sql
2015-05-11 14:33:07 461
转载 支付宝向他付款代码
图片版:<input type="hidden" value="lifaming15@163.com" name="optEmail">文字版:向我捐款
2015-05-11 09:46:48 3027 1
转载 如何在真机上调试Android应用程序(图文详解)
1、首先将手机设置为调试模式方法:设置——应用程序——开发——USB调试,打上√即可 2、用数据线连接至电脑,在电脑上安装豌豆荚,此时豌豆荚会帮你安装驱动,安装好后豌豆荚就可以连接上手机了 3、用adb命令测试是否有装置已连接命令:adb devices看到已经有一个装置了,即为我们连接的真机注意:有的人可能
2015-04-25 19:16:49 602
转载 CSS3新增样式大解析:[6]rotate之旋转-初级
CSS3中添加的transform是对元素进行变化操作的,包括位移,旋转,放大,变形等等。今天我就跟大家讲讲Rotate(旋转)的操作。这里我的代码均是采用标准的css3规范书写,大家使用的时候为了兼容可加上-webkit-、-o-、-ms-、-moz-、-khtml-等前缀以适应不同的浏览器。方法/步骤css3新增的
2015-04-24 17:44:03 1358
转载 入了个树莓派2,发个捣腾htpc的记录
入了个树莓派2,发个捣腾htpc的记录,自己留着备忘,也供入树莓派2的同学参考。准备工作-硬件:电源:5V2A,1A之类的我没有试过,不知道会不会有问题。1代树莓派好像是600ma的,2代升级了cpu可能功耗稍微大一点,但是四核A7估计也大不到哪里去,1A我觉得应该够用了。加usb设备多的话电流还是大一点保险。供电接口还是microusb,手机充电线就可以用。树莓派没有开关,插电就启动,断
2015-04-24 15:17:20 7497
原创 jpa2 subquery
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Order.class); Root root = criteriaQuery.from(Order.class); Path pa
2015-04-18 20:16:49 7732 2
转载 内置锁和显式锁的区别--JCIP C13读书笔记
[本文是我对Java Concurrency In Practice C13的归纳和总结. 转载请注明作者和出处, 如有谬误, 欢迎在评论中指正. ]任何java对象都可以用作同步的锁, 为了便于区分, 将其称为内置锁.JDK5.0引入了显式锁: Lock及其子类(如ReentrantLock, ReadWriteLock等). 内置锁和显式锁的区别有:
2015-04-05 22:40:05 726
转载 java多线程之消费者生产者模式
[java] view plaincopy/*@author shijin * 生产者与消费者模型中,要保证以下几点: * 1 同一时间内只能有一个生产者生产 生产方法加锁sychronized * 2 同一时间内只能有一个消费者消费 消费方法加锁sychronized * 3 生产者生产的同时消费者不能消费 生产方法加锁sy
2015-04-04 11:47:23 695
转载 shiro应用,注销掉后让系统跳转到后台登陆页
shiro应用,后台注销掉后让系统跳转到后台登陆页在进行shop++源码开发中遇到问题及解决,给大家分享下:默认情况是跳转到网站首页,但现在需要后台登陆注销后,跳转到后台登陆界面修改如下:1、在applicationContext-shiro.xml中增加LogoutFilter并配置注销跳转url,可参考如下代码: 2、将上述LogoutFilter加
2015-03-29 13:29:21 14782 2
原创 httpclient支持https,http请求
public static HttpClient getHttpClient(final String name) { PoolingClientConnectionManager manager = getPoolingConnectionManager(500); HttpClient client = new DefaultHttpClient(manager) { {
2015-03-23 14:33:25 1480
转载 如何通过编程发现Java死锁
死锁是指,两个或多个动作一直在等待其他动作完成而使得所有动作都始终处在阻塞的状态。想要在开发阶段检测到死锁是非常困难的,而想要解除死锁往往需要重新启动程序。更糟的是,死锁通常发生在负载最重的生产过程中,而想要在测试中发现它,十分不易。之所以这么说,是因为测试线程之间所有可能的交叉是不现实的。尽管出现了一些静态分析库可以帮助我们发现可能出现的死锁,我们还是有必要在运行时检测到死锁,并且得到有用的信息
2015-03-18 17:54:55 1635
转载 关系型数据的分布式处理系统MyCAT
最近好不容易抽空研究了下Cobar,感觉这个产品确实很不错(在文档方面比Amoeba强多了),特此推荐给大家。Cobar是阿里巴巴研发的关系型数据的分布式处理系统,该产品成功替代了原先基于Oracle的数据存储方案,目前已经接管了3000+个MySQL数据库的schema,平均每天处理近50亿次的SQL执行请求。 首先,使用Cobar的核心功能如下:分布式: Cobar的分布式
2015-03-17 12:34:56 10008 1
转载 How to Build a Python Bot That Can Play Web Games
转:http://code.tutsplus.com/tutorials/how-to-build-a-python-bot-that-can-play-web-games--active-11117In this tutorial we'll explore the insand outs of building a Computer Vision-based game bot in Pyt
2015-03-09 11:25:52 2846
转载 centos6.3安装启动使用PostgreSQL 9.2
----------------------------------------------安装-----------------------------------------------------安装部分主要参考这篇文章:http://www.cnblogs.com/shanyou/archive/2012/08/25/2656783.html1. 先访问http:/
2015-03-07 10:16:54 2176
转载 用WebCollector 2.x爬取新浪微博(无需手动获取cookie)
用WebCollector 2.x 配合另一个项目WeiboHelper,就可以直接爬取新浪微博的数据(无需手动获取cookie)1.导入WebCollector 2.x和WeiboHelper的所有jar包 两个项目的地址:http://git.oschina.net/webcollector/WebCollector
2015-03-05 15:12:17 14394 6
转载 Windows操作系统下的MySQL主从复制及读写分离
一、主服务器(master)配置1、修改MySQL配置文件my.ini[mysqld]log-bin=mysql-binlog-bin-index=mysql-bin.indexserver-id=1sync_binlog=1binlog_format=mixedbinlog-do-db=testbinlog-ignore-db=mysqlbin
2015-03-03 17:08:50 561
转载 MySQL主从配置
工作原理通过MySQL的主从配置,可以实现双机热备和读写分离等等。MySQL的主从复制主要是根据下面三个步骤工作的;master将改变记录到二进制日志(binary log)中;slave将master的binary log拷贝到中继日志(relay log);slave重做中继日志中的事件,将改变反映到自己的数据库中。因此我们可以使用主从配置实现master的实时备份,同
2015-03-03 17:05:00 676
转载 使用Java编写并运行Spark应用程序
我们首先提出这样一个简单的需求:现在要分析某网站的访问日志信息,统计来自不同IP的用户访问的次数,从而通过Geo信息来获得来访用户所在国家地区分布状况。这里我拿我网站的日志记录行示例,如下所示:1121.205.198.92 - - [21/Feb/2014:00:00:07 +0800] "GET /archives/417.html HTTP/1
2015-03-02 17:47:44 41944 3
Programming Windows
2007-08-18
Programming Windows with MFC 2th
2007-08-18
Programming Visual J++6.0
2007-08-18
Programming VisualC++
2007-08-18
Programming Windows Driver Model
2007-08-18
Programming Server-Side Applications for Windows2000
2007-08-18
Programming Windows CE
2007-08-18
Programming Microsoft Visual InterDev 6.0
2007-08-18
Programming Microsoft Outlook and Exchange
2007-08-18
Programing Microsoft Office2000 Web Components
2007-08-18
Programming Microsoft Access 2000
2007-08-18
Programming Distributed Applications with COM and Visual Basic 6.0
2007-08-18
Programming Applications for Microsoft Windows
2007-08-18
Programming Active Server Pages
2007-08-18
Network Programming for Microsoft Windows
2007-08-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人