2. Globalcode – Open4education
Thiago Custódio
Programador .NET desde 2004
MBA Engenharia de Software com ênfase em SOA
Bacharel em Ciência da Computação
@thdotnet
thiago.custodio@hotmail.com
http://thiagocustodio.azurewebsites.net
4. Globalcode – Open4education
Redis
NoSql baseado em chave/valor Open Source sob
a licença BSD.
Criado por Salvatore Sanfilippo (@antirez)
Primeiro release (10/04/2009)
Escrito em C
Disponível para Linux / Unix / Mac OS / Windows
5. Globalcode – Open4education
Características
Suporte à múltiplas linguagens:
(C, C#, C++, Clojure, Common Lisp, D, Dart, emacs lisp, Erlang,
Fancy, GNU Prolog, Go, Haskell, haXe, Io, Java, Lua, Nimrod,
Node.js, Objective-C, Perl, PHP, Pure Data, Python, Ruby, Rust,
Scala, Scheme, Smalltalk, Tcl)
Muito rápido! (100.000+ escrita/leitura por segundo)
Suporte à transação
Persistência em disco
De tempos em tempos (RDB)
A cada novo item (AOF)
6. Globalcode – Open4education
O que há de diferente no
Redis?
Suporte à estrutura de dados:
Listas
Sets
Sorted Sets
Hashes
Pipeline (envio de comandos em lote)
Publish/Subscribe
7. Globalcode – Open4education
Exemplos
Armazenar um item:
SET tdc:2014:azure-redis “trilha arquitetura .net - thiago”
OK
SET tdc:2014:sollution-selling “trilha arquitetura .net -
evilazaro”
OK
Recuperando um item
GET tdc:2014:azure-redis
“trilha arquitetura .net - thiago”
12. Globalcode – Open4education
Azure Redis Cache
Versão customizada e gerenciada pelo Azure
(PaaS)
Disponível no datacenter do Brasil (Preview)
Basic - Único nó até 26gb
Standard - dois nós (master/slave)
13. Globalcode – Open4education
Cenários
Armazenar Sessão (asp.net) no Azure Redis
Cache
Compartilhar dados entre múltiplas instâncias
Páginas mais acessadas
Tracking de navegação de páginas por um usuário
Mensageria
Chat
Tokens temporários
(ex: downloads rapidshare, etc)
15. Globalcode – Open4education
Por onde começar?
1- Acessar o novo portal do Azure
(portal.azure.com)
2- Criar um novo serviço Azure Redis Cache
Instalar via Nuget o pacote ServiceStack.Redis