Nos últimos anos Sidekiq se tornou uma das principais ferramentas relacionadas à processamento assíncrono na comunidade Ruby.
Trabalhei com suas versões open source, pro e enterprise, e após mais de 3 bilhões de jobs processados aprendi algumas lições, algumas à duras penas.
Nesta palestra irei falar sobre Sidekiq, suas versões e sobre pequenos detalhes que fazem toda a diferença quando o utilizamos em larga escala.
This document introduces React, describing it as a JavaScript library for building user interfaces by rendering components rather than mutating the DOM directly. It discusses how React uses a virtual DOM for fast re-rendering, building components instead of templates, and the use of JSX syntax to write HTML-like code. Components have state and props, and the whole app re-renders when state changes to guarantee updates.
Gives a brief introduction of the emerging containerization technology, the difference in traditional VMs and Conatiners and the most popular one- Docker
React is a JavaScript library for building user interfaces. It was created by Facebook and is best for building dynamic websites like chat applications. React uses a virtual DOM for efficiently updating the view after data changes. Components are the building blocks of React and can contain state and props. The document provides an example of a simple component class and demonstrates how to add state and props. It also includes links to example code and MicroPyramid's social media profiles.
Modularizing a project is never easy, a lot of files to move and the dependencies between them is not always what we expect. Then the Dagger configuration used in a single module project often doesn't scale well to a multi module project. Hilt is opinionated about the configuration to use (we don't need to argue anymore about using component dependencies or subcomponents!) and this configuration works perfectly even in a multi module project. In this talk we'll see first an introduction to Hilt and a comparison with Dagger to understand why it's easier to configure. Then we'll see how to leverage it in a multi module project (both in a standard layered architecture and in a Clean Architecture that uses the Dependency Inversion) to improve build speed and code testability. Spoiler alert: using sample apps that include a single feature in the app helps a lot!
Managing an OSGi Framework with Apache Felix Web ConsoleFelix Meschberger
Initially created to aid in the simple maintenance of the OSGi framework and the application during the early development of Apache Sling, the Web Console soon attracted interest from the OSGi community. Three years later, the Apache Felix Web Console 3.0 has just been released and provides an extensible console for Web based management of an OSGi framework. This talk will introduce the functionality of the core Web Console as well as some of its existing plugins and the extension points of the Web Console where developers might want to hook up to. To round it up a simple Web Console plugin will be developed and deployed.
This document introduces React, describing it as a JavaScript library for building user interfaces by rendering components rather than mutating the DOM directly. It discusses how React uses a virtual DOM for fast re-rendering, building components instead of templates, and the use of JSX syntax to write HTML-like code. Components have state and props, and the whole app re-renders when state changes to guarantee updates.
Gives a brief introduction of the emerging containerization technology, the difference in traditional VMs and Conatiners and the most popular one- Docker
React is a JavaScript library for building user interfaces. It was created by Facebook and is best for building dynamic websites like chat applications. React uses a virtual DOM for efficiently updating the view after data changes. Components are the building blocks of React and can contain state and props. The document provides an example of a simple component class and demonstrates how to add state and props. It also includes links to example code and MicroPyramid's social media profiles.
Modularizing a project is never easy, a lot of files to move and the dependencies between them is not always what we expect. Then the Dagger configuration used in a single module project often doesn't scale well to a multi module project. Hilt is opinionated about the configuration to use (we don't need to argue anymore about using component dependencies or subcomponents!) and this configuration works perfectly even in a multi module project. In this talk we'll see first an introduction to Hilt and a comparison with Dagger to understand why it's easier to configure. Then we'll see how to leverage it in a multi module project (both in a standard layered architecture and in a Clean Architecture that uses the Dependency Inversion) to improve build speed and code testability. Spoiler alert: using sample apps that include a single feature in the app helps a lot!
Managing an OSGi Framework with Apache Felix Web ConsoleFelix Meschberger
Initially created to aid in the simple maintenance of the OSGi framework and the application during the early development of Apache Sling, the Web Console soon attracted interest from the OSGi community. Three years later, the Apache Felix Web Console 3.0 has just been released and provides an extensible console for Web based management of an OSGi framework. This talk will introduce the functionality of the core Web Console as well as some of its existing plugins and the extension points of the Web Console where developers might want to hook up to. To round it up a simple Web Console plugin will be developed and deployed.
This document provides an overview of HashiCorp Vault for securely storing, accessing, and managing secrets. It discusses how Vault can be used to securely store secrets like API keys, passwords, and certificates. The document outlines Vault's architecture, data storage options, authentication methods, policies for access control, and integrating systems using Vault. It also provides an agenda for a demonstration of Spring Cloud Vault integration for retrieving database credentials from Vault and using them to connect to a MySQL database.
The document discusses JavaScript events and event handling. It covers the different phases of events, how to define event handlers, the event object, and how to cancel bubbling and override default browser actions. It also provides examples of handling mouse and keyboard events, such as changing an element's style on mouseover and logging key events.
The document discusses monolithic architecture and different types of monoliths. It argues that a physical monolith is often the best initial approach and that problems typically arise from logical monoliths that lack clear boundaries. A modular monolith is proposed as an optimal architecture, with distinct modules but a shared codebase and deployment. The document also covers techniques for implementing modular monoliths, such as defining module boundaries, startup classes per module, and routing.
- Axios is a JavaScript library that allows you to make HTTP requests from node.js or XMLHttpRequests in the browser. It supports making requests, intercepting requests and responses, and transforming data.
- To use Axios with React, it must be installed via npm, yarn, or by including it from a CDN. Common installation commands are provided.
- The response and error objects returned from Axios requests contain useful information like the data, status code, headers, and original request configuration.
The document provides an introduction to React, a JavaScript library for building user interfaces. It discusses key React concepts like components, properties, state, one-way data flow, and JSX syntax. It also covers setting up a development environment with Create React App and shows how to create a basic React component with state. The target audience appears to be people new to React who want to learn the fundamentals.
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker, Inc.
This document provides an overview of Docker Hub, including its history and features. Docker Hub is a cloud registry service that allows users to share applications and automate workflows. It currently has over 240,000 users, 150,000 repositories, and handles over 1 billion pulls annually. The document discusses Docker Hub's growth over time and upcoming features like improved performance, automated builds using Kubernetes, and a redesigned user interface.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
Docker is a tool that allows users to package applications into containers to run on Linux servers. Containers provide isolation and resource sharing benefits compared to virtual machines. Docker simplifies deployment of containers by adding images, repositories and version control. Popular components include Dockerfiles to build images, Docker Hub for sharing images, and Docker Compose for defining multi-container apps. Docker has gained widespread adoption due to reducing complexity of managing containers across development and operations teams.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
This document provides an overview of Flask, a Python-based web application framework. It begins with an introduction to Flask, explaining what Flask is and its advantages like being open source with a large community. It then covers topics like installing Flask, creating Flask applications, routing, templates, static files, the request object, cookies, redirects and errors. It concludes by mentioning some popular Flask extensions that add additional functionality for tasks like email, forms, databases and AJAX. The document appears to be from an online training course on Flask and aims to teach the basics of how to use the Flask framework to build web applications.
This document discusses callback functions in JavaScript. A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action. Callback functions allow asynchronous code execution in JavaScript by performing tasks without blocking subsequent code from running. Common examples of callbacks include functions used in event handling and asynchronous operations like AJAX requests.
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesHoward Greenberg
While installing a new HCL Domino server is a relatively straight forward task, configuring the server properly requires knowledge. Lacking this knowledge means that several key steps may be missed resulting in a server with potential security and performance issues. Additionally there are several key features that will save you time on administration of the server. Domino server settings also affect the performance and security of custom applications. Even if you are a developer you should be aware of the options available when configuring a server.
Join our incredibly experienced presenters as they share their many years of Domino expertise. They will cover the finer details to correctly setup a Domino server environment that is optimized for performance, security and sustainable administration. Plus use this information presented in this webinar to modify and improve your existing server environment.
Presenters:
Heather Hottenstein, HCL Ambassador
Roberto Boccadoro, HCL Ambassador
Serdar Basegmez, HCL Ambassador
Additonal Panelists (Q and A)
John Paganetti, HCL
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!pyrasis
도커 무작정 따라하기
- 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커의 기본 개념부터 설치와 사용 방법까지 설명합니다.
더 자세한 내용은 가장 빨리 만나는 도커(Docker)를 참조해주세요~
http://www.pyrasis.com/private/2014/11/30/publish-docker-for-the-really-impatient-book
This document provides instructions for configuring LDAP and SAMBA to integrate Linux and Windows networks. It describes installing and configuring OpenLDAP to set up the LDAP directory and backend, then loading schemas and creating the administrator entry. Configuration files for the LDAP client are also edited to point to the LDAP server. The objective is to enable compatibility between Linux and Windows systems through Samba using users from the LDAP directory tree.
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetchRedis Labs
This document summarizes the XFetch algorithm, which uses probabilistic early recomputation to prevent cache stampedes. It describes how cache stampedes can occur when cached values expire and multiple servers simultaneously try to recompute and cache the value. XFetch volunteers one server to recompute the value before expiration, eliminating cache misses. The algorithm uses a random number to determine if a server should recompute early. More than one server could potentially recompute, but this minimizes lock contention. The document provides sample code and discusses determining recompute times and the beta parameter.
React is a JavaScript framework used for building user interfaces. It uses components as the building blocks for user interfaces and embraces functional programming principles like immutable data and pure functions. The key aspects of React include JSX which allows writing HTML in JavaScript files, components which are functions that output HTML, and hooks which allow components to interact with state and lifecycle events.
Vault is a tool for securely accessing secrets. It encrypts and stores secrets and enforces strict access controls. Secrets have a limited lifetime and must be renewed. Vault supports dynamic secret generation, revocation of access, and audit logging. It uses Shamir's secret sharing algorithm to split encryption keys across Vault servers for high availability.
The document discusses Docker architecture and workflow. It outlines the key components of Docker including the Docker client, host, objects like images and containers, and Docker registry. It also contrasts traditional application deployment with using Docker, noting Docker allows for portable deployment of applications and their dependencies through use of containers.
O documento resume as principais funcionalidades do framework Rails para desenvolvimento web utilizando a linguagem Ruby, como a arquitetura MVC, convenções sobre configuração e padrão REST. Também apresenta os passos iniciais para criação de uma aplicação Rails para gerenciamento de finanças pessoais.
Coisas que aprendi e quero passar adiante - RubyConf Brasil 2010lucashungaro
Palestra apresentada na RubyConf Brasil 2010 mostrando dicas de bibliotecas úteis para aplicações web escritas em Rails e maneiras para conseguir código flexível, fácil de testar e modificar utilizando SOLID, defensive programming e outras técnicas.
This document provides an overview of HashiCorp Vault for securely storing, accessing, and managing secrets. It discusses how Vault can be used to securely store secrets like API keys, passwords, and certificates. The document outlines Vault's architecture, data storage options, authentication methods, policies for access control, and integrating systems using Vault. It also provides an agenda for a demonstration of Spring Cloud Vault integration for retrieving database credentials from Vault and using them to connect to a MySQL database.
The document discusses JavaScript events and event handling. It covers the different phases of events, how to define event handlers, the event object, and how to cancel bubbling and override default browser actions. It also provides examples of handling mouse and keyboard events, such as changing an element's style on mouseover and logging key events.
The document discusses monolithic architecture and different types of monoliths. It argues that a physical monolith is often the best initial approach and that problems typically arise from logical monoliths that lack clear boundaries. A modular monolith is proposed as an optimal architecture, with distinct modules but a shared codebase and deployment. The document also covers techniques for implementing modular monoliths, such as defining module boundaries, startup classes per module, and routing.
- Axios is a JavaScript library that allows you to make HTTP requests from node.js or XMLHttpRequests in the browser. It supports making requests, intercepting requests and responses, and transforming data.
- To use Axios with React, it must be installed via npm, yarn, or by including it from a CDN. Common installation commands are provided.
- The response and error objects returned from Axios requests contain useful information like the data, status code, headers, and original request configuration.
The document provides an introduction to React, a JavaScript library for building user interfaces. It discusses key React concepts like components, properties, state, one-way data flow, and JSX syntax. It also covers setting up a development environment with Create React App and shows how to create a basic React component with state. The target audience appears to be people new to React who want to learn the fundamentals.
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker, Inc.
This document provides an overview of Docker Hub, including its history and features. Docker Hub is a cloud registry service that allows users to share applications and automate workflows. It currently has over 240,000 users, 150,000 repositories, and handles over 1 billion pulls annually. The document discusses Docker Hub's growth over time and upcoming features like improved performance, automated builds using Kubernetes, and a redesigned user interface.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
Docker is a tool that allows users to package applications into containers to run on Linux servers. Containers provide isolation and resource sharing benefits compared to virtual machines. Docker simplifies deployment of containers by adding images, repositories and version control. Popular components include Dockerfiles to build images, Docker Hub for sharing images, and Docker Compose for defining multi-container apps. Docker has gained widespread adoption due to reducing complexity of managing containers across development and operations teams.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
This document provides an overview of Flask, a Python-based web application framework. It begins with an introduction to Flask, explaining what Flask is and its advantages like being open source with a large community. It then covers topics like installing Flask, creating Flask applications, routing, templates, static files, the request object, cookies, redirects and errors. It concludes by mentioning some popular Flask extensions that add additional functionality for tasks like email, forms, databases and AJAX. The document appears to be from an online training course on Flask and aims to teach the basics of how to use the Flask framework to build web applications.
This document discusses callback functions in JavaScript. A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action. Callback functions allow asynchronous code execution in JavaScript by performing tasks without blocking subsequent code from running. Common examples of callbacks include functions used in event handling and asynchronous operations like AJAX requests.
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesHoward Greenberg
While installing a new HCL Domino server is a relatively straight forward task, configuring the server properly requires knowledge. Lacking this knowledge means that several key steps may be missed resulting in a server with potential security and performance issues. Additionally there are several key features that will save you time on administration of the server. Domino server settings also affect the performance and security of custom applications. Even if you are a developer you should be aware of the options available when configuring a server.
Join our incredibly experienced presenters as they share their many years of Domino expertise. They will cover the finer details to correctly setup a Domino server environment that is optimized for performance, security and sustainable administration. Plus use this information presented in this webinar to modify and improve your existing server environment.
Presenters:
Heather Hottenstein, HCL Ambassador
Roberto Boccadoro, HCL Ambassador
Serdar Basegmez, HCL Ambassador
Additonal Panelists (Q and A)
John Paganetti, HCL
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!pyrasis
도커 무작정 따라하기
- 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커의 기본 개념부터 설치와 사용 방법까지 설명합니다.
더 자세한 내용은 가장 빨리 만나는 도커(Docker)를 참조해주세요~
http://www.pyrasis.com/private/2014/11/30/publish-docker-for-the-really-impatient-book
This document provides instructions for configuring LDAP and SAMBA to integrate Linux and Windows networks. It describes installing and configuring OpenLDAP to set up the LDAP directory and backend, then loading schemas and creating the administrator entry. Configuration files for the LDAP client are also edited to point to the LDAP server. The objective is to enable compatibility between Linux and Windows systems through Samba using users from the LDAP directory tree.
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetchRedis Labs
This document summarizes the XFetch algorithm, which uses probabilistic early recomputation to prevent cache stampedes. It describes how cache stampedes can occur when cached values expire and multiple servers simultaneously try to recompute and cache the value. XFetch volunteers one server to recompute the value before expiration, eliminating cache misses. The algorithm uses a random number to determine if a server should recompute early. More than one server could potentially recompute, but this minimizes lock contention. The document provides sample code and discusses determining recompute times and the beta parameter.
React is a JavaScript framework used for building user interfaces. It uses components as the building blocks for user interfaces and embraces functional programming principles like immutable data and pure functions. The key aspects of React include JSX which allows writing HTML in JavaScript files, components which are functions that output HTML, and hooks which allow components to interact with state and lifecycle events.
Vault is a tool for securely accessing secrets. It encrypts and stores secrets and enforces strict access controls. Secrets have a limited lifetime and must be renewed. Vault supports dynamic secret generation, revocation of access, and audit logging. It uses Shamir's secret sharing algorithm to split encryption keys across Vault servers for high availability.
The document discusses Docker architecture and workflow. It outlines the key components of Docker including the Docker client, host, objects like images and containers, and Docker registry. It also contrasts traditional application deployment with using Docker, noting Docker allows for portable deployment of applications and their dependencies through use of containers.
O documento resume as principais funcionalidades do framework Rails para desenvolvimento web utilizando a linguagem Ruby, como a arquitetura MVC, convenções sobre configuração e padrão REST. Também apresenta os passos iniciais para criação de uma aplicação Rails para gerenciamento de finanças pessoais.
Coisas que aprendi e quero passar adiante - RubyConf Brasil 2010lucashungaro
Palestra apresentada na RubyConf Brasil 2010 mostrando dicas de bibliotecas úteis para aplicações web escritas em Rails e maneiras para conseguir código flexível, fácil de testar e modificar utilizando SOLID, defensive programming e outras técnicas.
O documento discute padrões de projeto no Rails, incluindo: (1) os problemas iniciais com plugins que abusavam de monkey patch; (2) a discussão sobre colocar código no modelo ou controlador; e (3) como padrões como POROs, dependency injection e break out method object podem melhorar a manutenibilidade do código.
Como ser programador durante o dia e mesmo assim dormir bem à noiteComunidade NetPonto
O documento apresenta exemplos de logs de uma aplicação SVN que registam as ações dos utilizadores no repositório. São apresentadas duas formas de fazer logging: de forma errada, apenas registando mensagens de erro, e de forma correta, usando uma biblioteca de logging estruturada e gravando logs de diferentes níveis. É explicado como a instrumentação e testes automatizados ajudam a detetar e corrigir problemas mais rapidamente.
Este documento fornece uma introdução ao teste de aplicações Rails usando o framework RSpec. Resume as principais ideias apresentadas em 3 frases ou menos:
1) O documento introduz o framework RSpec para testes automatizados em aplicações Rails, descrevendo como configurar e gerar testes para modelos, controladores, helpers e views.
2) É enfatizado o workflow Red-Green-Refactor para escrever testes, começando com testes que falham e depois fazendo-os passar, além de apresentar exemplos passo-a-passo de
TDC2016POA | Trilha Android - Testes no Androidtdc-globalcode
O documento discute testes no Android, abordando conceitos como mocks, frameworks de teste, organização de testes e como testar dependências externas. Ele também fornece dicas sobre por onde começar a escrever testes e como garantir uma execução tranquila.
TDC2016POA | Trilha Android - Testes no Androidtdc-globalcode
O documento discute conceitos e práticas de testes no Android, incluindo: 1) razões para escrever testes como garantir funcionamento e documentar comportamento; 2) tipos de testes como unitários e de interface do usuário; 3) ferramentas para testes como JUnit, Espresso e Mockito.
Presented at Mobile Conf Rio 2014, Brazil. The content is in Brazilian Portuguese. Discussion of the Delegate pattern and its implementation in iOS API. Samples from the SDK and a custom interaction using delegates. Shows techniques such as performSelector: calls, delegation through protocol and delegation using blocks. Code samples: https://github.com/osnipso/mobileconf2014
Caelum IP-67 course on iOS (in Brazilian Portuguese): http://www.caelum.com.br/curso-ios-iphone-ipad/
O documento discute os benefícios da automação, incluindo aumento da produtividade ao liberar tempo para atividades criativas, manutenção do controle e padronização de processos, e flexibilidade para adaptar rotinas e tomadas de decisão. Ele fornece exemplos de scripts em Perl para automatizar tarefas comuns na ferramenta Zabbix, como encontrar hosts monitorados por um proxy específico e mover hosts entre proxies.
Hibernate efetivo (IA-2014 / Disturbing the Mind)Rafael Ponte
Mesmo anos após o lançamento do Hibernate ainda é fácil encontrar projetos utilizando o framework de maneira ineficiente, podendo leva-lo a problemas sérios de performance ou até inviabilizar a aplicação. O uso não efetivo do Hibernate está intimamente ligado a erros comuns e más práticas em sua utilização, que vão desde pool de conexões, select n+1, configuração de cache, batch-size até o uso indevido do cache level 1 em processamentos batch e o tratamento de LazyInitializationException.
Palestra ministrada no evento Disturbing the Mind 2014 do Instituto Atlântico (IA).
Uma palestra para explorar o Google App Engine (GAE), uma plataforma de desenvolvimento e hospedagem de aplicações web na nuvem. Aplicativos fáceis de criar, manter e escalar.
Palestrante: Carlos Duarte do Nascimento
Matemático pelo IME/USP e Gerente de Produto no Apontador, faz "artesanato" de software há 20 anos, defendendo plataformas e conteúdo livres.
O documento apresenta uma introdução ao desenvolvimento de aplicações na plataforma Google App Engine usando a linguagem Python. Em três frases ou menos, o documento explica como iniciar um projeto simples no App Engine, mapeia URLs para código Python e armazena e consulta dados no banco de dados do App Engine.
Recentemente foi anunciada a versão 3.0 do Tornado, um framework web non-blocking escrito para lidar com milhares de conexões simultâneas. Umas das grandes mudanças é o suporte a "Futures", introduzida no python 3.2 para dar mais poder aos tradicionais callbacks. Iremos conhecer as principais funcionalidades do Tornado, ressaltando as novidades implementadas na última versão, e comentar sobre as novas tendências para a programação assíncrona no python.
Curso: Desenvolvimento de aplicativos híbridos (dia 2)Wennder Santos
O documento apresenta a agenda do segundo dia de um curso sobre desenvolvimento de aplicativos híbridos, abordando tópicos como automatização de tarefas, testes automatizados, testes de interface do usuário, integração e distribuição contínuas, e publicação de aplicativos na loja Google Play.
Os 10 Maus Hábitos dos Desenvolvedores JSFtarsobessa
O documento lista os 10 piores hábitos de desenvolvedores JSF e fornece soluções para cada um. Os hábitos incluem usar tags JSTL incorretamente, não entender o ciclo de vida do JSF e implementar mecanismos de segurança personalizados em vez de frameworks. As soluções envolvem usar componentes JSF corretamente, dividir formulários em subformulários e entender completamente o ciclo de vida do JSF.
O documento resume as etapas para desenvolver um jogo da velha (tic tac toe) usando ReactJS. As principais etapas incluem: 1) Criar as classes Square, Board e Game para representar os componentes do jogo; 2) Adicionar dinâmica ao jogo armazenando o estado dos botões clicados usando this.state; 3) Melhorar o controle do jogo armazenando o estado geral no componente Board.
This document discusses how to quickly build web applications using the Django framework. It covers installing Django, creating models and templates, and building a basic job listing application. The goal is to demonstrate how Django allows for rapid development through features like automatic administration interfaces, URL routing, and object relational mapping.
O documento discute o uso da tecnologia Node.js para construir uma API de pagamentos. Ele explica porque Node.js é adequado para este tipo de aplicação devido à sua natureza assíncrona e orientada a eventos, permitindo lidar com muitas requisições simultâneas de forma escalável. O documento também discute problemas comuns de Node.js e como evitá-los, além de abordar tópicos como infraestrutura, testes e monitoramento.
Palestra apresentada no The Developers Conference São Paulo 2018 na Trilha Android.
A ideia dessa apresentação é dar uma visão geral sobre os principais tópicos do desenvolvimento Android utilizados atualmente, tais como: Kotlin, MVP, MVVM, Architecture Components, ConstraintLayout, RXJava, Firebase e testes.
Nesta palestra eu apresento a ferramenta de linha de comando do Angular, a Angular CLI mostro como ela pode facilitar o dia a dia no desenvolvimento de uma aplicação.
Semelhante a O que aprendi após 3 bilhões de jobs processados no Sidekiq (20)
9. class ImagesController < ApplicationController
def create
@image = Image.create(params[:image])
@image.process
end
end
operação síncrona bloqueante
10. class ImagesController < ApplicationController
def create
@image = Image.create(params[:image])
ImageProcessor.perform_async(@image.id)
end
end
operação assíncrona não bloqueante
18. diversas formas de executar
sidekiq # executa com a configuração padrão
sidekiq -c 25 # 25 de concorrência
sidekiq -q default -q high # executa duas filas
24. class NamedParamsWorker
include Sidekiq::Worker
def perform(a: , b: )
...
end
end
RSpec.describe NamedParamsWorker do
describe '#perform' do
it 'prints information' do
subject.perform(a: 1, b: 1)
end
end
end
seus testes unitários podem te enganar
class HashParamsWorker
include Sidekiq::Worker
def perform(params)
logger.info params[:a]
end
end
RSpec.describe HashParamsWorker do
describe '#perform' do
it 'prints information' do
subject.perform(a: 1, b: 1)
end
end
end
25. RSpec.describe NamedParamsWorker do
describe '#perform' do
it 'prints information' do
subject.perform(a: 1, b: 1)
end
end
end
RSpec.describe HashParamsWorker do
describe '#perform' do
it 'prints information' do
subject.perform(a: 1, b: 1)
end
end
end
seus testes unitários podem te enganar
26. require 'sidekiq/testing'
RSpec.describe NamedParamsWorker do
describe '#perform' do
it 'prints information' do
Sidekiq::Testing.inline! do
described_class.perform_async(a: 1, b: 1)
end
end
end
end
teste utilizando chamada inline, funciona?
27. RSpec.describe HashParamsWorker do
describe '#perform' do
it 'prints information' do
described_class.perform_async(a: 1, b: 1)
described_class.drain
end
end
end
utilize o .drain para simular as chamadas
reais à API do Sidekiq
29. class ReportWorker
include Sidekiq::Worker
def perform(until_date)
objects = Model.where('created_at <= ?', until_date)
end
end
# Fri, 20 Oct 2017 19:00:00 BRST -02:00
ReportWorker.perform_async(1.day.ago)
o que acontece se:
32. class ReportWorker
include Sidekiq::Worker
def perform(until_date)
parsed_time = Time.zone.parse(until_date)
objects = Model.where('created_at <= ?', parsed_time)
end
end
sempre que receber uma data,
faça parse dela no timezone atual
35. salvando histórico de intenções de compra
class PurchasesController < ApplicationController
def new
@product = Product.find(params[:product_id])
StorePurchaseIntentWorker.perform_async(current_user.id,
@product.id)
end
end
36. salvando histórico de intenções de compra
class StorePurchaseIntentWorker
include Sidekiq::Worker
def perform(user_id, product_id)
PurchaseIntent.create(user_id: user_id,
product_id: product_id)
end
end
37. salvando histórico de intenções de compra
class StorePurchaseIntentWorker
include Sidekiq::Worker
def perform(user_id, product_id)
PurchaseIntent.create(user_id: user_id,
product_id: product_id)
end
end
38. salvando histórico de intenções de compra
class StorePurchaseIntentWorker
include Sidekiq::Worker
def perform(user_id, product_id, created_at)
PurchaseIntent.create(
user_id: user_id,
product_id: product_id,
created_at: Time.zone.parse(created_at)
)
end
end
40. processando compras com cartão de crédito
class CreditCardPurchaseWorker
include Sidekiq::Worker
def perform(purchase_id, number, name, expiration_date, cvc)
...
end
end
42. credit_card_params = {
number: '4444333322221111', name: 'Joao Silva',
expiration_date: ’10/20', cvc: '123'
}
json_credit_card_params = credit_card_params.to_json
SecureCreditCardPurchaseWorker.perform_async(
14151,
json_credit_card_params.encrypt(
:symmetric,
password: ENV['SECRET_KEY_BASE']
)
)
criptografando os dados do cartão
43. decriptografando os dados do cartão
class SecureCreditCardPurchaseWorker
include Sidekiq::Worker
def perform(purchase_id, cryptographed_credit_card)
@cryptographed_credit_card = cryptographed_credit_card
credit_card_information = JSON.parse(decrypted_credit_card)
puts credit_card_information['number']
end
private
def decrypted_credit_card
@cryptographed_credit_card.decrypt(
:symmetric,
password: ENV['SECRET_KEY_BASE']
)
end
end
55. crie uma forma fácil de ativar/desativar
logs através de ENV vars
# config/initializers/sidekiq.rb
if (ENV["SIDEKIQ_LOGS_DISABLED"] == "true")
Sidekiq::Logging.logger = nil
end
60. qual o erro aqui?
batch = Sidekiq::Batch.new
products.find_each do |product|
batch.jobs { ProductWorker.perform_async(product.id) }
end
61. agende todos os jobs dentro
de uma única chamada de batch.jobs
batch = Sidekiq::Batch.new
batch.jobs do
products.find_each do |product|
ProductWorker.perform_async(product.id)
end
end
63. o que acontece?
batch = Sidekiq::Batch.new
batch.jobs do
UniqueWorker.perform_async(1)
raise
end
batch = Sidekiq::Batch.new
batch.jobs do
UniqueWorker.perform_async(1)
UniqueWorker.perform_async(2)
end
64.
65. não, o sidekiq só processou 1 job do batch
https://github.com/mperham/sidekiq/issues/3662
67. qual o problema aqui?
class EnqueueInvitationEmailWorker
include Sidekiq::Worker
def perform
batch = Sidekiq::Batch.new
batch.jobs do
while attributes = EmailSerializer.pop
SendInvitationEmailWorker.perform_async(attributes)
end
end
end
end
68. nesse caso é melhor não utilizar batch
class EnqueueInvitationEmailWorker
include Sidekiq::Worker
def perform
while attributes = EmailSerializer.pop
SendInvitationEmailWorker.perform_async(attributes)
end
end
end
71. criptografando parâmetros manualmente
require 'encrypted_strings'
require 'json'
credit_card_params = {}.to_json
encrypted_params = credit_card_params.encrypt(:symmetric, password: ENV['SECRET_KEY_BASE'])
SecureCreditCardPurchaseWorker.perform_async(12, encrypted_params)
class SecureCreditCardPurchaseWorker
include Sidekiq::Worker
def perform(purchase_id, cryptographed_credit_card)
credit_card_information = decrypted_credit_card(cryptographed_credit_card)
end
def decrypted_credit_card(cryptographed_credit_card)
JSON.parse(cryptographed_credit_card.decrypt(:symmetric, password: ENV['SECRET_KEY_BASE']))
end
end
72. configurando a extensão ent encryption
# config/initializers/sidekiq.rb
version = ENV.fetch('SIDEKIQ_CRYPTO_VERSION')
Sidekiq::Enterprise::Crypto.enable(active_version: version) do |version|
Base64.decode64(ENV.fetch("SIDEKIQ_CRYPTO_KEY_V#{version}"))
end unless Rails.env.test?
# .env
SIDEKIQ_CRYPTO_VERSION=2
SIDEKIQ_CRYPTO_KEY_V1=XXXXXXXX
SIDEKIQ_CRYPTO_KEY_V2=YYYYYYYY
73. utilizando ent encryption em um worker
class SecureCreditCardPurchaseWorker
include Sidekiq::Worker
sidekiq_options encrypt: true
def perform(purchase_id, cryptographed_credit_card)
puts cryptographed_credit_card['number']
end
end
credit_card_params = {
number: '4444333322221111', name: 'Joao Silva',
expiration_date: '10/20', cvc: '123'
}
SecureCreditCardPurchaseWorker.perform_async(12341, credit_card_params)
79. PaymentProcessorWorker
queue: critical
ImageProcessorWorker
queue: default
SalesReportWorker
queue: low
Rápido e crítico Lento e não crítico Lento, pesado e não crítico
sidekiq -c 10 -q critical -q default -q low
10 50 1
múltiplas filas priorizadas
Pros Contras
Divisão clara de processos por
níveis de prioridade.
Existe risco de acúmulo de jobs
nas filas de menor prioridade se
houver alto volume de jobs nas
filas mais priorizadas.
80. PaymentProcessorWorker
queue: critical
ImageProcessorWorker
queue: default
SalesReportWorker
queue: low
Rápido e crítico Lento e não crítico Lento, pesado e não crítico
sidekiq -c 10 -q critical,4 -q default,2 -q low,1
10 50 1
múltiplas filas com pesos diferentes
Pros Contras
Com um único processo do
sidekiq você tem priorização
sem que as filas fiquem
esperando umas as outras.
Processos pesados ainda
podem interferir diretamente na
performance de processos
críticos.
81. PaymentProcessorWorker
queue: critical
ImageProcessorWorker
queue: default
SalesReportWorker
queue: low
Rápido e crítico Lento e não crítico Lento, pesado e não crítico
sidekiq -c 10 -q critical
10 50 1
processos isolados para cada queue
Pros Contras
Isolamento completo de cada fila
Controle de escala de cada
queue individual
Sonho?
Maior consumo de memória/
máquina
sidekiq -c 10 -q default sidekiq -c 2 -q low
86. monitorando o tamanho das filas
Sidekiq::Queue.all.each do |queue|
Enjoei::Metrics.event(
'SidekiqQueueReport', name: queue.name, size: queue.size
)
end
87. monitorando processos online
queues_processing = Sidekiq::ProcessSet.new.map do |p|
p['queues'].flatten
end.uniq
queues_processing.each do |queue|
Enjoei::Metrics.event(
'SidekiqOnlineQueueReport', name: queue
)
end
89. PaymentProcessorWorker
queue: critical
ImageProcessorWorker
queue: default
SalesReportWorker
queue: low
Rápido e crítico Lento e não crítico Lento, pesado e não crítico
sidekiq -c 10 -q critical
10 50 1
processos separados por criticidade
Pros Contras
Isolamento completo de filas
mais críticas
Permite escalar filas de forma
diferente
Maior consumo de memória/
máquina
sidekiq -c 10 -q default,2 -q low,1
98. processo com concorrência por causa
de rate limit da API de terceiro
# Antes:
sidekiq -q invoice -c 3
sidekiq -q coupon_reminder_emails -c 10
sidekiq -q counter_cache_update -c 10
# Depois:
sidekiq -q low -c 10
101. período de ociosidade vs concorrência
ociosidade concorrência leve concorrência pesada
102. proposta 1:
unificar processos em fila única
# Antes:
sidekiq -q read_only_default -c 10
sidekiq -q read_only_low -c 10
sidekiq -q read_only_high -c 10
# Depois:
sidekiq -q read_only -c 10
Pros Contras
Única fila para gerenciar
Para escalar basta subir um
novo processo
Não existe prioridade de
execução
Em momento de concorrência
irá somar o tempo de execução
103. proposta 2:
unificar filas por prioridade
# Antes:
sidekiq -q read_only_default -c 10
sidekiq -q read_only_low -c 10
sidekiq -q read_only_high -c 10
# Depois:
sidekiq -q read_only_high
-q read_only_default
-q read_only_low -c 10
Pros Contras
Prioridade na execução
Só executará processos com menos
prioridade quando acabarem os
prioritários
Em momento de concorrência irá somar
o tempo de execução
104. proposta 3:
unificar filas por peso
# Antes:
sidekiq -q read_only_default -c 10
sidekiq -q read_only_low -c 10
sidekiq -q read_only_high -c 10
# Depois:
sidekiq -q read_only_high,4
-q read_only_default,2
-q read_only_low,1 -c 10
Pros Contras
Para escalar basta subir um novo
processo
Irá processar simultaneamente todas
as filas com prioridades diferentes
Em momento de concorrência
irá somar o tempo de execução
105. proposta 4:
fila única e utilizar autoscale
# Antes:
sidekiq -q read_only_default -c 10
sidekiq -q read_only_low -c 10
sidekiq -q read_only_high -c 10
# Depois:
sidekiq -q read_only -c 10
Pros Contras
Única fila para gerenciar
Auto scaling vai aumentar número
de processos para dar vazão a
todas as filas quando houver picos
Sem um limite para auto scaling você
pode acabar consumindo muitos
recursos e derrubar sua base de dados
Pode demorar mais para processar os
jobs em momentos de picos
106. recursos sobre auto scaling
https://engenharia.elo7.com.br/sidekiq-workers/
http://www.pablocantero.com/blog/2013/05/04/auto-scale-sidekiq-workers-on-amazon-ec2/
http://manuelvanrijn.nl/blog/2012/11/13/scalable-heroku-worker-for-sidekiq/
http://blog.honeybadger.io/cleanly-scaling-sidekiq/
118. sidekiq -q default
workers por tipo de acesso aos dados
PaymentProcessorWorker
queue: default
ImageProcessorWorker
queue: default
SalesReportWorker
queue: readonly
SalesMailer.completed
queue: readonly
master
DATABASE_URL=$FOLLOWER_DATABASE_URL
sidekiq -q readonly
follower
replicação de dados
123. o que ocorre quando buscamos o produto?
class ProductMailer < ApplicationMailer
def published(product_id)
@product = Product.find(product_id)
...
end
end
class Product < ActiveRecord::Base
after_create do |product|
ProductMailer.delay.published(product.id)
end
end
124. cuidado com os callbacks do
ActiveRecord::Base
class ProductMailer < ApplicationMailer
def published(product_id)
@product = Product.find(product_id)
...
end
end
class Product < ActiveRecord::Base
after_create do |product|
ProductMailer.delay.published(product.id)
end
end
125. adicione um pequeno delay em
jobs que usam base follower
class ProductMailer < ApplicationMailer
def published(product_id)
@product = Product.find(product_id)
...
end
end
class Product < ActiveRecord::Base
after_create_commit do |product|
ProductMailer.delay_for(10.seconds).published(product.id)
end
end
126. sempre utilize callbacks de commit
class ProductMailer < ApplicationMailer
def published(product_id)
@product = Product.find(product_id)
...
end
end
class Product < ActiveRecord::Base
after_create_commit do |product|
ProductMailer.delay_for(10.seconds).published(product.id)
end
end
129. RubyApp::Workers::ProducerWorker
queue: ruby
ruby_app: sidekiq -q ruby
CrystalApp::Workers::ReceiverWorker
queue: crystal
crystal_app: sidekiq -q crystal
Toda a comunicação entre as
aplicações é feita através de
escritas em filas.
comunicando através de filas
138. nossa solução usando stack da AWS
Substitui a queue
do Sidekiq com
baixa latência.
Substitui os workers e
agrupa “jobs”
automaticamente.
Substitui a base.