{"id":3427,"date":"2022-12-07T10:33:06","date_gmt":"2022-12-07T10:33:06","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"modified":"2026-03-09T13:04:35","modified_gmt":"2026-03-09T13:04:35","slug":"opi-lisaa-ruby-on-railsista-pub-subin-avulla","status":"publish","type":"post","link":"https:\/\/thecodest.co\/fi\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","title":{"rendered":"Lis\u00e4tietoja Ruby on Rails with Pub\/Sub -laitteesta"},"content":{"rendered":"<p><strong><a href=\"https:\/\/thecodest.co\/fi\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">Ruby<\/a> osoitteessa <a href=\"https:\/\/thecodest.co\/fi\/blog\/ways-to-increase-your-rails-performance\/\">Kiskot<\/a><\/strong> (Rails, <a href=\"https:\/\/thecodest.co\/fi\/blog\/hire-ror-developer\/\">RoR<\/a>) on tunnettu <a href=\"https:\/\/thecodest.co\/fi\/blog\/find-your-ideal-stack-for-web-development\/\">web<\/a> sovelluskehys, joka on kirjoitettu <strong>Ruby<\/strong> ohjelmointikieli. <strong>Pub\/Sub<\/strong> on lyhennetty nimi ohjelmistojen suunnittelumalleille nimelt\u00e4 <b>Publish-subscribe<\/b>. Selit\u00e4n, miten ohjelmistokomponenttien v\u00e4linen kommunikointi Railsissa voitaisiin hoitaa Pub\/Sub-menetelm\u00e4ll\u00e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mik\u00e4 on Pub\/sub?<\/h2>\n\n\n\n<p><strong>Pub\/sub<\/strong> on ohjelmistosuunnittelumalli, joka tarjoaa palveluiden v\u00e4list\u00e4 viestint\u00e4\u00e4. Palvelu<br>liittyy jompaankumpaan kahdesta roolista: julkaisija (joka tuottaa) tai vastaanottaja (joka kuluttaa). Mik\u00e4 on<br>tuotetaan kulutettavaksi, m\u00e4\u00e4ritet\u00e4\u00e4n tapahtumaksi, viestiksi tai ilmoitukseksi. Vuonna<br>T\u00e4ss\u00e4 artikkelissa niit\u00e4 k\u00e4ytet\u00e4\u00e4n vaihtelevasti viittaamaan samaan asiaan.<br>Palvelu, joka tuottaa, ei tied\u00e4, kuka kuluttaa. Palvelu, joka kuluttaa, ei<br>tiet\u00e4\u00e4 viestin alkuper\u00e4n. Ne voivat pysy\u00e4 toisilleen tuntemattomina. Se eroaa<br>viestijonot, joissa viestin l\u00e4hett\u00e4v\u00e4 komponentti usein tiet\u00e4\u00e4 viestin m\u00e4\u00e4r\u00e4np\u00e4\u00e4n.<br>- t\u00e4m\u00e4ntyyppisen viestinn\u00e4n avulla voit l\u00e4hett\u00e4\u00e4 viestej\u00e4 miss\u00e4 tahansa. T\u00e4m\u00e4 mekanismi on keskeinen<br>of <strong>Pub\/sub<\/strong> ja se tarkoittaa, ett\u00e4 ne on erotettu toisistaan.<\/p>\n\n\n\n<p>Yhteisten etujensa ilmaiseminen edellytt\u00e4\u00e4 yhteist\u00e4 ymm\u00e4rryst\u00e4. Siksi,<br>molemmissa rooleissa on implisiittinen mekanismi, jossa viestin tuottaja ja<br>viestin kuluttaja tapaa. T\u00e4t\u00e4 mekanismia kutsutaan aiheeksi, tilaukseksi tai aiheeksi. Se on<br>vastaa viestien luokittelusta kohteisiin, se on l\u00e4hinn\u00e4 tilaton viestisuodatin.<br>Aiheet toimivat l\u00e4hetysasemina. Julkaisija tuottaa viestin aiheeseen,<br>tilaajat saavat v\u00e4litt\u00f6m\u00e4sti viestin aiheesta. Kytkettyjen<br>palveluissa tehokkain tapa vaihtaa viestej\u00e4 on k\u00e4sitell\u00e4 niit\u00e4 asynkronisesti.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rails ilman Pub\/Sub<\/h2>\n\n\n\n<p>Oletusarvoisesti Railsissa ei ole ohjelmistosuunnittelumallien yleiskustannuksia komponenttien v\u00e4lisess\u00e4 viestien v\u00e4litt\u00e4misess\u00e4. Kehitt\u00e4j\u00e4t k\u00e4ytt\u00e4v\u00e4t standardia <strong>oliosuuntautunut ohjelmointi<\/strong> (<a href=\"https:\/\/thecodest.co\/fi\/dictionary\/object-oriented-programming-oop\/\">OOP<\/a>) paradigma: parametrien v\u00e4litt\u00e4minen funktioille, luokkien kysyminen arvoista.<\/p>\n\n\n\n<p>Kun hakemus on melko yksinkertainen, se voi riitt\u00e4\u00e4. Kun sovellus kasvaa ja esimerkiksi joitakin toimintoja on suoritettava asynkronisesti, niin silloin <a href=\"https:\/\/thecodest.co\/fi\/dictionary\/why-do-projects-fail\/\">projekti<\/a> tarvitsee abstraktiota, joka ratkaisee, ett\u00e4 <a href=\"https:\/\/thecodest.co\/fi\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">tiedot<\/a> ty\u00f6nkulku. Sen sijaan, ett\u00e4 kehitt\u00e4j\u00e4t keksisiv\u00e4t py\u00f6r\u00e4n uudelleen, he voivat toteuttaa <strong>Pub\/sub<\/strong> t\u00e4ytt\u00e4m\u00e4\u00e4n t\u00e4m\u00e4n abstraktion puutteen.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pub\/Subin edut Railsin kanssa<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>V\u00e4lt\u00e4 aktiivisen tietueen takaisinkutsuja.<\/li>\n\n\n\n<li>Kun j\u00e4rjestelm\u00e4\u00e4n lis\u00e4t\u00e4\u00e4n asynkronista rinnakkaisk\u00e4sittely\u00e4, suorituskyky, luotettavuus ja <a href=\"https:\/\/thecodest.co\/fi\/blog\/difference-between-elasticity-and-scalability-in-cloud-computing\/\">skaalautuvuus<\/a> parannetaan.<\/li>\n\n\n\n<li>Viestej\u00e4 voidaan l\u00e4hett\u00e4\u00e4 asynkronisesti j\u00e4rjestelm\u00e4n eri osiin.<\/li>\n\n\n\n<li>Mahdollistaa viestien l\u00e4hett\u00e4misen asynkronisesti j\u00e4rjestelm\u00e4n eri osiin.<\/li>\n\n\n\n<li>Decoupling - toiminnallisuuden lis\u00e4\u00e4minen tai muuttaminen ei vaikuta mihink\u00e4\u00e4n, koska Pub\/Sub<br>voit muokata kaiken vuorovaikutusta.<\/li>\n\n\n\n<li>Viestin kuluttajan ei en\u00e4\u00e4 tarvitse tarkistaa s\u00e4\u00e4nn\u00f6llisesti p\u00e4ivityksi\u00e4 tai uusia viestej\u00e4.<br>tiedot. Se v\u00e4hent\u00e4\u00e4 toimitusviivett\u00e4, joka voi olla erityisen ongelmallista j\u00e4rjestelmiss\u00e4, joissa<br>eik\u00e4 viivytyksi\u00e4 siedet\u00e4.<\/li>\n\n\n\n<li>J\u00e4rjestelm\u00e4 voi k\u00e4sitell\u00e4 tilaajien m\u00e4\u00e4r\u00e4\u00e4 ilman rajoituksia, koska se voi muuttua,<br>p\u00e4ivitt\u00e4\u00e4, lis\u00e4\u00e4nty\u00e4 tai kadota milloin tahansa.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Pub\/Subin ja Railsin haitat<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pub\/sub-j\u00e4rjestelmien suurin haittapuoli on se, ett\u00e4 niiss\u00e4 ei ole kytketty yhteen julkaisijaa ja toimittajaa.<br>tilaaja.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Rails Pub\/Sub k\u00e4ytt\u00f6\u00f6notto<\/h2>\n\n\n\n<p>Esimerkkej\u00e4 l\u00e4hdekoodin Rails kirjoitettiin k\u00e4ytt\u00e4en kirjastoa<br><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">Pub\/Sub on Rails<\/a> (Rubyn nimikkeist\u00f6ss\u00e4 kirjasto on nimelt\u00e4\u00e4n gem): L\u00f6yd\u00e4t lis\u00e4tietoja gemin readme-tiedostosta. Toteutus koostuu moduuleista:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Alue,<\/li>\n\n\n\n<li>Tapahtuma,<\/li>\n\n\n\n<li>Tapahtuman k\u00e4sittelij\u00e4,<\/li>\n\n\n\n<li>Tapahtuman julkaisija,<\/li>\n\n\n\n<li>Tilaus.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Verkkotunnus<\/h3>\n\n\n\n<p>Kuvaa liiketoimintalogiikan, jotta Pub\/Subille voidaan tarjota konteksti ja n\u00e4in ollen tehd\u00e4 puhtaat <a href=\"https:\/\/thecodest.co\/fi\/dictionary\/what-is-code-refactoring\/\">koodi<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> moduuli Ilmoitukset\n   extend PubSub::Domain\n end<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> moduuli Raportit\n   extend PubSub::Domain\n end\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Tapahtuma<\/h3>\n\n\n\n<p>Se on luokka, joka kuvaa, mit\u00e4 tapahtui. Ilmoita luokan nimi mahdollisimman hyvin itse\u00e4\u00e4n kuvaavaksi sen kanssa, mit\u00e4 tapahtui, esimerkiksi: peruutettu, muutettu, luotu, tuhottu, l\u00e4hetetty, p\u00e4ivitetty. Tapahtuman nimet voivat n\u00e4ytt\u00e4\u00e4 seuraavanlaisilta: ProfitAndLossStatementCreatedEvent, joka tarkoittaa, ett\u00e4 tilinp\u00e4\u00e4t\u00f6s luotiin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> class Reports::ProfitAndLossStatementCreatedEvent &lt; PubSub::DomainEvent\n   attribuutti :profit_and_loss_statement_id, Types::Strict::Integer\n end<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Tapahtuman julkaisija<\/h3>\n\n\n\n<p>Luokka, joka pystyy l\u00e4hett\u00e4m\u00e4\u00e4n tapahtumia. Esimerkiss\u00e4 luodaan palveluraportti. Kun raportti on luotu onnistuneesti, l\u00e4hetet\u00e4\u00e4n raportin luomista koskeva tapahtuma.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">luokka Raportit::TuloslaskelmaPalvelu\n   include PubSub::Emit\n    def execute\n     emit(:report_profit_and_loss_statement_created, profit_and_loss_statement_id: id) if result.ok?\n   end\n end<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Tapahtuman k\u00e4sittelij\u00e4<\/h3>\n\n\n\n<p>T\u00e4m\u00e4 luokka on suoritettava vastauksena tapahtuman k\u00e4sittelyyn.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">moduuli Ilmoitukset\n class ReportsProfitAndLossStatementCreatedHandler &lt; PubSub::DomainEventHandler\n   def call\n     ReportMailer.profit_and_loss_statement(profit_and_loss_statement).deliver_now\n   end\n\n   private\n\n   def profit_and_loss_statement\n     ProfitAndLossStatement.find(event_data.profit_and_loss_statement_id)\n   end\n end\nend<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Tilaus<\/h3>\n\n\n\n<p>Tapahtumat sidotaan k\u00e4sittelij\u00f6ihins\u00e4 tilausten kautta.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">ilmoitukset:\n raportteja__profit_and_loss_statement_created: async<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Esimerkkej\u00e4 k\u00e4ytt\u00f6tapauksista:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\"Seuraa\" -toiminto sosiaalisissa verkostoissa,<\/li>\n\n\n\n<li>Esineiden internet,<\/li>\n\n\n\n<li>Postitus,<\/li>\n\n\n\n<li>Ilmoitus luoduista tiedostoista.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Samankaltaiset kuviot<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><b>EventBus<\/b> - komponentit voivat l\u00e4hett\u00e4\u00e4 tapahtumia EventBusiin tiet\u00e4m\u00e4tt\u00e4, kuka ne poimii tai kuinka monta vastaajaa on tulossa. <a href=\"https:\/\/thecodest.co\/fi\/blog\/react-development-all-you-have-to-know\/\">reagoida<\/a>,<\/li>\n\n\n\n<li><b>Tarkkailija<\/b> - subjekti yll\u00e4pit\u00e4\u00e4 luetteloa riippuvaisista henkil\u00f6ist\u00e4, joita kutsutaan tarkkailijoiksi, ja ilmoittaa niille aina, kun niiden tila muuttuu,<\/li>\n\n\n\n<li><b>Pooling<\/b> - Kyselyss\u00e4 asiakkaat kysyv\u00e4t s\u00e4\u00e4nn\u00f6llisesti j\u00e4rjestelm\u00e4lt\u00e4, onko uusia tapahtumia tai tietoja.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Jalokivet<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><a href=\"https:\/\/github.com\/edisonywh\/rocketman\" rel=\"nofollow\">https:\/\/github.com\/edisonywh\/rocketman<\/a><\/p>\n<\/li>\n\n\n\n<li>\n<p><a href=\"https:\/\/github.com\/krisleech\/wisper\" rel=\"nofollow\">https:\/\/github.com\/krisleech\/wisper<\/a><\/p>\n<\/li>\n\n\n\n<li>\n<p><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">https:\/\/github.com\/stevo\/pubsub<em>osoitteessa<\/em>kiskot<\/a><\/p>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Yhteenveto<\/h2>\n\n\n\n<p>Pub\/sub ei ole yleinen l\u00e4hestymistapa Ruby in Railsissa. Kuten artikkelissa esitell\u00e4\u00e4n, t\u00e4m\u00e4 malli voi tuoda monia etuja projektille - se voi tehd\u00e4 koodista siisti\u00e4, irrottaa palvelut toisistaan ja tehd\u00e4 niist\u00e4 helposti skaalautuvia.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/contact\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/interested_in_cooperation_.png\" alt=\"yhteisty\u00f6banneri\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Pub\/Sub voi tuoda monia etuja projektille - se voi tehd\u00e4 koodista siisti\u00e4, irrottaa palvelut toisistaan ja tehd\u00e4 niist\u00e4 helposti skaalautuvia. Lue lis\u00e4\u00e4 Pub\/Subista seuraavasta artikkelista ja nosta projektisi tasoa!<\/p>","protected":false},"author":2,"featured_media":3428,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[12],"class_list":["post-3427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-it"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Learn More about Ruby on Rails with Pub\/Sub - The Codest<\/title>\n<meta name=\"description\" content=\"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/fi\/blogi\/opi-lisaa-ruby-on-railsista-pub-subin-avulla\/\" \/>\n<meta property=\"og:locale\" content=\"fi_FI\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn More about Ruby on Rails with Pub\/Sub\" \/>\n<meta property=\"og:description\" content=\"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/fi\/blogi\/opi-lisaa-ruby-on-railsista-pub-subin-avulla\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-07T10:33:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-09T13:04:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Learn More about Ruby on Rails with Pub\\\/Sub\",\"datePublished\":\"2022-12-07T10:33:06+00:00\",\"dateModified\":\"2026-03-09T13:04:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"},\"wordCount\":778,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"keywords\":[\"IT\"],\"articleSection\":[\"Software Development\"],\"inLanguage\":\"fi\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\",\"name\":\"Learn More about Ruby on Rails with Pub\\\/Sub - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"datePublished\":\"2022-12-07T10:33:06+00:00\",\"dateModified\":\"2026-03-09T13:04:35+00:00\",\"description\":\"Explore the Pub\\\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#breadcrumb\"},\"inLanguage\":\"fi\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fi\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn More about Ruby on Rails with Pub\\\/Sub\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fi\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fi\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fi\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/fi\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Lis\u00e4tietoja Ruby on Rails with Pub\/Sub - The Codest - The Codest:st\u00e4","description":"Tutustu Pub\/Sub-suunnittelumalliin Ruby on Rails:ss\u00e4 ja n\u00e4e, miten se mahdollistaa tapahtumapohjaisen viestinn\u00e4n ja skaalautuvan j\u00e4rjestelm\u00e4arkkitehtuurin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/fi\/blogi\/opi-lisaa-ruby-on-railsista-pub-subin-avulla\/","og_locale":"fi_FI","og_type":"article","og_title":"Learn More about Ruby on Rails with Pub\/Sub","og_description":"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.","og_url":"https:\/\/thecodest.co\/fi\/blogi\/opi-lisaa-ruby-on-railsista-pub-subin-avulla\/","og_site_name":"The Codest","article_published_time":"2022-12-07T10:33:06+00:00","article_modified_time":"2026-03-09T13:04:35+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Learn More about Ruby on Rails with Pub\/Sub","datePublished":"2022-12-07T10:33:06+00:00","dateModified":"2026-03-09T13:04:35+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"wordCount":778,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","keywords":["IT"],"articleSection":["Software Development"],"inLanguage":"fi","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","url":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","name":"Lis\u00e4tietoja Ruby on Rails with Pub\/Sub - The Codest - The Codest:st\u00e4","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","datePublished":"2022-12-07T10:33:06+00:00","dateModified":"2026-03-09T13:04:35+00:00","description":"Tutustu Pub\/Sub-suunnittelumalliin Ruby on Rails:ss\u00e4 ja n\u00e4e, miten se mahdollistaa tapahtumapohjaisen viestinn\u00e4n ja skaalautuvan j\u00e4rjestelm\u00e4arkkitehtuurin.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb"},"inLanguage":"fi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"]}]},{"@type":"ImageObject","inLanguage":"fi","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Learn More about Ruby on Rails with Pub\/Sub"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fi"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"fi","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"fi","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/fi\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/posts\/3427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/comments?post=3427"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/posts\/3427\/revisions"}],"predecessor-version":[{"id":7913,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/posts\/3427\/revisions\/7913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/media\/3428"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/media?parent=3427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/categories?post=3427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/fi\/wp-json\/wp\/v2\/tags?post=3427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}