{"id":53442,"date":"2019-12-02T00:00:00","date_gmt":"2019-12-01T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/legacy-servisy-v-vashej-infrastrukture"},"modified":"2020-02-18T14:01:20","modified_gmt":"2020-02-18T11:01:20","slug":"legacy-servisy-v-vashej-infrastrukture","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/legacy-servisy-v-vashej-infrastrukture","title":{"rendered":"Legacy services in your infrastructure","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Hello! My name is Pasha Chernyak, I\u2019m a lead developer at QIWI, and today I want to talk about the inevitable: Legacy.<\/p>\n<p>Let's start with the question: what is a Legacy service? Is it a service that the developer has not touched for a week\/month\/year? Or is it a service that was written by a less experienced programmer, for example, specifically you, but a year ago? And now you're cooler and more experienced. Or is a Legacy service something you decided to never commit to again and are gradually preparing a replacement for? In any case, leaving such a service unattended and not updating it is a ticking time bomb that could explode later.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/qiwi\/blog\/477682\/\"><img decoding=\"async\" alt=\"Legacy services in your infrastructure\" src=\"\/wp-content\/uploads\/2019\/12\/d33a4a7983d1c440570bc0ff8da0f1d6.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>Before we move on to how we at QIWI work with our Legacy services, I'll tell you how we organized the services in Wallet. I have been responsible for its functionality for two years now. If there is any problem, I always get the first call. I usually don't have the audacity to call someone else at 11 PM, so I end up sitting down to figure out all the services in our domain. <\/p>\n<p>But like any person, I love to sleep at night, so I tried to figure out the operation: 'Guys, why are you calling me?' To which I received a succinct response like 'Who else?'. Because I fix services, and the guys simply don\u2019t know who else to call.<\/p>\n<p>So, at one of the backend team retrospectives for Wallet, we decided that we needed to create a table listing our wallet services, microservices, and monoliths, along with the people responsible for them. Tables are generally useful within reasonable limits.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nIn addition to the information about who is responsible for what, there were answers to questions: who owns the service, who is responsible for its development, architecture, and lifecycle. The people responsible for this service are those who can fix it if needed. The service owner has the right to leave +2 in commits, and the responsible parties must also be present at the review before this service accepts a new commit.<\/p>\n<p>As time went on, new practices began to be adopted, such as migration to Kubernetes, various checkstyle, spotbugs, ktlint, having logs in Kibana, and autodiscovery of services instead of specifying addresses directly, among other useful features. Our table allowed us to maintain the relevance of our services everywhere. For us, it serves as a checklist indicating that this service can perform certain tasks, while there are others it cannot yet do. But we continued to evolve, realizing that we were missing information about our services, such as where the service source code is located, where build tasks are launched in TeamCity, how they are deployed, where the end-to-end test sources are stored, architectural grooming photos, and decisions made. Ideally, we wanted all this information to be readily available when needed. Therefore, our table became the starting point for information retrieval.<\/p>\n<p>However, QIWI, while still preserving the spirit of a startup, is a large company. We\u2019ve been around for 12 years, and teams change: people leave, new people join, and new teams are formed. We found several services on our domain that were inherited from previous developers. Some came from developers from other teams, and some were indirectly related to the Wallet, which is why we now have that service on our balance. Why investigate how everything works? The service works, and we have product features that need to be implemented.<\/p>\n<h2>As it happens<\/h2>\n<p>\nBut at some point, we discover that the service stops performing its function, something is broken \u2014 what to do in such a situation? The service simply ceased to work. Completely. We found out about it, first by chance, and secondly, after six months. It happens. The only thing we knew was which virtual machines the service was running on and where its source code was located. We do a git clone and immerse ourselves in the thoughts of the person who wrote this several years ago, but what do we see? No familiar Spring Boot, even though we are used to it; we are full stack and all that. Maybe there is Spring Framework? But no.<\/p>\n<p>The guy who wrote all this was harsh and wrote everything in pure Java. There are no familiar tools for the developer, and the idea arises \u2014 we should rewrite it all. After all, we have microservices, and from every toaster comes the familiar message, \u201cGuys, microservices are what you need!\u201d If something goes wrong, you can easily pick any language and everything will be fine.<\/p>\n<p>The thing is, right now we don\u2019t have a client who is responsible for this service. What were their business requirements, what is this service supposed to do? And the service is tightly integrated into your business processes. <\/p>\n<p>Now tell me, how easy is it to rewrite a service without knowing its business requirements? It\u2019s unclear how the service logs, whether there are metrics \u2014 that\u2019s unknown. What they might be, if they exist \u2014 that\u2019s even more uncertain. And at the same time, the service has a huge number of classes with unclear business logic. Some of it goes into some database, which we also don\u2019t know anything about yet. <\/p>\n<h2>Where do we start?<\/h2>\n<p>\nWith the most logical thing \u2014 the presence of tests. There\u2019s usually some kind of logic written there, and we can draw conclusions about what's happening. Right now, TDD is fashionable, but we see that the same situation existed 5 years ago: there are almost no unit tests, and they won\u2019t tell us anything significant. Except perhaps some verification of how some xml is signed with some custom certificate.<\/p>\n<p>We couldn't figure out anything from the code, so we decided to check what was wrong in the virtual machine. We opened the service logs and found an error with the HTTP client: a self-signed certificate embedded in the application's resources had expired. We contacted our analysts; they requested a new certificate, which was issued, and the service is now operational again. One would think that's the end of it. But is it really? The service is operational, performing some function necessary for our business. We have certain application development standards, which you likely have as well. For instance, logging should not be stored on the node in a folder but should go to some storage, like Elasticsearch, and be viewed in Kibana. We can also recall the golden metrics. This includes service load, the number of requests to the service, whether it's live or not, and how the HealthCheck is performing. At the very least, these metrics will help determine when it can be safely decommissioned and forgotten like a bad dream.<\/p>\n<h2>What to do<\/h2>\n<p>\nTherefore, we add such an old service to a table and then look for volunteer developers to take charge of it and bring it up to standard: they will write at least some information about the service, add links to dashboards in Grafana, and tasks for deployment, because we can't just upload files using FTP manually. <\/p>\n<p>The main question is, how much time will all this volunteer activity take? One sprint for a reasonably experienced developer, for example, during a 20% technical debt period. But how much time did it take to understand all the embedded logic for communicating with some government system and upgrade it to newer technologies? I can't guarantee this \u2014 it could be a month, or maybe two months of team work. I'm speaking from experience with integrations with new services at this time.<\/p>\n<p>In the end, the business value output from this is none whatsoever. Absolutely none. Taking service support and spending a little time on it is normal. But after our typical struggles with the service, we added it to the table, included information about it, and perhaps, someday we will rewrite it. But for now, it meets our service operation standards.<\/p>\n<p>As a result, I would like to propose a plan for what to do with legacy services. <\/p>\n<p><b>Rewriting legacy from scratch is a bad idea.<\/b><br \/>\nSeriously, you don't even need to think about it. It's clear that it would be nice, and some advantages are seen, but usually, it's not needed by anyone, including yourselves.<\/p>\n<p><b>Guide<\/b><br \/>\nUncover the source codes of your applications, create a guide that indicates what and where it is located and how it works, and include a project description (a sort of readme.md) so you can quickly understand where the logs and metrics are. The developer who will be dealing with this after you will thank you.<\/p>\n<p><b>Understand the Domain<\/b><br \/>\nIf you own a domain, try to stay on top of things. It sounds clich\u00e9, yes, but not everyone ensures that services are unified. Yet working in one standard is actually significantly easier.<\/p>\n<p class=\"for_users_only_msg\">Only registered users can participate in the survey. <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/auth\/login\/\">Please log in<\/a><\/noindex>, please.<\/p>\n<h2 class=\"default-block__polling-title\">What do you do with your legacy?<\/h2>\n<ul class=\"poll-result\">\n<li class=\"poll-result__item\">\n<p>                <strong class=\"poll-result__data-percent\">31.5%<\/strong>Rewriting from scratch is the right way12<\/p>\n<\/li>\n<li class=\"poll-result__item\">\n<p>                <strong class=\"poll-result__data-percent  poll-result__data-percent_winner\">52.6%<\/strong>Almost the same as you20<\/p>\n<\/li>\n<li class=\"poll-result__item\">\n<p>                <strong class=\"poll-result__data-percent\">10.5%<\/strong>We have no legacy, we're doing great4<\/p>\n<\/li>\n<li class=\"poll-result__item\">\n<p>                <strong class=\"poll-result__data-percent\">5.2%<\/strong>I'll write in the comments2<\/p>\n<\/li>\n<\/ul>\n<p>    38 users voted. 20 users abstained.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/qiwi\/blog\/477682\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041f\u0430\u0448\u0430 \u0427\u0435\u0440\u043d\u044f\u043a, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 QIWI, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e\u043c. \u041e Legacy. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Legacy-\u0441\u0435\u0440\u0432\u0438\u0441? Legacy-\u0441\u0435\u0440\u0432\u0438\u0441 \u2014 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u043a\u0430\u0441\u0430\u043b\u0441\u044f \u0443\u0436\u0435 \u043d\u0435\u0434\u0435\u043b\u044e\/\u043c\u0435\u0441\u044f\u0446\/\u0433\u043e\u0434? \u0418\u043b\u0438 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432\u0430\u043c\u0438, \u043d\u043e \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434? \u0410 \u0442\u0435\u043f\u0435\u0440\u044c-\u0442\u043e \u0432\u044b \u043a\u0440\u0443\u0447\u0435 \u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":53443,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-53442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041f\u0430\u0448\u0430 \u0427\u0435\u0440\u043d\u044f\u043a, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 QIWI, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e\u043c. \u041e Legacy. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Legacy-\u0441\u0435\u0440\u0432\u0438\u0441?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/legacy-servisy-v-vashej-infrastrukture\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Legacy-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041f\u0430\u0448\u0430 \u0427\u0435\u0440\u043d\u044f\u043a, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 QIWI, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e\u043c. \u041e Legacy. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Legacy-\u0441\u0435\u0440\u0432\u0438\u0441?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/legacy-servisy-v-vashej-infrastrukture\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-12-01T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:01:20+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Legacy Services in Your Infrastructure | ProHoster","description":"Hello! My name is Pasha Chernyak, I'm a lead developer at QIWI, and today I want to talk about the inevitable. About Legacy. Let's start with the question: what is a Legacy service?","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/legacy-servisy-v-vashej-infrastrukture","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Legacy-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 | ProHoster","og:description":"\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041f\u0430\u0448\u0430 \u0427\u0435\u0440\u043d\u044f\u043a, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 QIWI, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e\u043c. \u041e Legacy. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u0430: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Legacy-\u0441\u0435\u0440\u0432\u0438\u0441?","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/legacy-servisy-v-vashej-infrastrukture","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-12-01T21:00:00+00:00","article:modified_time":"2020-02-18T11:01:20+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"53442","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-24 07:23:42","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 20:25:27","updated":"2026-01-24 07:23:42","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=53442"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53442\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/53443"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=53442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=53442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=53442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}