You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
4.2 KiB
115 lines
4.2 KiB
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|
|
|
<!-- Enable responsiveness on mobile devices--> |
|
<!-- viewport-fit=cover is to support iPhone X rounded corners and notch in landscape--> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover"> |
|
|
|
<title>Julio Biason .Me 4.3</title> |
|
|
|
<!-- CSS --> |
|
<link rel="stylesheet" href="https://blog.juliobiason.me/print.css" media="print"> |
|
<link rel="stylesheet" href="https://blog.juliobiason.me/poole.css"> |
|
<link rel="stylesheet" href="https://blog.juliobiason.me/hyde.css"> |
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface"> |
|
|
|
|
|
|
|
|
|
|
|
</head> |
|
|
|
<body class=" "> |
|
|
|
<div class="sidebar"> |
|
<div class="container sidebar-sticky"> |
|
<div class="sidebar-about"> |
|
|
|
<a href="https://blog.juliobiason.me"><h1>Julio Biason .Me 4.3</h1></a> |
|
|
|
<p class="lead">Old school dev living in a 2.0 dev world</p> |
|
|
|
|
|
</div> |
|
|
|
<ul class="sidebar-nav"> |
|
|
|
|
|
<li class="sidebar-nav-item"><a href="/">English</a></li> |
|
|
|
<li class="sidebar-nav-item"><a href="/pt">Português</a></li> |
|
|
|
<li class="sidebar-nav-item"><a href="/tags">Tags (EN)</a></li> |
|
|
|
<li class="sidebar-nav-item"><a href="/pt/tags">Tags (PT)</a></li> |
|
|
|
|
|
</ul> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="content container"> |
|
|
|
<div class="post"> |
|
<h1 class="post-title">Things I Learnt The Hard Way - One Version To Add, One Version To Remove</h1> |
|
<span class="post-date"> |
|
2019-07-30 |
|
|
|
<a href="https://blog.juliobiason.me/tags/books/">#books</a> |
|
|
|
<a href="https://blog.juliobiason.me/tags/things-i-learnt/">#things i learnt</a> |
|
|
|
<a href="https://blog.juliobiason.me/tags/versions/">#versions</a> |
|
|
|
<a href="https://blog.juliobiason.me/tags/upgrades/">#upgrades</a> |
|
|
|
</span> |
|
<p>A lot of things change during development. One day you need a field, another |
|
day that field may be completely different. For those cases, use one version |
|
to add the new field and another to remove.</p> |
|
<span id="continue-reading"></span> |
|
<p>You have a database with a lot of customers and their ID is numerical. But for |
|
some reason, they now need to be strings. Instead of changing the field type |
|
and doing a whole migration, make a deploy with a new field, in which you'll |
|
keep the old <em>and</em> the new format going on and, in the next release, remove |
|
the old field. No downtime. You can even run the migration while the system is |
|
up, since the new field won't be used.</p> |
|
<p>(I'm simplifying the problem a lot here, 'cause the customer would have |
|
references all around your system, but you get the point, right?)</p> |
|
<p>I had a problem in which we store the link for an object directly in the |
|
backend (we shouldn't, that's a frontend problem, but that's a discussion for |
|
another time); our interface is changing and so should the link. If we did a |
|
change in the link directly, that would mean the backend would have to be |
|
deployed <em>at the same time</em> as the new interface; by adding the new link |
|
format in another field, we can deploy the backend easily without breaking the |
|
current system.</p> |
|
<div> |
|
|
|
<div style="float:left"> |
|
<< <a href="/books/things-i-learnt/transparent">Be Transparent With The User</a> |
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div style="float:right"> |
|
<a href="/books/things-i-learnt/monitoring">Learn To Monitor</a> >> |
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</body> |
|
|
|
</html>
|
|
|