如何从memcached开始

目前我正在开发一个需要使用memcached的项目。 我已经研究了很多网站链接,但我不明白如何开始使用memcached。 我已经使用过mongodb但想要帮助配置memcached。

我使用的是Windows 7操作系统,到目前为止使用了以下链接。

How to install Memcached on Windows machine

http://memcached.org/

http://www.codeproject.com/KB/aspnet/memcached_aspnet.aspx

好吧,最后我得到了答案……

我已经经历了超过50个与memcache相关的链接,这个最好也是唯一的链接可以帮助你在项目中实现memcache

http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=96698&av=163627

有关理论知识,请参阅以下链接

http://code.google.com/p/memcached/wiki/FAQ#What_is_the_maximum_data_size_you_can_store?_(1_megabyte)

代码示例是

http://www.koders.com/csharp/fid80DA3A5A619DF298A8902A3E74A94B7A126D0438.aspx?s=socket

我在创建memcache之前先创建了一个小文档

/// difference between set and add and replace /// add property do not use to add key which is already exist in memcache /// set use to overwite the key if that is already exist in memcache /// if key already exist ,replace property can replace it other wise not,where else set property use to replace if key already exist other wise it will add new key in the memcache ///Important /// /// if u are fetching the key which do not exist in memcache it will return null,as well if u are fetching the key whose value is null in memcache it will return null /// so avoid inserting the key with null value /// ///If you simply want to avoid key collision between different types of data, simply prefix your key with a useful string. For example: "slash_1", "pradeep_1". /// /// /// /// FlushAll() method use to remove(Flush) every thing from memcache /// /// Stats() gives every information about the memcache like total items,connections,pId etc..... /// difference between increment, decrement /// /// to use Increment or Decrement first u need to store counter by StoreCounter method else u will get null /// /// difference between GetMultiple and GetMultipleArray /// ///GetMultiple gives you the object with there key and GetMultipleArray gives you the object not the key 

您将需要一个Memcache服务器和一个Memcache客户端。

我发现Windows平台上最好的Memcache服务器之一是http://www.membase.com/products-and-services/memcached

它由原始的Memcached开发人员构建。 安装需要几分钟,通过他们的Web界面配置非常简单。

推荐的.NET Memcache客户端是Enyim http://memcached.enyim.com/

您可以在https://github.com/enyim/EnyimMemcached/wiki上找到Enyim的配置示例。

或者,我实际上发现Microsoft AppFabric Caching(代号Velocity)更适合.NET。 我有Memcache和Linq对象的序列化问题,AppFabric没有问题。

如果您对AppFabric感兴趣,请参阅AppFabric教程

http://www.hanselman.com/blog/InstallingConfiguringAndUsingWindowsServerAppFabricAndTheVelocityMemoryCacheIn10Minutes.aspx

看起来他们希望你根据这里的一些安装信息在类似unix / linux的操作系统上运行: http : //code.google.com/p/memcached/wiki/NewInstallFromPackage

您还可以将linux安装到虚拟机中(尝试VirtualBox,其免费的http://www.virtualbox.org/ )并尝试这种方式。

它确实看起来像Windows的端口: http : //code.google.com/p/memcached/wiki/PlatformWindows

安装的特定部分是否不适合您?