Skip to content

Commit

Permalink
Site updated: 2016-09-16 14:21:23
Browse files Browse the repository at this point in the history
  • Loading branch information
minokoko committed Sep 16, 2016
1 parent 6c7c18d commit a3150f1
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 37 deletions.
14 changes: 7 additions & 7 deletions 2016/09/16/Nosql之Redis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


<meta name="keywords" content="redis,Nosql," />
<meta name="keywords" content="Nosql,redis," />



Expand Down Expand Up @@ -349,27 +349,27 @@ <h1 id="什么是NoSql"><a href="#什么是NoSql" class="headerlink" title="什

<div class="post-tags">

<a href="/tags/redis/" rel="tag">#redis</a>

<a href="/tags/Nosql/" rel="tag">#Nosql</a>

<a href="/tags/redis/" rel="tag">#redis</a>

</div>



<div class="post-nav">
<div class="post-nav-next post-nav-item">

<a href="/2016/09/16/服务器搭建-四-redis配置/" rel="next" title="服务器搭建-四-redis配置">
<i class="fa fa-chevron-left"></i> 服务器搭建-四-redis配置
<a href="/2016/09/16/服务器搭建-三-fastDFS图片服务器/" rel="next" title="服务器搭建(三) fastDFS图片服务器">
<i class="fa fa-chevron-left"></i> 服务器搭建(三) fastDFS图片服务器
</a>

</div>

<div class="post-nav-prev post-nav-item">

<a href="/2016/09/16/redis数据类型及命令/" rel="prev" title="redis数据类型及命令">
redis数据类型及命令 <i class="fa fa-chevron-right"></i>
<a href="/2016/09/16/服务器搭建-四-redis配置/" rel="prev" title="服务器搭建-四-redis配置">
服务器搭建-四-redis配置 <i class="fa fa-chevron-right"></i>
</a>

</div>
Expand Down
22 changes: 18 additions & 4 deletions 2016/09/16/redis数据类型及命令/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
127.0.0.1:6379&amp;gt; getset s2 222
&amp;quot;111&amp;quot;
127.0.0.1:6379&amp;g">
<meta property="og:updated_time" content="2016-09-16T06:13:26.830Z">
<meta property="og:image" content="https://raw.githubusercontent.com/minokoko/minokoko.github.io/master/images/redis_hash.jpg">
<meta property="og:updated_time" content="2016-09-16T06:21:12.139Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="redis数据类型及命令">
<meta name="twitter:description" content="String类型SET key value 赋值
Expand All @@ -121,6 +122,7 @@
127.0.0.1:6379&amp;gt; getset s2 222
&amp;quot;111&amp;quot;
127.0.0.1:6379&amp;g">
<meta name="twitter:image" content="https://raw.githubusercontent.com/minokoko/minokoko.github.io/master/images/redis_hash.jpg">



Expand Down Expand Up @@ -376,7 +378,19 @@ <h1 id="String类型"><a href="#String类型" class="headerlink" title="String
127.0.0.1:6379&gt; mget k1 k3
1) &quot;v1&quot;
2) &quot;v3&quot;
</code></pre>
</code></pre><h1 id="String应用"><a href="#String应用" class="headerlink" title="String应用"></a><strong>String应用</strong></h1><p>自增主键: 商品编号、订单号采用string的递增数字特性生成。</p>
<pre><code>定义商品编号key:items:id
192.168.101.3:7003&gt; INCR items:id
(integer) 2
192.168.101.3:7003&gt; INCR items:id
(integer) 3
</code></pre><h1 id="String存在的问题"><a href="#String存在的问题" class="headerlink" title="String存在的问题"></a><strong>String存在的问题</strong></h1><pre><code>假设有User对象以JSON序列化的形式存储到Redis中,User对象有id,username、password、age、name等属性,存储的过程如下:
保存、更新:
User对象 -&gt; json(string) -&gt; redis
如果在业务上只是更新age属性,其他的属性并不做更新我应该怎么做呢?
如果仍然采用上边的方法在传输、处理时会造成资源浪费,下边讲的hash可以很好的解决这个问题。
</code></pre><h1 id="Hash类型"><a href="#Hash类型" class="headerlink" title="Hash类型"></a><strong>Hash类型</strong></h1><p>hash叫散列类型,它提供了字段和字段值的映射。字段值只能是字符串类型,不支持散列类型、集合类型等其它类型。如下:<br><img src="https://raw.githubusercontent.com/minokoko/minokoko.github.io/master/images/redis_hash.jpg" alt=""></p>


</div>

Expand Down Expand Up @@ -407,7 +421,7 @@ <h1 id="String类型"><a href="#String类型" class="headerlink" title="String
<div class="post-nav">
<div class="post-nav-next post-nav-item">

<a href="/2016/09/16/Nosql之Redis/" rel="next" title="服务器搭建-四-redis配置">
<a href="/2016/09/16/服务器搭建-四-redis配置/" rel="next" title="服务器搭建-四-redis配置">
<i class="fa fa-chevron-left"></i> 服务器搭建-四-redis配置
</a>

Expand Down Expand Up @@ -524,7 +538,7 @@ <h1 id="String类型"><a href="#String类型" class="headerlink" title="String



<div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#String类型"><span class="nav-number">1.</span> <span class="nav-text">String类型</span></a></li></ol></div>
<div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#String类型"><span class="nav-number">1.</span> <span class="nav-text">String类型</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#String应用"><span class="nav-number">2.</span> <span class="nav-text">String应用</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#String存在的问题"><span class="nav-number">3.</span> <span class="nav-text">String存在的问题</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Hash类型"><span class="nav-number">4.</span> <span class="nav-text">Hash类型</span></a></li></ol></div>

</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ <h1 id="fastDFS搭建"><a href="#fastDFS搭建" class="headerlink" title="fastDF

<div class="post-nav-prev post-nav-item">

<a href="/2016/09/16/服务器搭建-四-redis配置/" rel="prev" title="服务器搭建-四-redis配置">
<a href="/2016/09/16/Nosql之Redis/" rel="prev" title="服务器搭建-四-redis配置">
服务器搭建-四-redis配置 <i class="fa fa-chevron-right"></i>
</a>

Expand Down
14 changes: 7 additions & 7 deletions 2016/09/16/服务器搭建-四-redis配置/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


<meta name="keywords" content="redis,Nosql," />
<meta name="keywords" content="Nosql,redis," />



Expand Down Expand Up @@ -349,27 +349,27 @@ <h1 id="什么是NoSql"><a href="#什么是NoSql" class="headerlink" title="什

<div class="post-tags">

<a href="/tags/redis/" rel="tag">#redis</a>

<a href="/tags/Nosql/" rel="tag">#Nosql</a>

<a href="/tags/redis/" rel="tag">#redis</a>

</div>



<div class="post-nav">
<div class="post-nav-next post-nav-item">

<a href="/2016/09/16/服务器搭建-三-fastDFS图片服务器/" rel="next" title="服务器搭建(三) fastDFS图片服务器">
<i class="fa fa-chevron-left"></i> 服务器搭建(三) fastDFS图片服务器
<a href="/2016/09/16/Nosql之Redis/" rel="next" title="服务器搭建-四-redis配置">
<i class="fa fa-chevron-left"></i> 服务器搭建-四-redis配置
</a>

</div>

<div class="post-nav-prev post-nav-item">

<a href="/2016/09/16/Nosql之Redis/" rel="prev" title="服务器搭建-四-redis配置">
服务器搭建-四-redis配置 <i class="fa fa-chevron-right"></i>
<a href="/2016/09/16/redis数据类型及命令/" rel="prev" title="redis数据类型及命令">
redis数据类型及命令 <i class="fa fa-chevron-right"></i>
</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions archives/2016/09/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down Expand Up @@ -321,7 +321,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down
4 changes: 2 additions & 2 deletions archives/2016/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down Expand Up @@ -321,7 +321,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down
4 changes: 2 additions & 2 deletions archives/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down Expand Up @@ -321,7 +321,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down
2 changes: 1 addition & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ pre .javascript .function {
width: 4px;
height: 4px;
border-radius: 50%;
background: #7a95d4;
background: #57875b;
}
.links-of-blogroll {
font-size: 13px;
Expand Down
Binary file added images/redis_hash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,19 @@ <h1 id="String类型"><a href="#String类型" class="headerlink" title="String
127.0.0.1:6379&gt; mget k1 k3
1) &quot;v1&quot;
2) &quot;v3&quot;
</code></pre>
</code></pre><h1 id="String应用"><a href="#String应用" class="headerlink" title="String应用"></a><strong>String应用</strong></h1><p>自增主键: 商品编号、订单号采用string的递增数字特性生成。</p>
<pre><code>定义商品编号key:items:id
192.168.101.3:7003&gt; INCR items:id
(integer) 2
192.168.101.3:7003&gt; INCR items:id
(integer) 3
</code></pre><h1 id="String存在的问题"><a href="#String存在的问题" class="headerlink" title="String存在的问题"></a><strong>String存在的问题</strong></h1><pre><code>假设有User对象以JSON序列化的形式存储到Redis中,User对象有id,username、password、age、name等属性,存储的过程如下:
保存、更新:
User对象 -&gt; json(string) -&gt; redis
如果在业务上只是更新age属性,其他的属性并不做更新我应该怎么做呢?
如果仍然采用上边的方法在传输、处理时会造成资源浪费,下边讲的hash可以很好的解决这个问题。
</code></pre><h1 id="Hash类型"><a href="#Hash类型" class="headerlink" title="Hash类型"></a><strong>Hash类型</strong></h1><p>hash叫散列类型,它提供了字段和字段值的映射。字段值只能是字符串类型,不支持散列类型、集合类型等其它类型。如下:<br><img src="https://raw.githubusercontent.com/minokoko/minokoko.github.io/master/images/redis_hash.jpg" alt=""></p>




Expand Down Expand Up @@ -404,7 +416,7 @@ <h1 class="post-title" itemprop="name headline">



<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
服务器搭建-四-redis配置
</a>

Expand All @@ -429,8 +441,8 @@ <h1 class="post-title" itemprop="name headline">

<span class="post-comments-count">
&nbsp; | &nbsp;
<a href="/2016/09/16/Nosql之Redis/#comments" itemprop="discussionUrl">
<span class="post-comments-count ds-thread-count" data-thread-key="2016/09/16/Nosql之Redis/" itemprop="commentsCount"></span>
<a href="/2016/09/16/服务器搭建-四-redis配置/#comments" itemprop="discussionUrl">
<span class="post-comments-count ds-thread-count" data-thread-key="2016/09/16/服务器搭建-四-redis配置/" itemprop="commentsCount"></span>
</a>
</span>

Expand Down Expand Up @@ -542,7 +554,7 @@ <h1 class="post-title" itemprop="name headline">



<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
服务器搭建-四-redis配置
</a>

Expand All @@ -567,8 +579,8 @@ <h1 class="post-title" itemprop="name headline">

<span class="post-comments-count">
&nbsp; | &nbsp;
<a href="/2016/09/16/服务器搭建-四-redis配置/#comments" itemprop="discussionUrl">
<span class="post-comments-count ds-thread-count" data-thread-key="2016/09/16/服务器搭建-四-redis配置/" itemprop="commentsCount"></span>
<a href="/2016/09/16/Nosql之Redis/#comments" itemprop="discussionUrl">
<span class="post-comments-count ds-thread-count" data-thread-key="2016/09/16/Nosql之Redis/" itemprop="commentsCount"></span>
</a>
</span>

Expand Down
4 changes: 2 additions & 2 deletions tags/Nosql/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2 >

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down Expand Up @@ -258,7 +258,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down
4 changes: 2 additions & 2 deletions tags/redis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down Expand Up @@ -286,7 +286,7 @@ <h1 class="post-title">

<h1 class="post-title">

<a class="post-title-link" href="/2016/09/16/Nosql之Redis/" itemprop="url">
<a class="post-title-link" href="/2016/09/16/服务器搭建-四-redis配置/" itemprop="url">

<span itemprop="name">服务器搭建-四-redis配置</span>

Expand Down

0 comments on commit a3150f1

Please sign in to comment.