{"id":853,"date":"2019-12-18T12:00:00","date_gmt":"2019-12-18T16:00:00","guid":{"rendered":"http:\/\/efsavage.com\/blog\/?p=853"},"modified":"2019-12-15T18:44:29","modified_gmt":"2019-12-15T22:44:29","slug":"stack2020-backend-basics","status":"publish","type":"post","link":"https:\/\/efsavage.com\/blog\/posts\/stack2020-backend-basics\/","title":{"rendered":"Stack2020: Backend Basics"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1080\" src=\"http:\/\/efsavage.com\/blog\/wp-content\/uploads\/2019\/12\/network-2402637.jpg\" alt=\"\" class=\"wp-image-865\"\/><figcaption>Image by <a href=\"https:\/\/pixabay.com\/users\/bsdrouin-5016447\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2402637\">Bethany Drouin<\/a> from <a href=\"https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2402637\">Pixabay<\/a><\/figcaption><\/figure>\n\n\n\n<p>So the side project I mentioned a few posts ago is still just an idea, before I start building it I will need to pick a stack.  I&#8217;ve been out of the non-big-tech loop for a while (one of the main drivers for this project) so this may take a while, but should be a fun experience.<\/p>\n\n\n\n<p>The last time I picked a fresh stack was late 2013.  We were building Mondogoal and needed to get to market very fast on a limited budget.  We started in late November 2013 and needed to be in beta by March, and ready to launch (and get a gaming license!) in time for the 2014 World Cup that started in June.  With two developers.  <\/p>\n\n\n\n<p>Somehow, we made it, and I think that one of the main factors was in how we picked our stack.  In short, we kept things as boring as possible.  The backend was all stuff I could do in my sleep: Java 7 with MySQL, using Maven and Spring, running on Tomcat in a mix of AWS and Continent 8.  The only significant piece that I didn&#8217;t know well was Obsidian Scheduler, which is a fairly lightweight job scheduler, and we added Firebase later on.  The frontend was backbone with a grunt build, which had been out for a while.  This stability and going down well-trod paths let us focus on executing the business and product instead of tinkering and I doubt we would have been able to hit our deadline if we&#8217;d opted to explore some of the cool new stuff that was coming out.  While the business didn&#8217;t succeed long-term, I have no regrets about those choices and can assign no blame to what we built it on.<\/p>\n\n\n\n<p>Luckily, this new project has no deadline! It&#8217;s mainly a vehicle of exploration for me.  I would definitely like to launch it, but if that takes months (unlikely) or years that&#8217;s OK.  Let&#8217;s recap the &#8220;requirements&#8221; of this project:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Learn how to build a modern front end.<\/li><li>Give me a reason to explore the Google Cloud offerings (since those products are effectively my customers for my day job).<\/li><li>Get back up to speed on things like analytics.<\/li><li>Scratch an itch I\u2019ve had for a long time (a nerdy economy-based game).<\/li><li>Doesn\u2019t risk any conflict with my day job.<\/li><li>Give me something to blog about!<\/li><\/ol>\n\n\n\n<p>#2 is going to make some of these decisions easy.  As a loyal dogfooder and company man (despite the lack of employee discount&#8230;), I will default to Google Cloud where possible.  A quick check puts most of the basics on par with Amazon as far as cost goes.  If GCP doesn&#8217;t offer it, then it&#8217;s up for grabs.  Let&#8217;s start picking!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">But wait&#8230;what is and isn&#8217;t part of The Stack?<\/h3>\n\n\n\n<p>I take a broad view of the term, to me The Stack is basically everything in the shop.  You could (and I might in a future post) break this down into groups (tech stack, marketing stack, etc.), but to me if it&#8217;s a part of making the business run and it&#8217;s something you didn&#8217;t build yourself that you expect employees to get or be skilled at, then it&#8217;s part of The Stack.  This includes everything from Java or Python to Salesforce and Gmail.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Domain Hosting<\/h3>\n\n\n\n<p><strong>Winner: Google Domains<\/strong><\/p>\n\n\n\n<p><em>Cost: $14\/year<\/em><\/p>\n\n\n\n<p><em>Status: Up and Running<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Initial Thoughts<\/h5>\n\n\n\n<p>I&#8217;ve got domains hosted at lots of places.  GoDaddy, Namecheap, Hover, OpenSRS, I even still have one at Network Solutions.  Compared to those, registering on Google was a pretty painless process.  The pricing is more transparent than most other places (no first-year rates that go way up later).  They also didn&#8217;t upsell junk I don&#8217;t need too hard.  Setting up G Suite was also pretty easy (as you&#8217;d hope), I had it all running in like 15 minutes without touching any DNS entries.<\/p>\n\n\n\n<p>To dogfood even deeper, I&#8217;m using a .app TLD, which Google owns, and was a few bucks cheaper than the other registrars.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Email Hosting<\/h3>\n\n\n\n<p><strong>Winner: G Suite<\/strong><\/p>\n\n\n\n<p><em>Cost: $5\/user\/month<\/em><\/p>\n\n\n\n<p><em>Status: Up and Running<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Initial Thoughts<\/h5>\n\n\n\n<p>As most of us are, I&#8217;m pretty familiar with all of these tools, and I&#8217;m pretty sure most surveys would have Gmail at the top of people&#8217;s preferred email services.  As a bonus, setting this up was super easy since the domain is also with Google.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Compute Servers<\/h3>\n\n\n\n<p><strong>Winner: Kubernetes\/Compute Engine<\/strong><\/p>\n\n\n\n<p><em>Cost: TBD<\/em><\/p>\n\n\n\n<p><em>Status: Exploration<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Reasoning<\/h5>\n\n\n\n<p>There were two things that came up in virtually every conversation\/interview I had during my last job search, React and Kubernetes (AKA K8s).  Virtually everyone was using these or trying to move to them.  I&#8217;ve never touched K8s, so combined with #2 above, I feel like I should play with it.<\/p>\n\n\n\n<p>I have used App Engine, and I assume non-K8s Compute Engine is pretty similar to AWS&#8217;s EC2 which I&#8217;ve used quite a bit, so I will fall back to those when it makes sense to do so.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Backend Language<\/h3>\n\n\n\n<p><strong>Winner: Java<\/strong><\/p>\n\n\n\n<p><em>Cost: Free<\/em><\/p>\n\n\n\n<p><em>Status: Defrosting<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Reasoning<\/h5>\n\n\n\n<p>I am a moderately capable but generally reluctant programming language polyglot.  My first employee profile badge at Facebook was &#8220;Committed Code in 5 Languages&#8221;.  But I&#8217;ve never bought into &#8220;pick the best langauge for the job&#8221; and tend to favor the approach of &#8220;pick the best language for all the jobs&#8221;.  This offer does not extend to JavaScript backends.<\/p>\n\n\n\n<p>Java was my primary language from probably 2000 through 2016.  Since then I&#8217;ve mostly been writing C++. I&#8217;ve grown to like the language, it is lightyears better than it was when I started writing Java, but I&#8217;ve never worked in it outside of the padded walls of FB\/Google&#8217;s infrastructure, and to be honest, am not terribly interested in doing so. <\/p>\n\n\n\n<p>While we upgraded our runtimes to Java 8 at Mondogoal after a bit, we never got around to really using any of the features, so I&#8217;m effectively only up-to-date through Java 7, and would like to explore the recent additions.  There are also some new parts of the Java ecosystem that are worth exploring, like Quarkus and GraalVM.<\/p>\n\n\n\n<p>Also, I just kind of miss working in it.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Runners Up<\/h5>\n\n\n\n<p>There are two languages I am interested in tinkering with, once I&#8217;ve warmed back up on Java: Kotlin and Rust.  They both have had a pretty good reception and have some attractive features.  Kotlin as a JVM language should be easy enough to experiment with.  If I can find a task that would benefit from Rust I will probably give it a shot.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">IDE<\/h3>\n\n\n\n<p><strong>Winner: IntelliJ IDEA Ultimate<\/strong><\/p>\n\n\n\n<p><em>Cost: $149\/$119\/$89 for years 1\/2\/3+<\/em><\/p>\n\n\n\n<p><em>Status: Trial<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Reasoning<\/h5>\n\n\n\n<p>I initially wrote Java in emacs, then JCreator, then switched to Eclipse c2002 and used it through 2016.  I&#8217;ve tried IntelliJ a few times over the years but never really got the hang of it or saw a lot of value in it.<\/p>\n\n\n\n<p>However, Google does quite a bit of Java work, and their primary and only fully supported IDE for it is IntelliJ.  I&#8217;ve also been using CLion (basically IntelliJ for C++) and it&#8217;s been OK.<\/p>\n\n\n\n<p>The &#8220;Ultimate&#8221; edition of IntelliJ includes support for other languages and even React so that&#8217;s a strong argument in favor of trying it out.  I&#8217;m not opposed to ultimately landing on using different tools to work in different languages (e.g. I often used Eclipse for Java and Sublime for JS), but if you can do it all in one, that&#8217;s nice.<\/p>\n\n\n\n<p>My Eclipse muscle memory is very strong, so I expect this to be somewhat painful transition, but I will give it as fair a shot as I can manage.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Java Build<\/h3>\n\n\n\n<p><strong>Winner: Gradle<\/strong><\/p>\n\n\n\n<p><em>Cost: Free<\/em><\/p>\n\n\n\n<p><em>Status: Exploring<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Reasoning<\/h5>\n\n\n\n<p>There are only two real choices here: Maven and Gradle.  And given that Gradle uses Maven-style repositories, they aren&#8217;t even <em>that <\/em>different in many respects.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Maven<\/h6>\n\n\n\n<p>I&#8217;ve used Maven for many years, since Ant, and like most people had some struggles with it initially.  I eventually learned to coexist with it, or at least avoid its sharp edges, and would just copy\/paste my pom from one project to next and had minimal issues.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Gradle<\/h6>\n\n\n\n<p>Gradle has three main &#8220;advantages&#8221; over Maven that people seem to crow about.  <\/p>\n\n\n\n<p>One is that it&#8217;s written in Groovy, and you can therefore script your build and do advanced stuff more easily than writing a Maven plugin.  I would put this in the Probably a Bad Idea category, like stored procedures.  I bet there are some cases where this is useful, but probably far more where it&#8217;s a kludgy workaround to some other problem people don&#8217;t want to solve.<\/p>\n\n\n\n<p>The second is that it&#8217;s written in Groovy, which is not XML.  I always thought XML was nice when used properly, and that config files were one of those proper uses.  However, something about it causes a primal aversion in many people and they convince themselves that things that are not XML are inherently better than things that are.<\/p>\n\n\n\n<p>The third is that you can do different build versions more easily, and this one I get, especially in the context of things like Android apps.  Given that I might be targetting different JVMs (regular and GraalVM) this might be useful, but probably won&#8217;t be.<\/p>\n\n\n\n<p>So I&#8217;m not really impressed with Gradle either, but given that there are literally only two choices, I might as well know both.   It&#8217;s pretty trivial for a small project to switch back or even run both, so this is a pretty low-risk experiment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Source Control<\/h3>\n\n\n\n<p><strong>Winner: Git + Monorepo<\/strong><\/p>\n\n\n\n<p><em>Cost: Free (plus hosting)<\/em><\/p>\n\n\n\n<p><em>Status: Up and Running<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Reasoning<\/h4>\n\n\n\n<p>I think there are only 3 real options these days for version control that don&#8217;t fall into the &#8220;never heard of it&#8221; category for most people.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Git<\/h5>\n\n\n\n<p>The dominant force, and the only one that many developers know these days.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Mercurial (hg)<\/h5>\n\n\n\n<p>I have grown to prefer Mercurial in a code-review + monorepo environment since starting to use it at Facebook.  Implicit branches and easy commit management map very well to the &#8220;commits should do one thing&#8221; best practices as opposed to the pull request pattern where mainline commits should favor comprehensiveness.  For a solo project this isn&#8217;t relevant and it&#8217;s basically the same thing as Git.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Subversion (svn)<\/h5>\n\n\n\n<p>For solo\/small teams, SVN is totally fine, it&#8217;s basically how you&#8217;d be using a DVCS anyways, but if you don&#8217;t have a server running already then it&#8217;s probably not worth setting one up.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Mono vs. Multi Repo<\/h5>\n\n\n\n<p>For large organizations, monorepo is the clear way to go for reasons I can discuss elsewhere.  For solo\/small teams, it doesn&#8217;t really matter, and it *might* be better to split up your repos if you have a *very* clear separation (e.g. front\/back end), which is how we did it at Mondogoal, but I would say to start with a monorepo and only split if there is a compelling reason to do so (e.g. regulations, licensing).<\/p>\n\n\n\n<p>I&#8217;m going to call this a toss-up between Git and Mercurial and give Git the edge due to the fact that it&#8217;s massively more popular and more likely to integrate well with other things like IDEs and deployment tools.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Source Control Host<\/h3>\n\n\n\n<p><strong>Winner: Google Cloud Source Repositories<\/strong><\/p>\n\n\n\n<p><em>Cost: Free to 5 users &amp; 50GB storage\/egress, then $1\/user\/month and $0.10\/GB\/month<\/em><\/p>\n\n\n\n<p><em>Status: Exploring<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Reasoning<\/h5>\n\n\n\n<p>Given that I&#8217;ve chosen Git, GitHub is the obvious first choice here, but since Google has a product we&#8217;ll invoke requirement #2.  This also might integrate better with the other services I&#8217;ll be using, though I have barely researched that beyond the marketing.<\/p>\n\n\n\n<p>One of the nice things with Git is that it&#8217;s trivial to multi-host, so if I ever find a compelling reason to also use GitHub, I can use both or just switch.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next Up<\/h2>\n\n\n\n<p>There&#8217;s a lot left to do here, databases, frontend, and more.  Stay tuned!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So the side project I mentioned a few posts ago is still just an idea, before I start building it I will need to pick a stack. I&#8217;ve been out of the non-big-tech loop for a while (one of the main drivers for this project) so this may take a while, but should be a&hellip; <\/p>\n<p class=\"simppeli-read-more\"><a href=\"https:\/\/efsavage.com\/blog\/posts\/stack2020-backend-basics\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Stack2020: Backend Basics<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":865,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,88,167,3,1],"tags":[323,358,398,127,402,401,399,376,361,397],"series":[],"class_list":["post-853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-programming","category-servers","category-software","category-uncategorized","tag-domains","tag-eclipse","tag-email","tag-git","tag-google-cloud","tag-gradle","tag-intellij","tag-java","tag-maven","tag-stack2020"],"jetpack_featured_media_url":"https:\/\/efsavage.com\/blog\/wp-content\/uploads\/2019\/12\/network-2402637.jpg","jetpack_shortlink":"https:\/\/wp.me\/p1AkJt-dL","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/posts\/853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/comments?post=853"}],"version-history":[{"count":4,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/posts\/853\/revisions"}],"predecessor-version":[{"id":869,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/posts\/853\/revisions\/869"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/media\/865"}],"wp:attachment":[{"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/media?parent=853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/categories?post=853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/tags?post=853"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/efsavage.com\/blog\/wp-json\/wp\/v2\/series?post=853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}