SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Mark Cotner
Redis and Ohm
June 9, 2010
Mark Cotner
Redis and Ohm
June 9, 2010



      Atlanta Ruby Users Group
It’s good to be back
 This is my 4th presentation
 I noticed on our history many of my presentations were
 remembered, but the presenter(me) was forgotten
 I guess that means the content really came across well,
 but the presenter just wasn’t memorable enough :)
 I missed you!
 I’m awksedgreep on IRC, Twitter, etc
Redis

Well beyond a simple Key-Value Store
Has data structures programmers are already familiar
with: Arrays, Hashes, Queues, and much much more
Interacting with the “DB” is no different in most cases
than interacting with these data structures
Written in C for speed
Community
Redis license is BSD
Very active community on the mailing list and IRC
(#redis on freenode)
Fast moving project. Features are requested very often
and implemented quickly.
Very stable in spite of rapid change.
Strong client support in Ruby with redis-rb and em-
redis
ORM support with Ohm, redis-objects and
DataMapper
Lets talk Patterns
 Redis is a database that thinks like a programmer
 Publish/Subscribe
 Producer/Consumer(w or w/o Blocking Queues)
 Actor
 Arrays
 Lists/Sets
 Sorted Lists/Sets(dual-indexed lists)
 Object Properties by Primary Key(using Hashes, similar
 to the Active Record pattern)
 Sequence
Data Structures in Redis
Key/Value Pairs(not to be confused with redis hash)
Data Structures in Redis
Hash (not to be confused with key/value pairs)
Data Structures in Redis
         Arrays/Queues
Data Structures in Redis
     Sequences and Unsorted Sets
Data Structures in Redis
    Sorted Sets and Time Series Data
Redis and Ruby

redis-rb - Widely used redis gem
em-redis - Event Machine(async) redis gem
Ohm - Object Relational Mapper for Redis, which now
uses redis hashes
resque - Relatively simple producer/consumer
background workers using redis
redis-TextSearch - Full text searching for AR using redis
Redis and Ruby continued
redis-store - Session and cache store for Rack/Rails/
Sinatra
Redis::Objects - Integrates with existing ORM, provides
a more OOP style functionality to redis
dm-redis-adapter - Full DataMapper functionality for
redis(Yes, it will work in Rails 3.0)
redactor - Actor Pattern on redis
more?
redis-rb

 Just reached 2.0 milestone
 Supports all major redis features through 2.0 including
 Hashes
 Thread Safe(with :thread_safe => true flag)
 Very easy to use
Ohm - ORM for Redis

Has a redis feel to it (Person[1] vs Person.find(1))
Uses hashes for attributes now, extremely fast
Supports simple data validations
Allows relations to be stored as sets or lists(collection)
Ohm - Fun with Patterns
                  Group




       ToDo               Person
                          Person
                           Person
         Task
          Task
           Task
Creating the Model in Ohm
Working with the Model
More . . .
        Lets try an atomic operation




 Take 1 task from the group todo queue and
            assign it to a Person.
Future of Redis
 Commercial Support - Likely from VMWare
 VM - Indexes will be stored in memory, data will be
 written to disk
 UDP - Many operations will be supported by
 lightweight UDP
 Performance - Seems like antirez finds a performance
 enhancement every few days
 Commands - New requests for commands come in all
 the time and seem to be implemented quickly if they
 make sense.
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Kegawatdaruratan Masa Persalinan Kala III dan IV
Kegawatdaruratan Masa Persalinan Kala III dan IVKegawatdaruratan Masa Persalinan Kala III dan IV
Kegawatdaruratan Masa Persalinan Kala III dan IVpjj_kemenkes
 
3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin
3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin
3M Scotchcast Inline Cable Joints 91-NBA with 470W ResinThorne & Derrick International
 
Genetically modified foods
Genetically modified foodsGenetically modified foods
Genetically modified foodsatmapandey
 
Persalinan dan Nifas
Persalinan dan Nifas Persalinan dan Nifas
Persalinan dan Nifas pjj_kemenkes
 
Genetically Modified Food
Genetically Modified FoodGenetically Modified Food
Genetically Modified FoodLaiba Sarwar
 
perdarahan kala III dan IV final
perdarahan kala III dan IV finalperdarahan kala III dan IV final
perdarahan kala III dan IV finalharry christama
 

Was ist angesagt? (6)

Kegawatdaruratan Masa Persalinan Kala III dan IV
Kegawatdaruratan Masa Persalinan Kala III dan IVKegawatdaruratan Masa Persalinan Kala III dan IV
Kegawatdaruratan Masa Persalinan Kala III dan IV
 
3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin
3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin
3M Scotchcast Inline Cable Joints 91-NBA with 470W Resin
 
Genetically modified foods
Genetically modified foodsGenetically modified foods
Genetically modified foods
 
Persalinan dan Nifas
Persalinan dan Nifas Persalinan dan Nifas
Persalinan dan Nifas
 
Genetically Modified Food
Genetically Modified FoodGenetically Modified Food
Genetically Modified Food
 
perdarahan kala III dan IV final
perdarahan kala III dan IV finalperdarahan kala III dan IV final
perdarahan kala III dan IV final
 

Ähnlich wie Redis and Ohm

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisItamar Haber
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redisjavier ramirez
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Dinh Pham
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSAmazon Web Services
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerAjeet Singh Raina
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02sagaroceanic11
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Redis Labs
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!Andraz Tori
 

Ähnlich wie Redis and Ohm (20)

Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redis
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWS
 
Ruby on rails for beginers
Ruby on rails for beginersRuby on rails for beginers
Ruby on rails for beginers
 
Redis by-hari
Redis by-hariRedis by-hari
Redis by-hari
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and Docker
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Ruby openfest
Ruby openfestRuby openfest
Ruby openfest
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!
 

Kürzlich hochgeladen

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Kürzlich hochgeladen (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Redis and Ohm

  • 1. Mark Cotner Redis and Ohm June 9, 2010
  • 2. Mark Cotner Redis and Ohm June 9, 2010 Atlanta Ruby Users Group
  • 3. It’s good to be back This is my 4th presentation I noticed on our history many of my presentations were remembered, but the presenter(me) was forgotten I guess that means the content really came across well, but the presenter just wasn’t memorable enough :) I missed you! I’m awksedgreep on IRC, Twitter, etc
  • 4. Redis Well beyond a simple Key-Value Store Has data structures programmers are already familiar with: Arrays, Hashes, Queues, and much much more Interacting with the “DB” is no different in most cases than interacting with these data structures Written in C for speed
  • 5. Community Redis license is BSD Very active community on the mailing list and IRC (#redis on freenode) Fast moving project. Features are requested very often and implemented quickly. Very stable in spite of rapid change. Strong client support in Ruby with redis-rb and em- redis ORM support with Ohm, redis-objects and DataMapper
  • 6. Lets talk Patterns Redis is a database that thinks like a programmer Publish/Subscribe Producer/Consumer(w or w/o Blocking Queues) Actor Arrays Lists/Sets Sorted Lists/Sets(dual-indexed lists) Object Properties by Primary Key(using Hashes, similar to the Active Record pattern) Sequence
  • 7. Data Structures in Redis Key/Value Pairs(not to be confused with redis hash)
  • 8. Data Structures in Redis Hash (not to be confused with key/value pairs)
  • 9. Data Structures in Redis Arrays/Queues
  • 10. Data Structures in Redis Sequences and Unsorted Sets
  • 11. Data Structures in Redis Sorted Sets and Time Series Data
  • 12. Redis and Ruby redis-rb - Widely used redis gem em-redis - Event Machine(async) redis gem Ohm - Object Relational Mapper for Redis, which now uses redis hashes resque - Relatively simple producer/consumer background workers using redis redis-TextSearch - Full text searching for AR using redis
  • 13. Redis and Ruby continued redis-store - Session and cache store for Rack/Rails/ Sinatra Redis::Objects - Integrates with existing ORM, provides a more OOP style functionality to redis dm-redis-adapter - Full DataMapper functionality for redis(Yes, it will work in Rails 3.0) redactor - Actor Pattern on redis more?
  • 14. redis-rb Just reached 2.0 milestone Supports all major redis features through 2.0 including Hashes Thread Safe(with :thread_safe => true flag) Very easy to use
  • 15. Ohm - ORM for Redis Has a redis feel to it (Person[1] vs Person.find(1)) Uses hashes for attributes now, extremely fast Supports simple data validations Allows relations to be stored as sets or lists(collection)
  • 16. Ohm - Fun with Patterns Group ToDo Person Person Person Task Task Task
  • 19. More . . . Lets try an atomic operation Take 1 task from the group todo queue and assign it to a Person.
  • 20. Future of Redis Commercial Support - Likely from VMWare VM - Indexes will be stored in memory, data will be written to disk UDP - Many operations will be supported by lightweight UDP Performance - Seems like antirez finds a performance enhancement every few days Commands - New requests for commands come in all the time and seem to be implemented quickly if they make sense.

Hinweis der Redaktion