SlideShare a Scribd company logo
1 of 20
Download to read offline
Simultaneous
Access
Control
with a full open source stack
Walter Traspadini
@uollter
non conventional architecture (?)
why redis ?
why flask ?
Redis.io
Salvatore Sanfilippo
@antirez
Sponsored by
Open Source
key-value store
no-sql ?((made in italy)
Who is using Redis
Redis.io
keys can expire
master-slave
in memory dataset
persistence
Data Structure
- String
- Integer (mainly for counting)
- List
- Set
- Ordered set
- Hash stored list
Don't do this !!
rs = redis.Redis()
rs.keys('*')
- time complexity O(n)
- 10^6 keys database in 40 msec.
- IT MAY RUIN PERFORMANCES
Best practices
SADD SERVICES [QOL, S24, PROF]
HSET SERVICE:QOL expire 60
HSET SERVICE:QOL max_count 1
HSET SERVICE:QOL:bob max_count 3
ZADD ACTIVITY:QOL:bob:20121010 '14:50 Login' 1450
ZADD ACTIVITY:QOL:bob:20121010 '15:15 Logout' 1515
ZRANGE ACTIVITY:QOL:bob:20121010 1200, 1600 O(log(N) + M)
(N: # of elements in the sorted set. M: # of element returned)
list
objects
scores
Flask
> micro-framework for python
> builtin server
> RESTful request dispatching
> WSGI compliant
> integrated support for unit testing
...... easy .....
code example
@app.route('/logout/<username>/<service>/<label>' , methods=['GET'])
@jsonp.jsonp
def logout(username, service, label, device_type=None):
user.sessions = g.r_server.get('USER:%s:%s:%s' %(username, service, label)))
if user.sessions and int(user.sessions) > 0:
g.r_server.delete(user.key())
return jsonify({'user': user.to_json(), 'error': messages.OK_NO_ERROR})
return jsonify({'error': messages.NOT_LOGGEDIN_ERROR, 'user': user.to_json()})
..... siac .... api .....
/chack_access/EntroBol04/QOL/<fingerprint>
MMMD5 ( browser capabilities
+
browser plugins )
cf4ceeb4398b80132eeceadea0a2f9ee
/logout/EntroBol04/QOL/<fingerprint>
headache
> does redis scale ?
> which is the failover policy ?
> what about clustering ?
my early prototype .......
SIAC
REDIS
MASTER
REDIS
SLAVE
spreecast http://www.spreecast.com/
Apache ZooKeeper
Centralized service for maintaining:
configuration information,
naming,
distributed synchronization
.. the final solution .. <3 production
Redis
Redis Redis
SIAC SIAC
ZooKeeper
Cluster Monitor
Monitor
Redis Redis
redis_failover ... for python ...
https://github.com/uolter/redis_failover
....share the code Luke ....
continuous integration as a service
want to learn more ....
> Redis: http://redis.io
> Video redis: http://vimeo.com/21539227
> Flask: http://flask.pocoo.org
> Spreecast & Redis Failover: http:
//engineering.speecast.com/spreecast-redis-
failover
> ZooKeeper: http://zookeeper.apache.org
Walter Traspadini
http://bit.ly/uolter
@uollter

More Related Content

What's hot

WebClusters, Redis
WebClusters, RedisWebClusters, Redis
WebClusters, Redis
Filip Tepper
 
nginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよnginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよ
mamoru tateoka
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
琛琳 饶
 

What's hot (20)

Logstash
LogstashLogstash
Logstash
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Dev ops on startup environment
Dev ops on startup environmentDev ops on startup environment
Dev ops on startup environment
 
WebClusters, Redis
WebClusters, RedisWebClusters, Redis
WebClusters, Redis
 
Honeywall roo 2
Honeywall roo 2Honeywall roo 2
Honeywall roo 2
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4
 
Arvados: Achieving Computational Reproducibility and Data Provenance in Large...
Arvados: Achieving Computational Reproducibility and Data Provenance in Large...Arvados: Achieving Computational Reproducibility and Data Provenance in Large...
Arvados: Achieving Computational Reproducibility and Data Provenance in Large...
 
Redis - for duplicate detection on real time stream
Redis - for duplicate detection on real time streamRedis - for duplicate detection on real time stream
Redis - for duplicate detection on real time stream
 
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et KibanaJournée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
 
Dns20
Dns20Dns20
Dns20
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4
 
Advanced troubleshooting linux performance
Advanced troubleshooting linux performanceAdvanced troubleshooting linux performance
Advanced troubleshooting linux performance
 
Python setup
Python setupPython setup
Python setup
 
nginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよnginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよ
 
Logstash-Elasticsearch-Kibana
Logstash-Elasticsearch-KibanaLogstash-Elasticsearch-Kibana
Logstash-Elasticsearch-Kibana
 
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
 
Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introduction
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
 
RedisConf17- durable_rules
RedisConf17- durable_rulesRedisConf17- durable_rules
RedisConf17- durable_rules
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 

Viewers also liked

Logosloci journal september 2012
Logosloci journal september 2012Logosloci journal september 2012
Logosloci journal september 2012
City Planner
 

Viewers also liked (14)

Gis strumento di lavoro alla base della cartografia e dell’analisi
Gis  strumento di lavoro alla base della cartografia e dell’analisiGis  strumento di lavoro alla base della cartografia e dell’analisi
Gis strumento di lavoro alla base della cartografia e dell’analisi
 
Gis strumento di lavoro alla base della cartografia e dell’analisi
Gis  strumento di lavoro alla base della cartografia e dell’analisiGis  strumento di lavoro alla base della cartografia e dell’analisi
Gis strumento di lavoro alla base della cartografia e dell’analisi
 
Ecco come le API diventano una mappa!
Ecco come le API diventano una mappa! Ecco come le API diventano una mappa!
Ecco come le API diventano una mappa!
 
Opensource
OpensourceOpensource
Opensource
 
Installa web master su wordpress
Installa web master su wordpressInstalla web master su wordpress
Installa web master su wordpress
 
Open streetmap non solo mappe 20160523 #luglegnano
Open streetmap  non solo mappe 20160523 #luglegnanoOpen streetmap  non solo mappe 20160523 #luglegnano
Open streetmap non solo mappe 20160523 #luglegnano
 
OpenStreetMap: open community data for tourism applications
OpenStreetMap:  open community data  for tourism applicationsOpenStreetMap:  open community data  for tourism applications
OpenStreetMap: open community data for tourism applications
 
Una mappa, una idea
Una mappa, una ideaUna mappa, una idea
Una mappa, una idea
 
Linux day 2016 FaberLab
Linux day 2016 FaberLabLinux day 2016 FaberLab
Linux day 2016 FaberLab
 
Il potere delle mappe dei volontari
Il potere delle mappe dei volontariIl potere delle mappe dei volontari
Il potere delle mappe dei volontari
 
Mappa alberi instagram
Mappa alberi   instagramMappa alberi   instagram
Mappa alberi instagram
 
Corso Wordpres 2/7: PERSONALIZZAZIONE
Corso Wordpres 2/7: PERSONALIZZAZIONECorso Wordpres 2/7: PERSONALIZZAZIONE
Corso Wordpres 2/7: PERSONALIZZAZIONE
 
Vie d Acqua Expo 2015
Vie d Acqua Expo 2015Vie d Acqua Expo 2015
Vie d Acqua Expo 2015
 
Logosloci journal september 2012
Logosloci journal september 2012Logosloci journal september 2012
Logosloci journal september 2012
 

Similar to Session Control @ nolinux day

ZFS for Databases
ZFS for DatabasesZFS for Databases
ZFS for Databases
ahl0003
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
Amazee Labs
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
Ricard Clau
 

Similar to Session Control @ nolinux day (20)

Redis SoCraTes 2014
Redis SoCraTes 2014Redis SoCraTes 2014
Redis SoCraTes 2014
 
ZFS for Databases
ZFS for DatabasesZFS for Databases
ZFS for Databases
 
Python redis talk
Python redis talkPython redis talk
Python redis talk
 
Master tuning
Master   tuningMaster   tuning
Master tuning
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup Introduction
 
Extend Redis with Modules
Extend Redis with ModulesExtend Redis with Modules
Extend Redis with Modules
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
 
Redis introduction
Redis introductionRedis introduction
Redis introduction
 
Get more than a cache back! - ConFoo Montreal
Get more than a cache back! - ConFoo MontrealGet more than a cache back! - ConFoo Montreal
Get more than a cache back! - ConFoo Montreal
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_public
 
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
Devoxx 17 - Swift server-side
Devoxx 17 - Swift server-sideDevoxx 17 - Swift server-side
Devoxx 17 - Swift server-side
 
DOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon SecurityDOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon Security
 
10 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 201910 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 2019
 
Redis Lua Scripts
Redis Lua ScriptsRedis Lua Scripts
Redis Lua Scripts
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Session Control @ nolinux day