{"id":456804,"date":"2025-04-21T21:00:15","date_gmt":"2025-04-21T21:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=456804"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=456804","title":{"rendered":"<span>\u0421\u043b\u043e\u043c\u0430\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442: \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u043a\u0440\u043e\u043c\u0441\u0430\u043b\u0438 \u0433\u0438\u0433\u0430\u043d\u0442\u0430 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u043d\u0435 \u0441\u043e\u0448\u043b\u0438 \u0441 \u0443\u043c\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/570\/559\/a0a\/570559a0af54bd4c1dffc7dcc20f5483.png\" width=\"1536\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/570\/559\/a0a\/570559a0af54bd4c1dffc7dcc20f5483.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/570\/559\/a0a\/570559a0af54bd4c1dffc7dcc20f5483.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0440\u0430\u0434\u0438 \u00ab\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438\u00bb \u0438 \u00ab\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438\u00bb, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u043b\u043e\u043c\u0430\u043b\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0430. \u041c\u044b \u0443\u0441\u0442\u0430\u043b\u0438. \u0418 \u043e\u0434\u043d\u0430\u0436\u0434\u044b CTO \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u043e\u0440\u0430\u00bb. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0431\u0435\u0437 \u043f\u0440\u0438\u043a\u0440\u0430\u0441.<\/p>\n<h3>\u041c\u043e\u043d\u043e\u043b\u0438\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441 \u0434\u043e\u0432\u0451\u043b<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043b\u0438\u0440\u0438\u043a\u0438. \u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Spring Boot<\/strong>, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u0441 2017 \u0433\u043e\u0434\u0430. \u0412 \u043d\u0435\u0439 \u0431\u044b\u043b\u043e <strong>8 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/strong>, \u043e\u043a\u043e\u043b\u043e <strong>2 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430<\/strong>, \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0440\u0435\u0442\u044c\u044f \u0444\u0438\u0447\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u043e\u043c\u0430\u043b\u0430 \u0434\u0432\u0435 \u0441\u0442\u0430\u0440\u044b\u0445.<\/p>\n<p>\u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 (\u043d\u0443, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0435):<\/p>\n<pre><code class=\"java\">@RestController @RequestMapping(\"\/api\/v1\/user\") public class UserController {      @Autowired     private UserService userService;      @GetMapping(\"\/{id}\")     public ResponseEntity&lt;UserDto&gt; getUser(@PathVariable Long id) {         return ResponseEntity.ok(userService.getUserById(id));     } }<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0433\u0430\u0434\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0435\u0441\u043b\u0438 <code>UserService<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>BillingService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 <code>AuthService<\/code>, \u0430 \u0442\u043e\u0442 \u043e\u0442 <code>LoggerService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437-\u0437\u0430 \u0431\u0430\u0433\u043e\u0432 \u043f\u0438\u0448\u0435\u0442 \u043f\u043e 100 \u041c\u0411 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0430\u0434.<\/p>\n<h3>\u041f\u043b\u0430\u043d \u0430\u0442\u0430\u043a\u0438: \u0440\u0430\u0441\u043f\u0438\u043b\u0438\u0442\u044c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e<\/h3>\n<p>\u0420\u0435\u0437\u0430\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0431\u0438\u0442\u044c \u0432\u0441\u0451. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0441 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0421\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u2014 \u043f\u043e\u043d\u044f\u0442\u044c, <strong>\u043a\u0430\u043a\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0440\u0432\u0430\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e<\/strong>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>Spring Boot Actuator (\u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a)<\/p>\n<\/li>\n<li>\n<p>Jaeger + OpenTracing (\u0434\u043b\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p>jQAssistant + ArchUnit (\u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043a\u0430\u043a \u043b\u0430\u043f\u0448\u0430. \u041d\u043e \u043a\u043e\u0435-\u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e: <strong>User<\/strong>, <strong>Billing<\/strong>, <strong>Notifications<\/strong> \u0438 <strong>Reporting<\/strong> \u2014 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u044b \u043d\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e.<\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441: Auth<\/h3>\n<p>\u041d\u0430\u0447\u0430\u043b\u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u00ab\u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e\u00bb (\u0445\u0430-\u0445\u0430) \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 <strong>AuthService<\/strong>. \u041e\u043d \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0440\u043e\u043c\u0435 User. \u041c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <strong>Spring Boot<\/strong> \u0441\u0435\u0440\u0432\u0438\u0441, \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0432 <strong>Docker<\/strong>, \u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u0432 <strong>k8s<\/strong>, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 <strong>Kafka<\/strong> \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Kafka consumer:<\/p>\n<pre><code class=\"yaml\">spring:   kafka:     consumer:       bootstrap-servers: kafka:9092       group-id: auth-group       auto-offset-reset: earliest       key-deserializer: org.apache.kafka.common.serialization.StringDeserializer       value-deserializer: org.apache.kafka.common.serialization.StringDeserializer<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d <strong>\u0440\u0430\u0437\u0432\u0430\u043b\u0438\u043b\u0441\u044f \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 200 RPS<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e connection pool. \u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0430\u0431\u0438\u043b\u0438 \u043d\u0430 retry-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e Kafka messages \u0443\u0445\u043e\u0434\u0438\u043b\u0438 \u0432 \u043d\u0438\u043a\u0443\u0434\u0430. \u0423\u0447\u043b\u0438, \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b\u0438.<\/p>\n<h3>\u0412\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u043b\u043d\u0430: Billing \u0438 Notifications<\/h3>\n<p>\u042d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. Billing \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 PostgreSQL, Notifications \u2014 \u0441 RabbitMQ. \u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 <strong>\u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442<\/strong> \u2014 \u043c\u044b \u0432\u0432\u0435\u043b\u0438 <strong>protobuf-\u0441\u0445\u0435\u043c\u044b<\/strong>, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 CI. \u042d\u0442\u043e \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043a <strong>\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>.<\/p>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 proto-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>syntax = \"proto3\";  message UserCreated {   string id = 1;   string email = 2;   string name = 3; }<\/code><\/pre>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 lint \u0434\u043b\u044f \u0441\u0445\u0435\u043c, \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432 <code>build.gradle.kts<\/code> \u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0432 GitLab:<\/p>\n<pre><code class=\"kotlin\">protobuf {     protoc {         artifact = \"com.google.protobuf:protoc:3.19.1\"     }     plugins {         id(\"grpc\") {             artifact = \"io.grpc:protoc-gen-grpc-java:1.42.1\"         }     } }<\/code><\/pre>\n<h3>\u041b\u043e\u0433\u0438\u043a\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438: \u0441\u0438\u043d\u0445\u0440\u043e\u043d \u2192 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d<\/h3>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u0431\u0449\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u041c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 <strong>event-driven<\/strong> \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u044b\u0441\u043b\u0438\u0442\u044c <strong>\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438<\/strong>, \u0430 \u043d\u0435 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u0441\u0442\u0438 <strong>event versioning<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 <strong>Event Gateway<\/strong> \u2014 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u044b\u0441\u043b\u0438 \u0438 \u0431\u0430\u0433\u0438 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435<\/h3>\n<p>\u0421\u0430\u043c\u043e\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u2014 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442 \u0438 \u043d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0436\u0438\u0432\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p><strong>AuthService<\/strong> \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e,<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e <strong>UserService<\/strong> \u0432 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0435 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0431\u0430\u0437\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u0432\u0435\u043b\u0438 <strong>sync proxy<\/strong>, \u0447\u0442\u043e\u0431\u044b Auth \u0434\u0435\u0440\u0433\u0430\u043b \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430. \u0413\u0440\u044f\u0437\u043d\u043e? \u0414\u0430. \u0417\u0430\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<h3>CI\/CD \u0438 DevOps \u0430\u0434<\/h3>\n<p>\u041d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b = \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>GitLab CI<\/p>\n<\/li>\n<li>\n<p>Helm + ArgoCD<\/p>\n<\/li>\n<li>\n<p>ECR + Kustomize<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u0435\u0435\u0442 <code>helm\/<\/code> \u0438 <code>kustomize\/overlays\/<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043b\u044f stage\/prod.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 <code>deployment.yaml<\/code>:<\/p>\n<pre><code class=\"yaml\">apiVersion: apps\/v1 kind: Deployment metadata:   name: auth-service spec:   replicas: 3   selector:     matchLabels:       app: auth-service   template:     metadata:       labels:         app: auth-service     spec:       containers:         - name: auth           image: registry.example.com\/auth:latest           ports:             - containerPort: 8080<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0435\u043b\u043e<\/h3>\n<ul>\n<li>\n<p><strong>Feature Flags<\/strong> \u2014 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 LaunchDarkly, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>Service Mesh<\/strong> \u2014 Istio \u0431\u044b\u043b \u0445\u043e\u0440\u043e\u0448 \u043d\u0430 \u0434\u0435\u043c\u043e, \u043d\u043e \u0432 \u043f\u0440\u043e\u0434\u0435 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e \u043b\u0430\u0433\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p><strong>Distributed tracing<\/strong> \u2014 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432 Jaeger, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h3>\n<ul>\n<li>\n<p>\u0423 \u043d\u0430\u0441 \u0442\u0435\u043f\u0435\u0440\u044c 16 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>90% \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u0430\u043b\u0438\u0442 \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a DevOps-\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0435, \u0441\u0442\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u2014 \u043d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u044d\u0442\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0436\u0438\u0442\u044c \u0432 \u0445\u0430\u043e\u0441\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u043b\u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u0442\u044f\u0436\u0435\u043b\u043e, \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u043d\u043e, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u2014 \u044d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/902734\/\"> https:\/\/habr.com\/ru\/articles\/902734\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0443\u0442 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0440\u0430\u0434\u0438 \u00ab\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438\u00bb \u0438 \u00ab\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438\u00bb, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u043b\u043e\u043c\u0430\u043b\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0430. \u041c\u044b \u0443\u0441\u0442\u0430\u043b\u0438. \u0418 \u043e\u0434\u043d\u0430\u0436\u0434\u044b CTO \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u043e\u0440\u0430\u00bb. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0431\u0435\u0437 \u043f\u0440\u0438\u043a\u0440\u0430\u0441.<\/p>\n<h3>\u041c\u043e\u043d\u043e\u043b\u0438\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441 \u0434\u043e\u0432\u0451\u043b<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043b\u0438\u0440\u0438\u043a\u0438. \u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Spring Boot<\/strong>, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u0441 2017 \u0433\u043e\u0434\u0430. \u0412 \u043d\u0435\u0439 \u0431\u044b\u043b\u043e <strong>8 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/strong>, \u043e\u043a\u043e\u043b\u043e <strong>2 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430<\/strong>, \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0440\u0435\u0442\u044c\u044f \u0444\u0438\u0447\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u043e\u043c\u0430\u043b\u0430 \u0434\u0432\u0435 \u0441\u0442\u0430\u0440\u044b\u0445.<\/p>\n<p>\u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 (\u043d\u0443, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0435):<\/p>\n<pre><code class=\"java\">@RestController @RequestMapping(\"\/api\/v1\/user\") public class UserController {      @Autowired     private UserService userService;      @GetMapping(\"\/{id}\")     public ResponseEntity&lt;UserDto&gt; getUser(@PathVariable Long id) {         return ResponseEntity.ok(userService.getUserById(id));     } }<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0433\u0430\u0434\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0435\u0441\u043b\u0438 <code>UserService<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>BillingService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 <code>AuthService<\/code>, \u0430 \u0442\u043e\u0442 \u043e\u0442 <code>LoggerService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437-\u0437\u0430 \u0431\u0430\u0433\u043e\u0432 \u043f\u0438\u0448\u0435\u0442 \u043f\u043e 100 \u041c\u0411 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0430\u0434.<\/p>\n<h3>\u041f\u043b\u0430\u043d \u0430\u0442\u0430\u043a\u0438: \u0440\u0430\u0441\u043f\u0438\u043b\u0438\u0442\u044c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e<\/h3>\n<p>\u0420\u0435\u0437\u0430\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0431\u0438\u0442\u044c \u0432\u0441\u0451. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0441 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0421\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u2014 \u043f\u043e\u043d\u044f\u0442\u044c, <strong>\u043a\u0430\u043a\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0440\u0432\u0430\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e<\/strong>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>Spring Boot Actuator (\u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a)<\/p>\n<\/li>\n<li>\n<p>Jaeger + OpenTracing (\u0434\u043b\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p>jQAssistant + ArchUnit (\u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043a\u0430\u043a \u043b\u0430\u043f\u0448\u0430. \u041d\u043e \u043a\u043e\u0435-\u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e: <strong>User<\/strong>, <strong>Billing<\/strong>, <strong>Notifications<\/strong> \u0438 <strong>Reporting<\/strong> \u2014 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u044b \u043d\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e.<\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441: Auth<\/h3>\n<p>\u041d\u0430\u0447\u0430\u043b\u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u00ab\u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e\u00bb (\u0445\u0430-\u0445\u0430) \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 <strong>AuthService<\/strong>. \u041e\u043d \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0440\u043e\u043c\u0435 User. \u041c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <strong>Spring Boot<\/strong> \u0441\u0435\u0440\u0432\u0438\u0441, \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0432 <strong>Docker<\/strong>, \u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u0432 <strong>k8s<\/strong>, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 <strong>Kafka<\/strong> \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Kafka consumer:<\/p>\n<pre><code class=\"yaml\">spring:   kafka:     consumer:       bootstrap-servers: kafka:9092       group-id: auth-group       auto-offset-reset: earliest       key-deserializer: org.apache.kafka.common.serialization.StringDeserializer       value-deserializer: org.apache.kafka.common.serialization.StringDeserializer<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d <strong>\u0440\u0430\u0437\u0432\u0430\u043b\u0438\u043b\u0441\u044f \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 200 RPS<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e connection pool. \u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0430\u0431\u0438\u043b\u0438 \u043d\u0430 retry-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e Kafka messages \u0443\u0445\u043e\u0434\u0438\u043b\u0438 \u0432 \u043d\u0438\u043a\u0443\u0434\u0430. \u0423\u0447\u043b\u0438, \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b\u0438.<\/p>\n<h3>\u0412\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u043b\u043d\u0430: Billing \u0438 Notifications<\/h3>\n<p>\u042d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. Billing \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 PostgreSQL, Notifications \u2014 \u0441 RabbitMQ. \u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 <strong>\u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442<\/strong> \u2014 \u043c\u044b \u0432\u0432\u0435\u043b\u0438 <strong>protobuf-\u0441\u0445\u0435\u043c\u044b<\/strong>, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 CI. \u042d\u0442\u043e \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043a <strong>\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/strong>.<\/p>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 proto-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>syntax = \"proto3\";  message UserCreated {   string id = 1;   string email = 2;   string name = 3; }<\/code><\/pre>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 lint \u0434\u043b\u044f \u0441\u0445\u0435\u043c, \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432 <code>build.gradle.kts<\/code> \u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0432 GitLab:<\/p>\n<pre><code class=\"kotlin\">protobuf {     protoc {         artifact = \"com.google.protobuf:protoc:3.19.1\"     }     plugins {         id(\"grpc\") {             artifact = \"io.grpc:protoc-gen-grpc-java:1.42.1\"         }     } }<\/code><\/pre>\n<h3>\u041b\u043e\u0433\u0438\u043a\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438: \u0441\u0438\u043d\u0445\u0440\u043e\u043d \u2192 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d<\/h3>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u0431\u0449\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u041c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 <strong>event-driven<\/strong> \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u044b\u0441\u043b\u0438\u0442\u044c <strong>\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438<\/strong>, \u0430 \u043d\u0435 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u0441\u0442\u0438 <strong>event versioning<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 <strong>Event Gateway<\/strong> \u2014 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u044b\u0441\u043b\u0438 \u0438 \u0431\u0430\u0433\u0438 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435<\/h3>\n<p>\u0421\u0430\u043c\u043e\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u2014 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442 \u0438 \u043d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0436\u0438\u0432\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p><strong>AuthService<\/strong> \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e,<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e <strong>UserService<\/strong> \u0432 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0435 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0431\u0430\u0437\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u0432\u0435\u043b\u0438 <strong>sync proxy<\/strong>, \u0447\u0442\u043e\u0431\u044b Auth \u0434\u0435\u0440\u0433\u0430\u043b \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430. \u0413\u0440\u044f\u0437\u043d\u043e? \u0414\u0430. \u0417\u0430\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<h3>CI\/CD \u0438 DevOps \u0430\u0434<\/h3>\n<p>\u041d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b = \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>GitLab CI<\/p>\n<\/li>\n<li>\n<p>Helm + ArgoCD<\/p>\n<\/li>\n<li>\n<p>ECR + Kustomize<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u0435\u0435\u0442 <code>helm\/<\/code> \u0438 <code>kustomize\/overlays\/<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043b\u044f stage\/prod.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 <code>deployment.yaml<\/code>:<\/p>\n<pre><code class=\"yaml\">apiVersion: apps\/v1 kind: Deployment metadata:   name: auth-service spec:   replicas: 3   selector:     matchLabels:       app: auth-service   template:     metadata:       labels:         app: auth-service     spec:       containers:         - name: auth           image: registry.example.com\/auth:latest           ports:             - containerPort: 8080<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0435\u043b\u043e<\/h3>\n<ul>\n<li>\n<p><strong>Feature Flags<\/strong> \u2014 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 LaunchDarkly, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>Service Mesh<\/strong> \u2014 Istio \u0431\u044b\u043b \u0445\u043e\u0440\u043e\u0448 \u043d\u0430 \u0434\u0435\u043c\u043e, \u043d\u043e \u0432 \u043f\u0440\u043e\u0434\u0435 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e \u043b\u0430\u0433\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p><strong>Distributed tracing<\/strong> \u2014 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432 Jaeger, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h3>\n<ul>\n<li>\n<p>\u0423 \u043d\u0430\u0441 \u0442\u0435\u043f\u0435\u0440\u044c 16 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>90% \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u0430\u043b\u0438\u0442 \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a DevOps-\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0435, \u0441\u0442\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u2014 \u043d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u044d\u0442\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0436\u0438\u0442\u044c \u0432 \u0445\u0430\u043e\u0441\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u043b\u0433\u043e\u0434\u0430. \u042d\u0442\u043e \u0442\u044f\u0436\u0435\u043b\u043e, \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u043d\u043e, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u2014 \u044d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/902734\/\"> https:\/\/habr.com\/ru\/articles\/902734\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-456804","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456804"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456804\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}