Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Composição e Integração de Sistemas em 2013

2,233 views

Published on

  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Composição e Integração de Sistemas em 2013

  1. 1. COMPOSIÇÃO E INTEGRAÇÃO DE SISTEMAS EM 2013 Leandro Silva TDC 2013 http://leandrosilva.com.br @codezone http://github.com/leandrosilva
  2. 2. QUEM SOU EU?
  3. 3. LEANDRO SILVA @codezone •+15 na indústria (escrevendo software de produção) •Fissurado em programação (Ruby, Java, Erlang, Clojure, C#, F#) •Blogueiro preguiçoso (http://leandrosilva.com.br) •Já fui gerente de sistemas, arquiteto de sistemas, líder técnico, programador e instrutor de programação e arquitetura •Tenho código no GitHub (https://github.com/leandrosilva) •E perfil no LinkedIn (http://linkedin.com/in/lesilva)
  4. 4. NÃO SOU UM .NET EXPERT
  5. 5. CONSEGUE LIDAR COM ISSO?
  6. 6. PROSIGAMOS...
  7. 7. .NET NÃO É MAIS O PATINHO FEIO
  8. 8. ASP.NET MVC C# Entity Framework Web API F# Ninject Unit Testing Framework NUnit SignalR Reactive Extensions LINQ Razor HDInsight a.k.a. Hadoop on Azure async Redis Log4Net ActorFx The Actors Framework for Azure
  9. 9. “É POSSIVEL CONSTRUIR SISTEMAS BEM DECENTES COM .NET” – BlackWidow
  10. 10. COMUNIDADE hadoop rest json javascript redis unit testing mvc orm STANDARD OPEN SOURCE git
  11. 11. “NÃO QUEIRA BANCAR O GÊNIO. APENAS SIGA A DROGA DO PADRÃO!” – Nick Fury
  12. 12. COMO INTEGRAR SISTEMAS HOJE?
  13. 13. “SIMPLES. USE HTTP & JSON. E CRIE ALGUNS MICRO-SERVIÇOS.” –Tony Stark
  14. 14. “ESQUEÇA OS PROTOCOLOS PROPRIETÁRIOS. USE PADRÕES ABERTOS E CONHECIDOS DE TODOS.” –Tony Stark
  15. 15. “ATUALMENTE, SÓ CONSTRUO MEUS MICRO-SERVIÇOS USANDO ASP.NET MVC WEB API. É SIMPLES E MUITO SEXY.” – BlackWidow
  16. 16. AFINAL, O QUE SÃO MICRO-SERVIÇOS?
  17. 17. “NÃO HÁ UMA DEFINIÇÃO EXATA DO QUE É UM MICRO-SERVIÇO, MAS UMA SÉRIE DE PRINCÍPIOS QUE PODEM SER OBSERVADOS.” fracamente acoplados algumas poucas linhas de código favorecem a reescrita escritos em frameworks leves deployados independentemente web apis com poucas rotas domínio específico interface opaca favorecem a composição repositórios de código independentes uma responsabilidade
  18. 18. PRINCÍPIOS FUNDAMENTAIS PARA INTEGRAÇÃO DE SISTEMAS
  19. 19. PRINCÍPIOS FUNDAMENTAIS PARA INTEGRAÇÃO DE SISTEMAS O QUE VOCÊ PECISA SABER CRIAR EM PLENO 2013 * Nada do que vou dizer é tão novo assim. Sorry! INTEGRAR E
  20. 20. DECOMPOSIÇÃO THE ALMIGHTY WEB SERVICE BADASS MICRO SERVICE BADASS MICRO SERVICE BADASS MICRO SERVICE BADASS MICRO SERVICE BADASS MICRO SERVICE BADASS MICRO SERVICE “Todas as vezes que você tem um componente que faz 1000 coisas, com dezenas de dependentes, você sofre com a manutenção, com a escala do time de desenvolvimento e com a disponibilidade do serviço, só para citar alguns problemas.” (Cuidado! Compartilhar classes de domínio é legal, mas tende a migrar o gesso para outro lugar. Um pouco de duplicação de código “nem sempre” é um problema.)
  21. 21. COMPOSIÇÃO WEB MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MOBILE WORKER Application Domain Logic Application Domain Logic Application Domain Logic “Micro-serviços são como pacotes de procedimentos e funções, que as aplicações usam para compor suas próprias regras de negócio especializadas. Mas o ideal é que não sejam muito abrangentes.” (Regras de negócio que são fundamentais à empresa, devem estar contidas em micro-serviços. As demais, nas apps; ainda que haja uma ou outra duplicação de código.) (DICA: Windows Task Scheduler + cURL, por exemplo, já dá conta aqui. Não precisa nem reinventar a roda.) (É “micro”, lembra?!)
  22. 22. ESPECIALIZAÇÃO MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE “Cada micro-serviço deve ter uma única responsabilidade, com um contrato muito bem definido, e deve fazer muito bem o seu trabalho.” The Unix Way bitch! (Em alguns casos, você pode granularizar por domínio. Mas se o domínio for amplo, granularize ainda um pouco mais.)
  23. 23. ISOLAMENTO MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE “A falha em um micro- serviço não deve afetar os demais. Nem devem as apps consumidoras serem drasticamente afetadas.” puff! crash! Yeah, let it crash (A regra aqui é um Web API Project por micro- serviço. Quero dizer, um deploy por micro-serviço.) (Na hora de escalar, isso também vai te ajudar a botar recurso onde realmente precisa de recurso.)
  24. 24. SIMPLICIDADE APP MICRO SERVICE GET /top/secret/data/123 X-Auth-User: codezone X-Auth-Ticket: k3ki7s1mpl3stuff898sdATy7why3noT83ab POST /ticket X-Auth-User: codezone X-Auth-Request-Timestamp: 2013081506 X-Auth-Token: h3J87Ui2i90oLkLL8j4khUUij282h3 HTTP/1.1 200 OK X-Auth-Ticket: k3ki7s1mpl3stuff898sdATy7why3noT83ab AUTH DLL (Token = Hash(User + SecretKey + Timestamp)) (Lembre-se: Ticket precisa ter um tempo de validade) (Agora é só validar se existe esse ticket associado a esse usuário e se ele ainda está válido) Não precisa implementar IGUALZINHO. Isso é só uma idéia!
  25. 25. ASSINCRONICIDADE APP MICRO SERVICE GET /some/big/task/i7s898sdATy POST /some/big/task { “A”: “123”, “B”: “456” } HTTP/1.1 200 OK { “SomeBigTaskID”: “i7s898sdATy” } QUEUE WORKER DATABASE (Se a coisa pode demorar, fuja do síncrono!) (Uma outra abordagem aqui seria usar Web Hook. Ou seja, receber um post dizendo que o processo terminou.)
  26. 26. LOGGING MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE MICRO SERVICE EVENTVIEWER GRAYLOG LOG4NET (EventLog) (Gelf4Net) (Log tudo, absolutamente, tudo. Só tome cuidado com dados sensíveis. Não se empolgue!) (É interessante ter um identificador para a transação que está sendo logada, de modo que ela possa ser rastreada de ponta a ponta.) (Ah! E logar as mensagens em JSON também pode ser uma boa, viu?! Ajuda a parsear e extrair informações úteis.)
  27. 27. ACESSIBILIDADE POST http://codezo.ne/api/deliveries/new GET http://codezo.ne/api/deliveries/123 POST http://codezo.ne/api/deliveries/123/done DELETE http://codezo.ne/api/deliveries/123 POST http://codezo.ne/api/deliveries/tasks/sync POST http://codezo.ne/api/deliveries/123/refused GET http://codezo.ne/api/deliveries/doc “Se você não quiser que seu micro-serviço seja odiado logo de cara, você tem que prover uma boa URL e documentação facilmente acessível.” (DICA: Cuidado para não inchar a coisa. É sempre bom pensar na menor unidade de responsabilidade que seu micro- serviço pode ter. Às vezes, por exemplo, vale a pena botar as tasks em outro micro-serviço. Não se deixe levar apenas pela URI, porque ela é só uma interface com o usuário.)
  28. 28. RESUMINDO
  29. 29. Esqueças as soluções proprietárias e os protocolos pesados Use ASP.NET MVC Web API – é fácil, testável e tem tudo que você precisa Crie um projeto e um repositório por micro-serviço Mantenha seus micro-serviços bem pequenininhos – umas 100 LoC Se você não consegue ter um micro-serviço inteiro na sua cabeça, quebre-o! “Deploye” cada micro-serviço separadamente – hamm, app pools? Ofereça URIs amigáveis e auto-explicativas Tenha interfaces bem definidas e opacas para quem as vê Sempre que possível, use um fluxo assíncrono Autenticação/autorização simples – HTTP Header, user, token, ticket, expiration Filters e Attributes são seus amigos na hora de autenticar/autorizar, aproveite! Faça log tudo. Depois, faça log do que faltou Agregue seus logs em algum lugar – EventViewer e mais algum outro agregador Windows Task Scheduler + cURL + POST /tasks/do/something é legal Construa uma fachada para seu ERP, você vai ser muito mais feliz – vai por mim (In Memory Server para teste de integração) (isso vai ter ajudar a escalar o desenvolvimento) (não precisa ser tão purista em relação a REST) (tem que ser uma coisa binária, entra X, saí Y) (assim fica fácil de propagar) (só cuidado para não deixar a coisa inchada, use o princípio dos micro-serviços)
  30. 30. DÚVIDAS?
  31. 31. MUITO OBRIGADO! Leandro Silva TDC 2013 http://leandrosilva.com.br @codezone http://github.com/leandrosilva

×