Slide 1

Slide 1 text

Wild Microservices And Imaginary DevOps

Slide 2

Slide 2 text

@tolkv @lavcraft [email protected] 2

Slide 3

Slide 3 text

DISCLAIMER No warranty guarantee 3

Slide 4

Slide 4 text

4 Agenda → Theory → Practice → QA

Slide 5

Slide 5 text

5 → Theory → Practice → QA В программе: 1. Дикости 21го века – DevOps и Микросервисы 2. Немного интерактива 3. Проблемы понимания и внедрения этих дикостей 4. Поделюсь своей историей в их осознания a. Масштабирование на команды b. Выработанные принципы c. Используемые инструменты 5. Сделаем быстрые выводы (если успеем) Agenda

Slide 6

Slide 6 text

6 Кто так{ой,ая,ое} DevOps

Slide 7

Slide 7 text

С чего всё начинается

Slide 8

Slide 8 text

Давай займемся ДевОпсом

Slide 9

Slide 9 text

Давай займемся ДевОпсом Говорили они

Slide 10

Slide 10 text

Шары ДевОпса

Slide 11

Slide 11 text

Re: Re: Re: Re: Re: Re: …. Привет Y, Мне сказали ты можешь сделать нам X, сделай! У нас в проекте DevOps! С уважением Работник Большой Компании <Лого Компании>

Slide 12

Slide 12 text

Re: Re: Re: Re: Re: Re: …. Привет Дружище, мне сказали ты можешь помочь сделать нам X, помоги нам пожалуйста, ведь у нас в проекте DevOps! С уважением Работник Большой Компании <Лого Компании>

Slide 13

Slide 13 text

Re: Re: Re: Re: Re: Re: …. Привет Дружище, мне сказали ты можешь помочь сделать нам X, помоги нам пожалуйста, ведь у нас в проекте DevOps! С уважением Работник Большой Компании <Лого Компании>

Slide 14

Slide 14 text

Re: Re: Re: Re: Re: Re: …. Привет Дружище, мне сказали ты можешь помочь сделать нам X, помоги нам пожалуйста, ведь у нас в проекте DevOps! С уважением Работник Большой Компании <Лого Компании>

Slide 15

Slide 15 text

Наймём DevOps`а

Slide 16

Slide 16 text

А потом еще одного

Slide 17

Slide 17 text

А потом сделаем DevOps отдел

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

DevOps как слава КПСС → Вообще не человек

Slide 20

Slide 20 text

Кто если не человек?

Slide 21

Slide 21 text

Часто задаваемые вопросы

Slide 22

Slide 22 text

Я автоматизирую – я DevOps?

Slide 23

Slide 23 text

Я администрирую – я DevOps?

Slide 24

Slide 24 text

Я админ и я программирую – я DevOps?

Slide 25

Slide 25 text

Я деплою – я DevOps?

Slide 26

Slide 26 text

Я деплою – я DevOps?

Slide 27

Slide 27 text

Таблицы половозрелости Используется Jenkins да Уровень 1 Пишутся тесты да Уровень 1 Автоматизирована доставка да Уровень 2 Еще что то нет Уровень 2 Еще что то сложное нет Уровень 3

Slide 28

Slide 28 text

DevOps как слава КПСС → Вообще не человек

Slide 29

Slide 29 text

DevOps это про архитектуру?

Slide 30

Slide 30 text

30 Закон “Почему”

Slide 31

Slide 31 text

31 Закон 3х “Почему” ?

Slide 32

Slide 32 text

32 Закон 5и “Почему” ?

Slide 33

Slide 33 text

Почему "Архитектура Г**НО?" Одного "почему", как правило, достаточно

Slide 34

Slide 34 text

34 Почему JQuery?

Slide 35

Slide 35 text

35

Slide 36

Slide 36 text

36

Slide 37

Slide 37 text

37 Точка зрения: архитектор

Slide 38

Slide 38 text

38 Работа идеального архитектора

Slide 39

Slide 39 text

39 Работа идеального архитектора

Slide 40

Slide 40 text

40 Работа идеального архитектора

Slide 41

Slide 41 text

41 Точка зрения: разработчик

Slide 42

Slide 42 text

Немного деталей не помешает 42

Slide 43

Slide 43 text

Немного деталей не помешает 43

Slide 44

Slide 44 text

Архитектура 44

Slide 45

Slide 45 text

Архитектура Что это? 45

Slide 46

Slide 46 text

Что же такое архитектура? 46

Slide 47

Slide 47 text

Что же такое архитектура? 47

Slide 48

Slide 48 text

Что же такое архитектура? 48 https://www.youtube.com/watch?v=_Kex5hwGE-w

Slide 49

Slide 49 text

49

Slide 50

Slide 50 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 50 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Conway’s Law Co Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An

Slide 51

Slide 51 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 51 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Conway’s Law Co Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An

Slide 52

Slide 52 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 52 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Conway’s Law Co Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An

Slide 53

Slide 53 text

Нормально делай

Slide 54

Slide 54 text

Нормально делай Нормально будет

Slide 55

Slide 55 text

Почему "Нормально" – сложно

Slide 56

Slide 56 text

Реальность – это колодцы DBA`s Developers Operations

Slide 57

Slide 57 text

57 Закон Конвея

Slide 58

Slide 58 text

58 Закон Конвея

Slide 59

Slide 59 text

Big Ball of Mud 59

Slide 60

Slide 60 text

К чему приводят колодцы

Slide 61

Slide 61 text

Взаимоотношения Soft Skills

Slide 62

Slide 62 text

DevOps – это про взаимоотношения → Никто не делает продукт для одного клиента → Никто не должен строить процесс вокруг {dev,ops,dba,etc} → Работать вместе над всем циклом создания продукта → Обучать не только "своих" → Не строить стен и колодцев

Slide 63

Slide 63 text

И все же

Slide 64

Slide 64 text

Почему "Архитектура Г**НО?"

Slide 65

Slide 65 text

А что в этих ваших интернетах? 65

Slide 66

Slide 66 text

Микросервисы!

Slide 67

Slide 67 text

SOLID Counter-Strike Cats 67

Slide 68

Slide 68 text

GOF SOLID TDD Counter-Strike Cats 68

Slide 69

Slide 69 text

12 April 1996 Первое упоминание SOA https://www.gartner.com/doc/302868/service-oriented-architectures- 69

Slide 70

Slide 70 text

Принципы SOA 1. Standardized service contract 2. Loose coupling 3. Encapsulation 4. Reusability 5. Autonomy 6. Statelessness 7. Discoverability 70

Slide 71

Slide 71 text

Принципы SOA 1. Standardized service contract 2. Loose coupling 3. Encapsulation 4. Reusability 5. Autonomy 6. Statelessness 7. Discoverability 71

Slide 72

Slide 72 text

5 January 2009 SOA is Dead http://apsblog.burtongroup.com/2009/01/soa-is-dead-long-live-services.html 72

Slide 73

Slide 73 text

SOA != SOAP (WS-*) 73

Slide 74

Slide 74 text

74 Про тренды

Slide 75

Slide 75 text

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- James Lewis and Martin Fowler Что такое микросервисы? 75

Slide 76

Slide 76 text

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- James Lewis and Martin Fowler Что такое микросервисы? 76

Slide 77

Slide 77 text

Размер имеет значение? → Method/Function = Microservice? → 10-300 LOC = Microservice? → 1 week = Microservice? → 1 developer = Microservice? 77

Slide 78

Slide 78 text

Размер не имеет значения* → Single Responsibility → One capability → Bounded context “In your organization, you should be thinking not in terms of data that is shared, but about the capabilities those contexts provide the rest of the domain.” – Sam Newman, Building Microservices *до разумных пределов конечно 78

Slide 79

Slide 79 text

Domain-Driven Design 79

Slide 80

Slide 80 text

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- James Lewis and Martin Fowler Что такое микросервисы? 80

Slide 81

Slide 81 text

Process segregation 81

Slide 82

Slide 82 text

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- James Lewis and Martin Fowler Что такое микросервисы? 82

Slide 83

Slide 83 text

Независимый деплой build test 83

Slide 84

Slide 84 text

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- James Lewis and Martin Fowler Что такое микросервисы? 84

Slide 85

Slide 85 text

Language/technology segregation 85

Slide 86

Slide 86 text

Data segregation 86

Slide 87

Slide 87 text

Team segregation 87

Slide 88

Slide 88 text

88 DDD Dd SOA So Conway’s Law Co

Slide 89

Slide 89 text

89 Это Пётр

Slide 90

Slide 90 text

90 Java Python JS Это Пётр У него сложный выбор

Slide 91

Slide 91 text

91 Java Python JS Это Пётр У него сложный выбор Любит LSD

Slide 92

Slide 92 text

Принцип LSD → L языков программирования → S среднее число фреймворков на язык → D типов источников данных complexity = L * S * D 92

Slide 93

Slide 93 text

93 ? → Spring Boot/Spring Cloud → Ratpack → Dropwizard → Vert.x → Restlet → Spark → KumuluzEE

Slide 94

Slide 94 text

94 Выбирайте то, что больше нравится / в чем есть экспертиза → Spring Boot/Spring Cloud → Ratpack → Dropwizard → Vert.x → Restlet → Spark → KumuluzEE

Slide 95

Slide 95 text

95

Slide 96

Slide 96 text

96

Slide 97

Slide 97 text

Немного LSD для вас → три языка программирования → два в среднем фреймворка на язык → семь типов источников данных ⇢ legacy WS, mongo db ⇢ OLTP, OLAP ⇢ elasticsearch, neo4j ⇢ Мишкина база %) 97

Slide 98

Slide 98 text

Чем нельзя пожертвовать? min (L * S * D) → ? 98

Slide 99

Slide 99 text

min (L * S * D) → max (D) 99

Slide 100

Slide 100 text

Нарушать правила можно 100 L = Java L += Python L += JavaScript

Slide 101

Slide 101 text

101 L = Java 18+ S = Spring Boot D = ∞

Slide 102

Slide 102 text

java Ja spring boot Sb 102 DDD Dd SOA So LSD principle Ls Conway’s Law Co

Slide 103

Slide 103 text

103

Slide 104

Slide 104 text

104 t 0

Slide 105

Slide 105 text

Где мой DevOps ?

Slide 106

Slide 106 text

Где мой DevOps ? Дружище

Slide 107

Slide 107 text

git clone 107

Slide 108

Slide 108 text

108 Код устарел

Slide 109

Slide 109 text

109 Код устарел Нужно переименовать классы

Slide 110

Slide 110 text

110 Код устарел Нужно переименовать классы Нужно удалить неиспользуемое

Slide 111

Slide 111 text

111 Код устарел Нужно переименовать классы Нужно удалить неиспользуемое Прочая магия Время, ошибки, фрагментация

Slide 112

Slide 112 text

git clone 112

Slide 113

Slide 113 text

113 Нужно переименовать классы Нужно кастомизировать руками Время актуализация

Slide 114

Slide 114 text

lazybones / start.spring.io / yeoman 114 Результаты общей работы (DevOps?)

Slide 115

Slide 115 text

lazybones create api 1.0.1 service_name 115

Slide 116

Slide 116 text

~home > lazybones create api 0.0.1 rent-service 116

Slide 117

Slide 117 text

~home > lazybones create api 0.0.1 rent-service Creating project from template api 0.0.1 in 'rent-service' Define value for 'group' [ru.gdg.rostov]: 117

Slide 118

Slide 118 text

~home > lazybones create api 0.0.1 rent-service Creating project from template api 0.0.1 in 'rent-service' Define value for 'group' [ru.gdg.rostov]: Define value for 'version' [0.0.1]: 118

Slide 119

Slide 119 text

~home > lazybones create api 0.0.1 rent-service Creating project from template api 0.0.1 in 'rent-service' Define value for 'group' [ru.gdg.rostov]: Define value for 'version' [0.0.1]: srv1 ├──srv2 └──srv3 logging sleuth Define value for 'dependencies' [logging,sleuth]: 119

Slide 120

Slide 120 text

~home > lazybones create api 0.0.1 rent-service Creating project from template api 0.0.1 in 'rent-service' Define value for 'group' [ru.gdg.rostov]: Define value for 'version' [0.0.1]: srv1 ├──srv2 └──srv3 logging sleuth Define value for 'dependencies' [logging,sleuth]: Project created for rent-service! 120

Slide 121

Slide 121 text

121

Slide 122

Slide 122 text

lazybones Lz yeoman Yo start.spring.io Ss java Ja spring boot Sb groovy Gy 122 LSD principle Ls DDD Dd SOA So Conway’s Law Co

Slide 123

Slide 123 text

DRY off 123

Slide 124

Slide 124 text

TServerTransport serverTransport = new TServerSocket( new InetSocketAddress(InetAddress.getLocalHost(), port)); TProcessor processor = new TInsuranceService.Processor<>( //business value here ); server = new TSimpleServer( new TServer.Args(serverTransport).processor(processor)); server.serve(); 124

Slide 125

Slide 125 text

TSocket transport = new TSocket(host, port); transport.open(); TBinaryProtocol tBinaryProtocol = new TBinaryProtocol(transport); TInsuranceService.Client client = new TInsuranceService.Client(tBinaryProtocol); perform(client); //business value here transport.close(); 125

Slide 126

Slide 126 text

@ThriftController public class InsuranceController implements TInsuranceService.Iface { @Override public void someMethod(TInsurance insurance){ //business value here } } 126

Slide 127

Slide 127 text

@ThriftClient(serviceId = "insurance-service") TInsuranceService.Client client; ... perform(client); //business value here ... 127

Slide 128

Slide 128 text

smart libs starters launchers shared libs utils helpers 128

Slide 129

Slide 129 text

129 Старт приложения Рабочее приложение

Slide 130

Slide 130 text

@ThriftClient(serviceId = "insurance-service") TInsuranceService.Client client; TInsuranceService.Client client = Creator.create(TInsuranceService.Client.class, "insurance-service"); ... perform(client); //business value here ... 130

Slide 131

Slide 131 text

131 Fluent annotations

Slide 132

Slide 132 text

@Getter // generate getters @Setter // generate setters @Aspect // we are an aspect @ToString // generate toString() @EnableWs // SOAP is so enterprisy, we definitely need it @Endpoint // Seriously, just read above @EnableWebMvc // we want MVC @EnableCaching // and we want to cache stuff @Configuration // this class can configure itself @RestController // we want some REST @XmlRootElement // this component is marshallable @EnableWebSocket // we want web socket, it's so new-generation @RedisHash("cat") // this class is an entity saved in redis @EnableScheduling // we want scheduled tasks @EnableWebSecurity // and some built-in security @NoArgsConstructor // generate no args constructor @ContextConfiguration // we want context configuration for unit testing @SpringBootApplication // this is a Sprint Boot application @Accessors(chain = true) // getters/setters are chained (ala jQuery) @EnableAspectJAutoProxy // we want AspectJ auto proxy @EnableAutoConfiguration // and auto configuration @EnableRedisRepositories // since it is an entity we want to enable spring data repositories for redis @EnableWebSocketMessageBroker // we want a broker for web socket messages 132 Fluent annotations

Slide 133

Slide 133 text

@Getter // generate getters @Setter // generate setters @Aspect // we are an aspect @ToString // generate toString() @EnableWs // SOAP is so enterprisy, we definitely need it @Endpoint // Seriously, just read above @EnableWebMvc // we want MVC @EnableCaching // and we want to cache stuff @Configuration // this class can configure itself @RestController // we want some REST @XmlRootElement // this component is marshallable @EnableWebSocket // we want web socket, it's so new-generation @RedisHash("cat") // this class is an entity saved in redis @EnableScheduling // we want scheduled tasks @EnableWebSecurity // and some built-in security @NoArgsConstructor // generate no args constructor @ContextConfiguration // we want context configuration for unit testing @SpringBootApplication // this is a Sprint Boot application @Accessors(chain = true) // getters/setters are chained (ala jQuery) @EnableAspectJAutoProxy // we want AspectJ auto proxy @EnableAutoConfiguration // and auto configuration @EnableRedisRepositories // since it is an entity we want to enable spring data repositories for redis @EnableWebSocketMessageBroker // we want a broker for web socket messages 133 Fluent annotations

Slide 134

Slide 134 text

smart libs/shared libs 134

Slide 135

Slide 135 text

documentation → smart documentation 135

Slide 136

Slide 136 text

Not smart = This is main documentation This document describes how to be the most fundamental and important document in the world of documents ... COPY-PASTE documentation from another document ... 136

Slide 137

Slide 137 text

Not so smart = This is main documentation This document describes how to be the most fundamental and important document in the world of documents include::https://raw.github.com/asciidoctor/asciidoctor/master/Gemfile[] include::../other.adoc[] include::/home/tolkv/git/docs-0/superdoc.adoc[] 137

Slide 138

Slide 138 text

Really smart = This is main documentation This document describes how to be the most fundamental and important document in the world of documents include::https://raw.github.com/asciidoctor/asciidoctor/master/Gemfile[] include::gradle://gradle-advanced:service-with-deps:1.0/deps.adoc[] include::gradle://:service/doc.adoc[] 138

Slide 139

Slide 139 text

Payment Service[jar,doc] Insurance Service [jar,doc] One Point of View [UberDoc.zip] Rent Service[jar,doc] Other Service [jar,doc] Агрегация информации 139

Slide 140

Slide 140 text

Парадокс централизации Чтобы эффективно разрабатывать распределённые приложения, нам нужны очень хорошие централизованные библиотеки и инструменты Например: логирование, health-checking, метрики, обработка типовых ошибок, автодокументирование 140

Slide 141

Slide 141 text

Парадокс централизации Чтобы эффективно разрабатывать распределённые приложения, нам нужны очень хорошие централизованные библиотеки и инструменты Но: не выносите бизнес-логику или доменные объекты! Не размывайте бизнес-контекст вашего API 141

Slide 142

Slide 142 text

lazybones Lz yoman Yo start.spring.io Ss java Ja thrift Th spring boot Sb gradle Gr asciidoctor Ad groovy Gy 142 Centralization paradox Cp LSD principle Ls DDD Dd Smart Docs Sd Smart Libs Sl SOA So Conway’s Law Co

Slide 143

Slide 143 text

Изоляция данных 143

Slide 144

Slide 144 text

144 Одно приложение - одна БД Всё просто

Slide 145

Slide 145 text

N сервисов → 1 БД Изоляция на уровне таблиц или схем 145

Slide 146

Slide 146 text

N сервисов → 1 БД Изоляция через хранимые процедуры 146

Slide 147

Slide 147 text

147 Transport Layer API API API API API

Slide 148

Slide 148 text

148 Transport Layer API API API API API

Slide 149

Slide 149 text

N сервисов → 1 БД Распределённый монолит 149

Slide 150

Slide 150 text

N сервисов → N БД 150

Slide 151

Slide 151 text

N сервисов → N БД Распределённые транзакции – это больно 151

Slide 152

Slide 152 text

152 Transport Layer API API API API API Очень много кода

Slide 153

Slide 153 text

N сервисов → N БД Ваше legacy тянет вас на дно 153

Slide 154

Slide 154 text

154

Slide 155

Slide 155 text

M сервисов → 1 БД L сервисов → L БД M + L = N, M << L 155

Slide 156

Slide 156 text

156 Transport Layer API API API API API

Slide 157

Slide 157 text

M сервисов → 1 БД L сервисов → L БД M + L = N, M << L 157

Slide 158

Slide 158 text

lazybones Lz yoman Yo start.spring.io Ss java Ja thrift Th spring boot Sb gradle Gr asciidoctor Ad groovy Gy 158 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Conway`s law Co Smart Docs Sd Smart Libs Sl SOA So

Slide 159

Slide 159 text

Доставка 159

Slide 160

Slide 160 text

war/ear 160 Зависимость от сервера приложений

Slide 161

Slide 161 text

executable fatJar 161 Зависимость от системных библиотек

Slide 162

Slide 162 text

162 not war < make Jar

Slide 163

Slide 163 text

executable fatJar/npm-пакет 163 Разный менеджмент для разных форматов дистрибуции

Slide 164

Slide 164 text

docker/rkt/packer 164

Slide 165

Slide 165 text

165 not jar < make docker

Slide 166

Slide 166 text

scp fat.jar root@prod101:/home/app/ 166

Slide 167

Slide 167 text

scp fat.jar root@prod101:/home/app/ Что делать с консистентостью? Как быть с доступностью? 167

Slide 168

Slide 168 text

./gradlew deployToArtifactory ansible -i [stage,dev,test] -t deploy 168

Slide 169

Slide 169 text

169

Slide 170

Slide 170 text

./gradlew deployToArtifactory ansible -i [stage,dev,test] -t deploy “Прибитая молотком” конфигурация” 170

Slide 171

Slide 171 text

171 Как быстро масштабироваться?

Slide 172

Slide 172 text

172 Оркестрация

Slide 173

Slide 173 text

173

Slide 174

Slide 174 text

mesos / kubernetes / ∞ 174

Slide 175

Slide 175 text

Как использовать ресурсы 175

Slide 176

Slide 176 text

176 t Bare Metal

Slide 177

Slide 177 text

177 t Bare Metal Virtual Machines

Slide 178

Slide 178 text

178 t Bare Metal Virtual Machines Lightweight Containers

Slide 179

Slide 179 text

179 t Bare Metal Virtual Machines Lightweight Containers

Slide 180

Slide 180 text

180

Slide 181

Slide 181 text

Использование группы машин как одной WEB WASTED CACHE WASTED WASTED HADOOP 181

Slide 182

Slide 182 text

Представьте, что кластер это просто одна большая машина WEB WASTED CACHE WASTED WASTED HADOOP WASTED WEB CACHE HADOOP FREE FREE 182

Slide 183

Slide 183 text

lazybones Lz yoman Yo start.spring.io Ss python Py java Ja spring boot Sb gradle Gr asciidoctor Ad docker Dr mesos Ms marathon Ma chronos Ch aurora Au Kubernetes Kb groovy Gy 183 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd SAGAS Sa Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An thrift Th Artifactory Ar

Slide 184

Slide 184 text

Найти нужный экземпляр 184

Slide 185

Slide 185 text

insert into settings_table values (key, endpoint) 185 “Прибитая молотком” конфигурация

Slide 186

Slide 186 text

update template → services.location kill -s HUP nginx 186 Остаётся статическая привязка ресурсов

Slide 187

Slide 187 text

eureka/consul/etcd/zookeper 187

Slide 188

Slide 188 text

188 Service Client Registry-aware HTTP Client Service Registry Service Instance 1 Service Instance N Service Instance ... Load balance request Client side discovery

Slide 189

Slide 189 text

189 Service Client Service Registry Service Instance 1 Service Instance N Service Instance ... Load balance request Router/Proxy Server side discovery

Slide 190

Slide 190 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk groovy Gy 190 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd SAGAS Sa Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An

Slide 191

Slide 191 text

Защити себя сам 191

Slide 192

Slide 192 text

192

Slide 193

Slide 193 text

193 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 5мс

Slide 194

Slide 194 text

194 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс

Slide 195

Slide 195 text

195 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс

Slide 196

Slide 196 text

196 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс

Slide 197

Slide 197 text

197 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс

Slide 198

Slide 198 text

198 Circuit Breaker

Slide 199

Slide 199 text

199 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс

Slide 200

Slide 200 text

200 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс Open

Slide 201

Slide 201 text

201 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 300мс Half-Open

Slide 202

Slide 202 text

202 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 5мс Half-Open

Slide 203

Slide 203 text

203 Хочу бегемота! Rent Service Payment Service Security Service Blockchain Service Insurance Service 5мс

Slide 204

Slide 204 text

hystrix/apache camel/akka 204

Slide 205

Slide 205 text

205

Slide 206

Slide 206 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx groovy Gy 206 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An Conway’s Law Co

Slide 207

Slide 207 text

Следи за своим ПО 207

Slide 208

Slide 208 text

Нет трассировки - нет проблем? :) 208

Slide 209

Slide 209 text

X-Request-Id = X-Request-Id ?: new ID Простой вариант с ServletFilter 209

Slide 210

Slide 210 text

spring-cloud-sleuth/open zipkin 210

Slide 211

Slide 211 text

211 Rent Service No TraceId No SpanId TraceId = X SpanId = A

Slide 212

Slide 212 text

212 Rent Service Payment Service No TraceId No SpanId TraceId = X SpanId = A TraceId = X SpanId = B TraceId = X SpanId = C

Slide 213

Slide 213 text

213 Rent Service Payment Service Blockchain Service No TraceId No SpanId TraceId = X SpanId = A TraceId = X SpanId = B TraceId = X SpanId = C TraceId = X SpanId = D TraceId = X SpanId = D TraceId = X SpanId = F

Slide 214

Slide 214 text

214 Rent Service Payment Service Security Service Blockchain Service No TraceId No SpanId TraceId = X SpanId = A TraceId = X SpanId = B TraceId = X SpanId = C TraceId = X SpanId = D TraceId = X SpanId = D TraceId = X SpanId = E TraceId = X SpanId = E TraceId = X SpanId = F TraceId = X SpanId = G

Slide 215

Slide 215 text

215 Rent Service Payment Service Security Service Blockchain Service No TraceId No SpanId TraceId = X SpanId = A TraceId = X SpanId = B TraceId = X SpanId = B TraceId = X SpanId = C TraceId = X SpanId = C TraceId = X SpanId = D TraceId = X SpanId = D TraceId = X SpanId = E TraceId = X SpanId = E TraceId = X SpanId = F TraceId = X SpanId = G

Slide 216

Slide 216 text

216 Rent Service Payment Service Security Service Blockchain Service TraceId = X SpanId = A No TraceId No SpanId TraceId = X SpanId = A TraceId = X SpanId = A TraceId = X SpanId = B TraceId = X SpanId = B TraceId = X SpanId = C TraceId = X SpanId = C TraceId = X SpanId = D TraceId = X SpanId = D TraceId = X SpanId = E TraceId = X SpanId = E TraceId = X SpanId = F TraceId = X SpanId = G

Slide 217

Slide 217 text

217

Slide 218

Slide 218 text

218

Slide 219

Slide 219 text

219 Rent Service Payment Service

Slide 220

Slide 220 text

220 Rent Service Payment Service SpanId = B Client Send TraceId = X SpanId = A

Slide 221

Slide 221 text

221 Rent Service Payment Service SpanId = B Client Send SpanId = B Server Received TraceId = X SpanId = A TraceId = X SpanId = C

Slide 222

Slide 222 text

222 Rent Service Payment Service SpanId = B Client Send SpanId = B Server Received SpanId = B Server Send TraceId = X SpanId = A TraceId = X SpanId = C

Slide 223

Slide 223 text

223 Rent Service Payment Service SpanId = B Client Send SpanId = B Server Received SpanId = B Client Received SpanId = B Server Send TraceId = X SpanId = A TraceId = X SpanId = C

Slide 224

Slide 224 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 224 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An Conway’s Law Co

Slide 225

Slide 225 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 225 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An Conway’s Law Co

Slide 226

Slide 226 text

yoman Yo start.spring.io Ss python Py lazybones Lz java Ja spring boot Sb gradle Gr asciidoctor Ad thrift Th docker Dr mesos Ms marathon Ma chronos Ch aurora Au Artifactory Ar Kubernetes Kb eureka Eu consul Cl etcd Ed zookeeper Zk hystrix Hx sleuth Sl zipkin Zn groovy Gy 226 Data Isolation Di Centralization paradox Cp LSD principle Ls DDD Dd Smart Docs Sd Dynamic Sharing Ds Smart Libs Sl SOA So ansible An Conway’s Law Co ?

Slide 227

Slide 227 text

Выводы 227 Микросервисы – это просто DevOps – это просто

Slide 228

Slide 228 text

Выводы 228 Микросервисы – это просто DevOps – это просто Микросервисы – это сложно DevOps – это сложно

Slide 229

Slide 229 text

1. Не пишите в резюме DevOps Инженер 2. SOA принципы живы 3. Принцип LSD 4. Изоляция данных делает жизнь приятнее 5. Парадокс централизации 6. Планируй ресурсы динамически 7. Любите и поддерживайте друг друга (и не важно что такое DevOps) Придерживайтесь принципов 229

Slide 230

Slide 230 text

DevOps – образ мышления команды, при котором все осознают что нужно для предоставления сервиса https://twitter.com/bsideup/status/906154114991652864

Slide 231

Slide 231 text

QA 231

Slide 232

Slide 232 text

https://alfalab.design/vacancies/java-razrabotchik https://alfalab.design/vacancies/ Минутка маркетинга

Slide 233

Slide 233 text

Links Лекция Жени Кривошеева про архитектуру: https://www.youtube.com/watch?v=_Kex5hwGE-w Пример Smart-библиотеки: https://github.com/lavcraft/grpc-spring-boot-starter Пример реализации “умной документации”: https://github.com/aatarasoff/documentation-plugin-demo 233

Slide 234

Slide 234 text

Типичная микросервисная архитектура 234