booksleeve


Saving a collection of objects with BookSleeve


I am new to both Redis and BookSleeve. I am evaluating whether I should use BookSleeve or ServiceStack.Redis.
ServiceStack seems much more staightforward but I like the idea of pipelining provided by BookSleeve.
I have Redis and BookSleeve running and getting and setting strings is a snap but I'm struggling to find examples of setting and getting a collection of objects such as my pocos.
public class MyType
{
....
}
IEnumerable<MyType> types = ....
How do I get and set these using BookSleeve?
Thanks.
When using ServiceStack.Redis it's just a matter of:
var redisClient = new RedisClient();
redisClient.StoreAll(myTypes);
Not sure what pipelining features you're looking for but you can create custom pipelined operations with ServiceStack.Redis's transactions API (which are always pipelined) or if you don't want the operations to execute within a transaction you can use Redis.CreatePipeline() - see these tests for some examples.
BookSleeve exposes APIs to read/write strings and blobs (byte[]), but it does not force you down any particular serialization route, or dictate whether a collection should be stored as a single value, vs a list, etc.
Basically, with BookSleeve you would serialize separately, via any serializer that you fancy (XML, json, protobuf, whatever), and send that. This is usually only about 2 or 3 lines of code (often involving MemoryStream).

Related Links

BookSleeve ConnectionUtils with sentinel password
in booksleeve how do I iterate through all the keys in given db
Saving a collection of objects with BookSleeve
Booksleeve - Setting multiple Hash Values and retrieve them at once
How to use a singleton for storing the RedisConnection with Booksleeve?

Categories

HOME
fabricjs
checkstyle
graphics
rendering
carousel
rom
tail
iis-6
crystal-lang
lanczos
pcl-crypto
ipmitool
enterprise-architect
modbus-tcp
scsi
spring-async
syntax-highlighting
datastax-enterprise-graph
bioinformatics
sqsh
autodesk-designautomation
postback
kudu
android-gridview
contacts
nested-lists
numpy-broadcasting
servicestack-text
connection-pool
railstutorial.org
css-position
hackintosh
datacachefactory
outputcache
android-checkbox
phpdbg
jide
flask-restful
openrasta
dbcontext
carrot2
git-flow
libjpeg
flyout
objectscript
bootstrap-tags-input
sandcastle
testrail
materialized-path-pattern
builtins
model-associations
tracker-enabled-dbcontext
query-by-example
ikiwiki
invoke-sqlcmd
realsense
maybe
sciruby
java-money
ons-api
linked-tables
alloy-ui
bufferedinputstream
entity-framework-4.3
zxspectrum
rrule
code-documentation
openbabel
infosphere-spl
ejb-2.x
psr-4
with-statement
mobility
memset
square-bracket
android-audiorecord
sphinxql
cnf
asdf
stacky
android-loadermanager
sentestingkit
wcf-configuration
faye
appjs
failing-tests
jquery-address
denied
role
landscape-portrait
filemerge
w3c-geolocation
codebase
maven-1
wordprocessingml
business-model

Resources

Encrypt Message