SlideShare a Scribd company logo
1 of 62
Personalization at
tv.nrk.no and
radio.nrk.no with
Orleans and Actor
modelling
About me
• Harald Schult Ulriksen
• Works for Aurum AS
• Currently on the radio team @ NRK, working on
personalization
hsulriksen harald@aurum.no
Agenda
Why
Implementation
Operations
Lessons learned
Redis
SQL
CosmosDB & Graph API
Actor modelling
Azure functions
Can a
favorite
rank
itself?
Grains
• Fundamental building block
• Virtual Actor
• Effectively: Distributed Object
• Unit of computation + state
• Send/receive messages
• React to incoming messages
https://www.youtube.com/watch?time_continue=1426&v=Cj_jUHCXE3U
Grains
• Model objects in domain
• IoT device twins, user profiles, game sessions, auction items, blog posts, …
• Create graphs for computation/communication
• Fan-out, Fan-in & other processing patterns
• Concurrent workers, caches
• Distributed system realities
• Select an appropriate granularity
grain = identity + behavior [+ state]
User/fabio
in-memory,
persisted, or
stateless
class User : Grain, IUser
public interface IUser : IGrainWithStringKey
{
Task SendMessage(IUser sender, string body);
Task<List<Message>> GetMessages();
}
public class User : Grain, IUser
{
IGrainState<List<Message>> _messages;
public User([GrainState("messages")] IGrainState<List<Message>>
messageState)
=> _messages = messageState;
async Task SendMessage(IUser sender, string body)
{
_messages.Value.Add(new Message { Sender = sender, Body = body });
await _messages.WriteStateAsync();
}
Task<List<Message>> GetMessages() =>
Task.FromResult(_messages.Value);
}
// Get grain references. Synchronous & cheap
IUser me = client.GetGrain<IUser>("reuben");
IUser friend = client.GetGrain<IUser>("fabio");
// Call a grain
await friend.SendMessage(sender: me, body: "happy days :)");
// Check my mail for the 45th time today...
var messages = await me.GetMessages();
foreach (var msg in messages)
{
Console.WriteLine($"{msg.Sender.GetPrimaryKeyString()} says:
{msg.Body}");
}
Frontends Actor-based Middle Tier Storage
Access patterns
Reading from
Actor model
or using a
ViewModel (CQRS)
Enriching other views
State
type IdMapper () =
inherit Grain<IdMapperStateDto> ()
type IdMapperStateDto(state: IdMapperVersionedStateDto) =
member val State = state with get, set
new () =
IdMapperStateDto(IdMapperStateDtoV2.defaultState)
type IdMapperStateDtoV2 =
{ CatalogId: Guid; IsMapped: bool}
type IdMapperVersionedStateDto =
| V1 of Guid
| V2 of IdMapperStateDtoV2
module IdMapperStateDtoV2 =
let defaultState =
IdMapperVersionedStateDto.V2 {
CatalogId = Guid.Empty
IsMapped = false}
module IdMapperStateDto =
let fromDto (dto: IdMapperStateDto) : IdMapperState =
match dto.State with
| V1 dto when dto = Guid.Empty -> {
CatalogId = dto |> CatalogId
IsMapped = false}
| V1 dto -> {
CatalogId = dto |> CatalogId
IsMapped = true}
| V2 dto2 -> {
CatalogId = dto2.CatalogId |> CatalogId
IsMapped = dto2.IsMapped}
Etag, caching
and
304 Not Modified
Operations
Lessons learned
• Storage
• Lifecycle
• Placement
• Cache grains
• Model
• Kubernetes
• Number of silos
Performance
Idempotency
Deadlock
Kubernetes
Memory + Lifecycle
Logging is a passion that can kill you
Direct client
Storage
Questions?
@hsulriksen

More Related Content

Similar to Personalization with Orleans and Actor modelling

NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxpetabridge
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastJorge Lopez-Malla
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.GeeksLab Odessa
 
Scalding big ADta
Scalding big ADtaScalding big ADta
Scalding big ADtab0ris_1
 
Object Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerObject Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerAlex Matrosov
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaArun Gupta
 
Midgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsMidgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsHenri Bergius
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaSpark Summit
 
Icinga 2010 at Nagios Workshop
Icinga 2010 at Nagios WorkshopIcinga 2010 at Nagios Workshop
Icinga 2010 at Nagios WorkshopIcinga
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David SzakallasDatabricks
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldChristian Melchior
 
Getting started with Spark & Cassandra by Jon Haddad of Datastax
Getting started with Spark & Cassandra by Jon Haddad of DatastaxGetting started with Spark & Cassandra by Jon Haddad of Datastax
Getting started with Spark & Cassandra by Jon Haddad of DatastaxData Con LA
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Devon Bernard
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your CodeDrupalDay
 

Similar to Personalization with Orleans and Actor modelling (20)

NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
 
Siddhi - cloud-native stream processor
Siddhi - cloud-native stream processorSiddhi - cloud-native stream processor
Siddhi - cloud-native stream processor
 
Requery overview
Requery overviewRequery overview
Requery overview
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit east
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
Scalding big ADta
Scalding big ADtaScalding big ADta
Scalding big ADta
 
Search@airbnb
Search@airbnbSearch@airbnb
Search@airbnb
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
Object Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerObject Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorer
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
 
Midgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsMidgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applications
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
 
Icinga 2010 at Nagios Workshop
Icinga 2010 at Nagios WorkshopIcinga 2010 at Nagios Workshop
Icinga 2010 at Nagios Workshop
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David Szakallas
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
 
Getting started with Spark & Cassandra by Jon Haddad of Datastax
Getting started with Spark & Cassandra by Jon Haddad of DatastaxGetting started with Spark & Cassandra by Jon Haddad of Datastax
Getting started with Spark & Cassandra by Jon Haddad of Datastax
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

Personalization with Orleans and Actor modelling

  • 1. Personalization at tv.nrk.no and radio.nrk.no with Orleans and Actor modelling
  • 2. About me • Harald Schult Ulriksen • Works for Aurum AS • Currently on the radio team @ NRK, working on personalization hsulriksen harald@aurum.no
  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Redis SQL CosmosDB & Graph API Actor modelling Azure functions
  • 17.
  • 18. Grains • Fundamental building block • Virtual Actor • Effectively: Distributed Object • Unit of computation + state • Send/receive messages • React to incoming messages https://www.youtube.com/watch?time_continue=1426&v=Cj_jUHCXE3U
  • 19. Grains • Model objects in domain • IoT device twins, user profiles, game sessions, auction items, blog posts, … • Create graphs for computation/communication • Fan-out, Fan-in & other processing patterns • Concurrent workers, caches • Distributed system realities • Select an appropriate granularity
  • 20. grain = identity + behavior [+ state] User/fabio in-memory, persisted, or stateless class User : Grain, IUser
  • 21. public interface IUser : IGrainWithStringKey { Task SendMessage(IUser sender, string body); Task<List<Message>> GetMessages(); }
  • 22. public class User : Grain, IUser { IGrainState<List<Message>> _messages; public User([GrainState("messages")] IGrainState<List<Message>> messageState) => _messages = messageState; async Task SendMessage(IUser sender, string body) { _messages.Value.Add(new Message { Sender = sender, Body = body }); await _messages.WriteStateAsync(); } Task<List<Message>> GetMessages() => Task.FromResult(_messages.Value); }
  • 23. // Get grain references. Synchronous & cheap IUser me = client.GetGrain<IUser>("reuben"); IUser friend = client.GetGrain<IUser>("fabio"); // Call a grain await friend.SendMessage(sender: me, body: "happy days :)"); // Check my mail for the 45th time today... var messages = await me.GetMessages(); foreach (var msg in messages) { Console.WriteLine($"{msg.Sender.GetPrimaryKeyString()} says: {msg.Body}"); }
  • 26.
  • 27. Reading from Actor model or using a ViewModel (CQRS)
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 34. State
  • 35. type IdMapper () = inherit Grain<IdMapperStateDto> () type IdMapperStateDto(state: IdMapperVersionedStateDto) = member val State = state with get, set new () = IdMapperStateDto(IdMapperStateDtoV2.defaultState)
  • 36. type IdMapperStateDtoV2 = { CatalogId: Guid; IsMapped: bool} type IdMapperVersionedStateDto = | V1 of Guid | V2 of IdMapperStateDtoV2 module IdMapperStateDtoV2 = let defaultState = IdMapperVersionedStateDto.V2 { CatalogId = Guid.Empty IsMapped = false}
  • 37. module IdMapperStateDto = let fromDto (dto: IdMapperStateDto) : IdMapperState = match dto.State with | V1 dto when dto = Guid.Empty -> { CatalogId = dto |> CatalogId IsMapped = false} | V1 dto -> { CatalogId = dto |> CatalogId IsMapped = true} | V2 dto2 -> { CatalogId = dto2.CatalogId |> CatalogId IsMapped = dto2.IsMapped}
  • 39.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 52. • Storage • Lifecycle • Placement • Cache grains • Model • Kubernetes • Number of silos Performance
  • 53.
  • 58. Logging is a passion that can kill you
  • 60.

Editor's Notes

  1. Just a short introduction of myself, my name is Harald Schult Ulriksen, I'm a software developer and I have been working with .net since beta 1. I'm employed by a small company called Aurum, currently working as a consultant for NRK, the Norwegian Broadcasting Corporation, the national broadcaster in norway, think BBC but smaller and in a strange language. At @NRK I'm on the API team in the "programspiller" / player project. The team is about 20 persons with a good split between designers, develoeprs, testers and project management. And it's a really great and competent team.
  2. Brukerne finner ikke innholdet sitt og de blir forvirret av de to (tre) listene. Modellen er veil, vi favorittmerket en episode og ikke serie. Når episoden vises kan den ha mistet rettigheter, man kan ha sett den ferdig og den er ikke lenger relevant. Ting uten rettigheter
  3. Riktig sted, serie typer
  4. Her ligger problemet, reglene for hva som gjør at vi skal løfte opp innhold er kompliserte og vi ønsker å kunne endre dem uten at brukeren skal bli helt forvirret.   Velger man en serie skal man bli tatt til neste episode, men hva er neste episode? Hvis man ser på Heimebane er det ganske naturlig at det er den etter den man ser nå, ikke den som sist ble sluppet. Men nyhetene da? Du så dagsnytt sist torsdag, så da får du sist fredag som neste. Nei kanskje ikke.   Eller hva med nye episoder, du er på episode 3 i sesong 2, så kommer episode 4. Da ønsker vi nok å løfte frem at episode 4 har kommet, men hva hvis du er på episode 3 og det kommer episode 5? Nei, da har vi alt varslet om episode 4 så da trenger du ikke å få vite om at episode 5 er kommet. Men hva hvis du kom til episode 3 etter at episode 4 kom, slik at du ikke har fått med deg varsel om ny episode? Skal vi da varsle om episode 5? Og ja, hvis du er på episode 3 og den snart mister rettigheter, så er det vel passe kult om vi sier i fra 6 dager før eller noe slikt så du får sett den før vi mister rettigheter.
  5. Store serier og sesonger, når vi treffer 4000 episoder i en serie som vi skal sjekke for brukerdata så kneler lua scriptet. Vi holder ikke brukere lenge nok i Redis, de lastes for ofte opp fra databasen Vi har ikke nok redis instanser, Hulu kjørte med 192 instanser som hver bestod av en master og 2 slaver.
  6. Alle reglene vi ønsker oss Serie er ikke bare serie.
  7. Hvis vi drar en rask kobling til DDD land, og begynner å se på endringer som domenehendelser og hver enkelt favoritt som en egen instans, med ansvar for å kalkulere relevans basert på domenehendelsene, så begynner vi å se at det er ganske få domenehendelser, og hver enkelt kan ganske enkelt regne på om relevansen skal oppdateres.  
  8. Framework for distributed systems Programming Model Runtime From Microsoft Research, Open Source under .NET Foundation Built on .NET (Core), runs on: Linux/Windows/macOS Bare metal/Kubernetes/Service Fabric Used by: Microsoft (Azure, Xbox, Skype, others) Halo, PlayFab, Gears of War, internal services Honeywell, Gigya, Visa, NRK, TransUnion, Lebara, Drawboard, US NIST, others Så hvorfor Orleans? Vel, vi ønsker ikke å mate systemet med lassevis av programmer og serier, men hvis vi antar at alt finnes i systemet så kan vi bare kalle på det når vi trenger det. Vi slipper å ha en programsManager som må sikre at det programmet vi skal ha tak i finnes som en actor, vi bare kaller på det og finnes det ikke så leser actoren selv inn program informasjonen ved oppstart.   Det samme gjelder streams, vi behøver ikke å vite om en stream finnes eller ikke, vi bare kaller på den. Skal vi sende data så bare gjør vi det, skal vi lese data så kan vi anta at det finnes noen som sender det også.   Vi er i Azure, og selv om vi hadde en anelse om at vi kom til å ende med k8s på Linux containere så var det greit å vite at løsningen kjørte godt i Azur   Men det viktigste var at vi visste det skalerte, det er lite til ingen plumbing kode å tenke på, Orleans rammeverket tar ansvar og vi sitter igjen med enkel kode.   Så, vi hadde bestemt oss for å teste Orleans, hva nå?
  9. Man kan ikke si om en server er treg eller om den er død.
  10. Hva er katalog – data on the inside / data on the outside – pat helland. Innganger Datamodell Paging Stateless Prefer local
  11. Hva er katalog – data on the inside / data on the outside – pat helland. Innganger Datamodell Paging Stateless Prefer local
  12. Hva er katalog – data on the inside / data on the outside – pat helland. Innganger Datamodell Paging Stateless Prefer local
  13. Hva er katalog – data on the inside / data on the outside – pat helland. Innganger Datamodell Paging Stateless Prefer local Flytt pil
  14. Hva er katalog – data on the inside / data on the outside – pat helland. Innganger Datamodell Paging Stateless Prefer local
  15. Enrich other views where we does not have an index or set to work from. Bloomfilter, https://en.wikipedia.org/wiki/Bloom_filter
  16. Storage engines: Azure Table storage, Cosmos Db, Arango DB, Cassandra, Mongo Db, SQL Server, RavenDB, and I know someone had a BigQuery If you’re not going to query the data outside of loading grain state Versioning
  17. Fortelle om Kubernetes. Namespace. Deployments, replica sets, Membership provider.
  18. Endre, service kaller pods. Det andre bare sier noe om pod’ene
  19. Fortelle om deploymentløpet før man viser neste bilde
  20. Kjøre tester i preprod, sammen også ta ned gammelt og nytt, skalere opp nytt og Litt om deployment
  21. Kjøre tester i preprod, sammen også ta ned gammelt og nytt, skalere opp nytt og
  22. Feil med kø opprettelse som restartet. Utfordringer med å vite om ting er oppe. Mange i et cluster.
  23. Grain Directory service is built on top of a Distributed Hash Table, which inherently is balanced. The directory service maps grains to activations, each silo owns part of the global mapping table, and this table is globally partitioned in a balanced way across all silos. We use consistent hashing with virtual buckets for that.
  24. Bytte