SlideShare a Scribd company logo
Memes in the Cloud –
Building a full-stack app with Golang and
Google Cloud Platform in one week
Dr. Felix Raab | Head of Engineering @ KI Labs Munich | ki-labs.com
f.raab@kigroup.de | medium.com/@fe9lix
SCOPE OF TALK
SCOPE OF TALK
Case Study
Project idea and journey for an MVP finished within one week
SCOPE OF TALK
Case Study
Project idea and journey for an MVP finished within one week
Software Engineering for Cloud Apps
The “full” stack: Frontend, Backend, Build, Deployment, Logging…
Towards the end of the talk: Software Engineering practices in Go
SCOPE OF TALK
Case Study
Project idea and journey for an MVP finished within one week
Software Engineering for Cloud Apps
The “full” stack: Frontend, Backend, Build, Deployment, Logging…
Towards the end of the talk: Software Engineering practices in Go
Memes
At the heart of the app itself – consequently, Memes to illustrate
some opinionated views
BACK AT MY PREVIOUS EMPLOYER…
Hours claiming – trying not get “shitlisted”…
because the boss would be notified!
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
Idea – Every Friday…
Schedule an hours claim reminder mail containing
a meme, to myself.
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
FIRST: HOW TO CHOOSE A CLOUD?
…when you can start from scratch – no corporate
constraints, no restrictions, no Frankfurt.
LOOK AT THE HISTORY OF CLOUD COMPANIES
LOOK AT THE HISTORY OF CLOUD COMPANIES
LOOK AT THE HISTORY OF CLOUD COMPANIES
LOOK AT THE HISTORY OF CLOUD COMPANIES
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
AMAZON
WEB SERVICES
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
AMAZON
WEB SERVICES
GOOGLE
CLOUD PLATFORM
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
AMAZON
WEB SERVICES
GOOGLE
CLOUD PLATFORM
Enterprise
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
AMAZON
WEB SERVICES
GOOGLE
CLOUD PLATFORM
Enterprise Ops
LOOK AT THE HISTORY OF CLOUD COMPANIES
MICROSOFT
AZURE
AMAZON
WEB SERVICES
GOOGLE
CLOUD PLATFORM
Enterprise Ops S(R)E
–Brave New Geek
“Multi-Cloud Is a Trap”
https://bravenewgeek.com/multi-cloud-is-a-trap/
WORKS LIKE YOU WOULD EXPECT IT…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
API access, permissions, config…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
CI/CD
API access, permissions, config…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
CI/CD
Database (NoSQL document store)
API access, permissions, config…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
CI/CD
Database (NoSQL document store)
Object Storage (Blobs…)
API access, permissions, config…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
CI/CD
Database (NoSQL document store)
Object Storage (Blobs…)
Task Queue (with scheduling!)
API access, permissions, config…
WORKS LIKE YOU WOULD EXPECT IT…
Service Offerings used to build MemeMail
More on that later…
CI/CD
Database (NoSQL document store)
Object Storage (Blobs…)
Task Queue (with scheduling!)
Logging…
API access, permissions, config…
The Frontend – Diving into the
world of JavaScript?
https://exceptionnotfound.net/big-ball-of-mud-the-daily-software-anti-pattern/
THE FULLSTACK IN GO –
SO HOW ABOUT
WEBASSEMBLY (WASM)?
NO! BECAUSE…
NO! BECAUSE…
NO! BECAUSE…
Readability, Debugging, Size…

(but maybe in the future)
NO WEBASSEMBLY.
MAYBE ELM THEN?
NO! BECAUSE…
Learning curve, different paradigm,
transpiling to JS, libraries… – remember, we
have one week to finish!
VANILLA JS (ES 6)! 

BUT WHICH FRAMEWORK?
RESIST THE TEMPTATION TO…
RESIST THE TEMPTATION TO…
RESIST THE TEMPTATION TO…
Also, do not use Github Stars as your only criterion!
Popularity is one thing…
HOW TO CHOOSE
HOW TO CHOOSE
1) Does it solve your problem in a simple way?
Rendering the frontend and adding interaction without sprinkling
jQuery calls throughout your code base.
HOW TO CHOOSE
1) Does it solve your problem in a simple way?
Rendering the frontend and adding interaction without sprinkling
jQuery calls throughout your code base.
2) Look at the quality of the documentation!
Because you need to read it and be able to understand it – quickly!
VUE.JS SEEMS TO MATCH.
BUT WHICH
ARCHITECTURE?
SO MANY APPROACHES…
…MVVM, Flux, Redux, SAM, ELM Architecture…?
What is the essence?
Building a full-stack app with Golang and Google Cloud Platform in one week
STATE MUTATION
STATE MUTATION
Take notice when somebody tells you
that you should or can entirely avoid mutating state.
MUTATING STATE. HERE’S HOW…
MUTATING STATE. HERE’S HOW…
1) Put your entire app state into a single model
Avoid primitive obsession – use proper objects! This is your single source of truth.
MUTATING STATE. HERE’S HOW…
1) Put your entire app state into a single model
Avoid primitive obsession – use proper objects! This is your single source of truth.
2) Dispatch Actions from the UI to trigger a state mutation
Do not yet mutate the state in the action itself! Actions are intents with payloads.
MUTATING STATE. HERE’S HOW…
1) Put your entire app state into a single model
Avoid primitive obsession – use proper objects! This is your single source of truth.
2) Dispatch Actions from the UI to trigger a state mutation
Do not yet mutate the state in the action itself! Actions are intents with payloads.
3) Accept or reject the state mutation in your model
At the end of your (async.) action, “commit” / “propose” a new value to the model.
MUTATING STATE. HERE’S HOW…
1) Put your entire app state into a single model
Avoid primitive obsession – use proper objects! This is your single source of truth.
2) Dispatch Actions from the UI to trigger a state mutation
Do not yet mutate the state in the action itself! Actions are intents with payloads.
3) Accept or reject the state mutation in your model
At the end of your (async.) action, “commit” / “propose” a new value to the model.
4) Update the UI when the state changes
Derive the state to render from your model, e.g. by UI bindings.
VUEX.JS KIND OF
SUPPORTS THAT PATTERN
–Ryan Dahl
“[...] if you’re building a
server, I can’t imagine using
anything other than ”
THE BACKEND.
HOW TO BUILD?
HOW TO BUILD?
Go 1.11
Because Go Modules!
HOW TO BUILD?
Go 1.11
Because Go Modules!
Docker
To be flexible with Go versions

Multi-stage build!
HOW TO BUILD?
Go 1.11
Because Go Modules!
Docker
To be flexible with Go versions

Multi-stage build!
entr + Makefile
No Rake, Grunt, Gulp, NPM, Yarn –
Makefile + Bash Script fine!
Check entrproject.org
APP ENGINE – START SIMPLE
APP ENGINE – START SIMPLE
APP ENGINE – START SIMPLE
App Engine Flex
You can migrate to Kubernetes (GKE) later if you wish to – but for
your MVP, don’t waste time managing a cluster.
APP ENGINE – START SIMPLE
App Engine Flex
You can migrate to Kubernetes (GKE) later if you wish to – but for
your MVP, don’t waste time managing a cluster.
Use defaults
Start with App Engine default options and auto-scaling. Nobody
knows how much traffic you will get. Watch and see what happens.
SEPARATE THE FRONTEND
AND BACKEND?
YES AND NO!
YES AND NO!
Expose your services as API to the frontend
Frontend is rendered via a Go template. On that rendered page, a
Single Page App can run in memory and call your backend API.
Use Go templates for other static pages. Makes routing easier.
YES AND NO!
Expose your services as API to the frontend
Frontend is rendered via a Go template. On that rendered page, a
Single Page App can run in memory and call your backend API.
Use Go templates for other static pages. Makes routing easier.
But no need to create two deployment units
No need for premature optimisation (scaling). One Go binary is
simpler than two Go binaries! 

Static assets are loaded from the file system in your container.
CI/CD
CI/CD
Google Cloud Build
Will trigger and deploy when you push to your Git repo.
Maintaining your own Jenkins server and setting up a build pipeline
can be more time-consuming than you might think.
CI/CD
Google Cloud Build
Will trigger and deploy when you push to your Git repo.
Maintaining your own Jenkins server and setting up a build pipeline
can be more time-consuming than you might think.
App Engine Deployment
Straightforward versioning and service concept via DNS –
version.service.appname
Promoting app to production, traffic splitting etc. – 

supported out of the box
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
The cloud can be mean and slow.
PLAYGROUNDS SAVE TIME
Create a GCP “Playground” project
Got stuck with Cloud Datastore (vs. Cloud Firestore) and 

Cloud Tasks (only certain EU region).
Led me to test service offerings first via playground.
WHICH ARCHITECTURE –
ONIONS AND HEXAGONS?
SO MANY LAYERS AND CONCEPTS
Also, ask yourself : Is there a rich domain? Or are
you really building a CRUD app?
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
Take notice when nobody tells you to separate functionality into
lots and lots of really small methods and delegating objects.
A QUESTION OF PHILOSOPHIES?
A QUESTION OF PHILOSOPHIES?
A QUESTION OF PHILOSOPHIES?
Robert Martin (Uncle Bob)
http://2017.agilesummit.gr/speakers/uncle-bob/
A QUESTION OF PHILOSOPHIES?
John Ousterhout
https://www.youtube.com/watch?v=bmSAYlu0NcY
Robert Martin (Uncle Bob)
http://2017.agilesummit.gr/speakers/uncle-bob/
DEEP VS SHALLOW MODULES
DEEP VS SHALLOW MODULES
Shallow ModuleDeep module
Interface
Functionality
DEEP VS SHALLOW MODULES
Shallow Module
“The best modules are deep: they allow a lot of functionality to be accessed
through a simple interface. A shallow module is one with a relatively complex
interface, but not much functionality: it doesn’t hide much complexity.” 

– From A Philosophy of Software Design, John Ousterhout
Deep module
Interface
Functionality
EXAMPLE OF A DEEP MODULE
Meme Image Generation
Package “meme”, image.go: Simple interface, a lot of functionality.
PASS-THROUGH CODE
TENDS TO BE SHALLOW – BUT
HOW MUCH SEPARATION?
Building a full-stack app with Golang and Google Cloud Platform in one week
Separate the outside from the inside
Kind of onion, just fewer layers
Separate the outside from the inside
Kind of onion, just fewer layers
Outside (package http)
Protocol, routing (gorilla/mux), handlers
Separate the outside from the inside
Kind of onion, just fewer layers
Outside (package http)
Protocol, routing (gorilla/mux), handlers
Inside (package meme)
Core, your actual (business) functionality
WHAT ABOUT
INTERFACES?
IMPLICIT INTERFACE CONFORMANCE
IMPLICIT INTERFACE CONFORMANCE
Awesome Golang feature, but here…
IMPLICIT INTERFACE CONFORMANCE
Awesome Golang feature, but here…
IMPLICIT INTERFACE CONFORMANCE
Awesome Golang feature, but here…
IMPLICIT INTERFACE CONFORMANCE
Awesome Golang feature, but here…
To be able to inject a different
implementation, you would need to
either create an interface that
mirrors the datastore api or create a
generic interface -> shallow wrapper
IMPLICIT INTERFACE CONFORMANCE
Awesome Golang feature, but here…
To be able to inject a different
implementation, you would need to
either create an interface that
mirrors the datastore api or create a
generic interface -> shallow wrapper
Have a look at google/go-cloud for unstructured binary storage (supports GCP and AWS)
STRONGER ARGUMENT FOR AN INTERFACE?
STRONGER ARGUMENT FOR AN INTERFACE?
Logging
Needed almost everywhere! But Go’s default logging has limitations.
STRONGER ARGUMENT FOR AN INTERFACE?
Logging
Needed almost everywhere! But Go’s default logging has limitations.
Even better: Structured Logging
Implicit conformance to uber-go/zap for structured logging
STRONGER ARGUMENT FOR AN INTERFACE?
Logging
Needed almost everywhere! But Go’s default logging has limitations.
Even better: Structured Logging
Implicit conformance to uber-go/zap for structured logging
HOW TO HANDLE CROSS-
CUTTING CONCERNS…?
CONTEXT OBJECT PATTERN
CONTEXT OBJECT PATTERN
Reduce coupling of method parameters
Instead of passing the logger through method parameters, pass a Go context
object through middleware.
CONTEXT OBJECT PATTERN
Reduce coupling of method parameters
Instead of passing the logger through method parameters, pass a Go context
object through middleware.
CONTEXT OBJECT PATTERN
Reduce coupling of method parameters
Instead of passing the logger through method parameters, pass a Go context
object through middleware.
Still not ideal, but good enough?
Also see: https://medium.com/@gosamv/using-gos-context-library-for-logging-4a8feea26690
FINALLY, BEING CONSISTENT…
FINALLY, BEING CONSISTENT…
FINALLY, BEING CONSISTENT…
Strong Consistency
After creating, the user should see the most recent list of meme reminders 

(strong consistency supported by Cloud Datastore)
FINALLY, BEING CONSISTENT…
Strong Consistency
After creating, the user should see the most recent list of meme reminders 

(strong consistency supported by Cloud Datastore)
Eventual Consistency
Meme detail view might not have been generated and stored yet – 

but you can always apologise to the user. Eventual consistency is often fine.
CONCLUSION
CONCLUSION
Keep it simple (but not stupid!)
Reduce the number of “things” you need to deal with –
both from an architecture and a product perspective.
CONCLUSION
Keep it simple (but not stupid!)
Reduce the number of “things” you need to deal with –
both from an architecture and a product perspective.
Challenge existing “best practices”
Have you been brainwashed by cargo cults in the past?
The “best” practices always depend on the context and scope.
CONCLUSION
Keep it simple (but not stupid!)
Reduce the number of “things” you need to deal with –
both from an architecture and a product perspective.
Challenge existing “best practices”
Have you been brainwashed by cargo cults in the past?
The “best” practices always depend on the context and scope.
Develop end-to-end
Allows you to make better decisions for the entire system –
and to iterate quickly for your MVP!
Building a full-stack app with Golang and Google Cloud Platform in one week

More Related Content

PDF
Rethinking Angular Architecture & Performance
PDF
Finding the sweet spot - blending the best of native and web
KEY
Developing for Remote Bamboo Agents, AtlasCamp US 2012
KEY
AtlasCamp US 2012 Keynote, Jean-Michel Lemieux
PDF
How to build a social network on Serverless (AWS Community Summit)
PDF
Serverless in Production, an experience report (AWS UG South Wales)
PDF
Evolving Mobile Architectures
PDF
Building Hybrid Apps with Ember
Rethinking Angular Architecture & Performance
Finding the sweet spot - blending the best of native and web
Developing for Remote Bamboo Agents, AtlasCamp US 2012
AtlasCamp US 2012 Keynote, Jean-Michel Lemieux
How to build a social network on Serverless (AWS Community Summit)
Serverless in Production, an experience report (AWS UG South Wales)
Evolving Mobile Architectures
Building Hybrid Apps with Ember

What's hot (20)

PDF
Designing Forge UI: A Story of Designing an App UI System
PPTX
Appcelerator Titanium Intro
PDF
Snappy Means Happy: Performance in Ember Apps
PDF
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
PDF
Serverless in production, an experience report (FullStack 2018)
PDF
Surviving Serverless Testing: The ultimate Guide
PPTX
The Open-source Eclipse Plugin for Force.com Development, Summer ‘14
PDF
Forge App Showcase
PDF
Appcelerator Titanium Intro (2014)
PPTX
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
PDF
Step by Step Guide on Lazy Loading in Angular 11
PPTX
Put iOS and Android on the same Wavelength with Serverless Microservices
PPTX
Angular vs react vs vue
PPTX
Ember Conf 2016: Building Mobile Apps with Ember
PDF
Build social network in 4 weeks
PDF
An Exploration of Cross-product App Experiences
PDF
Front End Development for Back End Developers - Devoxx UK 2017
PDF
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
PDF
Ember At Scale
PDF
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Designing Forge UI: A Story of Designing an App UI System
Appcelerator Titanium Intro
Snappy Means Happy: Performance in Ember Apps
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Serverless in production, an experience report (FullStack 2018)
Surviving Serverless Testing: The ultimate Guide
The Open-source Eclipse Plugin for Force.com Development, Summer ‘14
Forge App Showcase
Appcelerator Titanium Intro (2014)
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Step by Step Guide on Lazy Loading in Angular 11
Put iOS and Android on the same Wavelength with Serverless Microservices
Angular vs react vs vue
Ember Conf 2016: Building Mobile Apps with Ember
Build social network in 4 weeks
An Exploration of Cross-product App Experiences
Front End Development for Back End Developers - Devoxx UK 2017
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
Ember At Scale
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Ad

Similar to Building a full-stack app with Golang and Google Cloud Platform in one week (20)

KEY
Single Page Applications - Desert Code Camp 2012
PDF
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
PDF
System design for Web Application
KEY
20120306 dublin js
PDF
Client Server Web Apps with JavaScript and Java Rich Scalable and RESTful 1st...
PDF
Tech Thursdays: Building Products
PPTX
Node Summit 2016: Web App Architectures
ODP
Path Dependent Development (PyCon AU)
PDF
React Native for Business Solutions: Building Scalable Apps for Success
PDF
Jose l ugia 6 wunderkinder, momenta
PPTX
Introduction to GoLang
KEY
TxJS 2011
PDF
Client Server Web Apps with JavaScript and Java 1st Edition Casimir Saternos
PDF
Lessons learned from building Demand Side Platform
PPTX
20 Tips for Building a Scalable and Robust Node.js Stack that Developers Love
PDF
Build your cross-platform service in a week with App Engine
PDF
Product! - The road to production deployment
PDF
Code In The Cloud 1st Edition Mark C Chucarroll
PDF
JavaScript Application Design A Build First Approach 1st Edition Nicolas Beva...
PPT
The economies of scaling software - Abdel Remani
Single Page Applications - Desert Code Camp 2012
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
System design for Web Application
20120306 dublin js
Client Server Web Apps with JavaScript and Java Rich Scalable and RESTful 1st...
Tech Thursdays: Building Products
Node Summit 2016: Web App Architectures
Path Dependent Development (PyCon AU)
React Native for Business Solutions: Building Scalable Apps for Success
Jose l ugia 6 wunderkinder, momenta
Introduction to GoLang
TxJS 2011
Client Server Web Apps with JavaScript and Java 1st Edition Casimir Saternos
Lessons learned from building Demand Side Platform
20 Tips for Building a Scalable and Robust Node.js Stack that Developers Love
Build your cross-platform service in a week with App Engine
Product! - The road to production deployment
Code In The Cloud 1st Edition Mark C Chucarroll
JavaScript Application Design A Build First Approach 1st Edition Nicolas Beva...
The economies of scaling software - Abdel Remani
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administraation Chapter 3
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administration Chapter 2
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
history of c programming in notes for students .pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administraation Chapter 3
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Reimagine Home Health with the Power of Agentic AI​
Operating system designcfffgfgggggggvggggggggg
System and Network Administration Chapter 2
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Essential Infomation Tech presentation.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
history of c programming in notes for students .pptx
Softaken Excel to vCard Converter Software.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Odoo POS Development Services by CandidRoot Solutions
Upgrade and Innovation Strategies for SAP ERP Customers
How to Migrate SBCGlobal Email to Yahoo Easily
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Which alternative to Crystal Reports is best for small or large businesses.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update

Building a full-stack app with Golang and Google Cloud Platform in one week

  • 1. Memes in the Cloud – Building a full-stack app with Golang and Google Cloud Platform in one week Dr. Felix Raab | Head of Engineering @ KI Labs Munich | ki-labs.com [email protected] | medium.com/@fe9lix
  • 3. SCOPE OF TALK Case Study Project idea and journey for an MVP finished within one week
  • 4. SCOPE OF TALK Case Study Project idea and journey for an MVP finished within one week Software Engineering for Cloud Apps The “full” stack: Frontend, Backend, Build, Deployment, Logging… Towards the end of the talk: Software Engineering practices in Go
  • 5. SCOPE OF TALK Case Study Project idea and journey for an MVP finished within one week Software Engineering for Cloud Apps The “full” stack: Frontend, Backend, Build, Deployment, Logging… Towards the end of the talk: Software Engineering practices in Go Memes At the heart of the app itself – consequently, Memes to illustrate some opinionated views
  • 6. BACK AT MY PREVIOUS EMPLOYER… Hours claiming – trying not get “shitlisted”… because the boss would be notified!
  • 9. Idea – Every Friday… Schedule an hours claim reminder mail containing a meme, to myself.
  • 12. FIRST: HOW TO CHOOSE A CLOUD? …when you can start from scratch – no corporate constraints, no restrictions, no Frankfurt.
  • 13. LOOK AT THE HISTORY OF CLOUD COMPANIES
  • 14. LOOK AT THE HISTORY OF CLOUD COMPANIES
  • 15. LOOK AT THE HISTORY OF CLOUD COMPANIES
  • 16. LOOK AT THE HISTORY OF CLOUD COMPANIES
  • 17. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE
  • 18. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE AMAZON WEB SERVICES
  • 19. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE AMAZON WEB SERVICES GOOGLE CLOUD PLATFORM
  • 20. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE AMAZON WEB SERVICES GOOGLE CLOUD PLATFORM Enterprise
  • 21. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE AMAZON WEB SERVICES GOOGLE CLOUD PLATFORM Enterprise Ops
  • 22. LOOK AT THE HISTORY OF CLOUD COMPANIES MICROSOFT AZURE AMAZON WEB SERVICES GOOGLE CLOUD PLATFORM Enterprise Ops S(R)E
  • 23. –Brave New Geek “Multi-Cloud Is a Trap” https://bravenewgeek.com/multi-cloud-is-a-trap/
  • 24. WORKS LIKE YOU WOULD EXPECT IT…
  • 25. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail
  • 26. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later…
  • 27. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… API access, permissions, config…
  • 28. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… CI/CD API access, permissions, config…
  • 29. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… CI/CD Database (NoSQL document store) API access, permissions, config…
  • 30. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… CI/CD Database (NoSQL document store) Object Storage (Blobs…) API access, permissions, config…
  • 31. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… CI/CD Database (NoSQL document store) Object Storage (Blobs…) Task Queue (with scheduling!) API access, permissions, config…
  • 32. WORKS LIKE YOU WOULD EXPECT IT… Service Offerings used to build MemeMail More on that later… CI/CD Database (NoSQL document store) Object Storage (Blobs…) Task Queue (with scheduling!) Logging… API access, permissions, config…
  • 33. The Frontend – Diving into the world of JavaScript? https://exceptionnotfound.net/big-ball-of-mud-the-daily-software-anti-pattern/
  • 34. THE FULLSTACK IN GO – SO HOW ABOUT WEBASSEMBLY (WASM)?
  • 37. NO! BECAUSE… Readability, Debugging, Size…
 (but maybe in the future)
  • 39. NO! BECAUSE… Learning curve, different paradigm, transpiling to JS, libraries… – remember, we have one week to finish!
  • 40. VANILLA JS (ES 6)! 
 BUT WHICH FRAMEWORK?
  • 43. RESIST THE TEMPTATION TO… Also, do not use Github Stars as your only criterion! Popularity is one thing…
  • 45. HOW TO CHOOSE 1) Does it solve your problem in a simple way? Rendering the frontend and adding interaction without sprinkling jQuery calls throughout your code base.
  • 46. HOW TO CHOOSE 1) Does it solve your problem in a simple way? Rendering the frontend and adding interaction without sprinkling jQuery calls throughout your code base. 2) Look at the quality of the documentation! Because you need to read it and be able to understand it – quickly!
  • 47. VUE.JS SEEMS TO MATCH. BUT WHICH ARCHITECTURE?
  • 48. SO MANY APPROACHES… …MVVM, Flux, Redux, SAM, ELM Architecture…? What is the essence?
  • 51. STATE MUTATION Take notice when somebody tells you that you should or can entirely avoid mutating state.
  • 53. MUTATING STATE. HERE’S HOW… 1) Put your entire app state into a single model Avoid primitive obsession – use proper objects! This is your single source of truth.
  • 54. MUTATING STATE. HERE’S HOW… 1) Put your entire app state into a single model Avoid primitive obsession – use proper objects! This is your single source of truth. 2) Dispatch Actions from the UI to trigger a state mutation Do not yet mutate the state in the action itself! Actions are intents with payloads.
  • 55. MUTATING STATE. HERE’S HOW… 1) Put your entire app state into a single model Avoid primitive obsession – use proper objects! This is your single source of truth. 2) Dispatch Actions from the UI to trigger a state mutation Do not yet mutate the state in the action itself! Actions are intents with payloads. 3) Accept or reject the state mutation in your model At the end of your (async.) action, “commit” / “propose” a new value to the model.
  • 56. MUTATING STATE. HERE’S HOW… 1) Put your entire app state into a single model Avoid primitive obsession – use proper objects! This is your single source of truth. 2) Dispatch Actions from the UI to trigger a state mutation Do not yet mutate the state in the action itself! Actions are intents with payloads. 3) Accept or reject the state mutation in your model At the end of your (async.) action, “commit” / “propose” a new value to the model. 4) Update the UI when the state changes Derive the state to render from your model, e.g. by UI bindings.
  • 57. VUEX.JS KIND OF SUPPORTS THAT PATTERN
  • 58. –Ryan Dahl “[...] if you’re building a server, I can’t imagine using anything other than ” THE BACKEND.
  • 60. HOW TO BUILD? Go 1.11 Because Go Modules!
  • 61. HOW TO BUILD? Go 1.11 Because Go Modules! Docker To be flexible with Go versions
 Multi-stage build!
  • 62. HOW TO BUILD? Go 1.11 Because Go Modules! Docker To be flexible with Go versions
 Multi-stage build! entr + Makefile No Rake, Grunt, Gulp, NPM, Yarn – Makefile + Bash Script fine! Check entrproject.org
  • 63. APP ENGINE – START SIMPLE
  • 64. APP ENGINE – START SIMPLE
  • 65. APP ENGINE – START SIMPLE App Engine Flex You can migrate to Kubernetes (GKE) later if you wish to – but for your MVP, don’t waste time managing a cluster.
  • 66. APP ENGINE – START SIMPLE App Engine Flex You can migrate to Kubernetes (GKE) later if you wish to – but for your MVP, don’t waste time managing a cluster. Use defaults Start with App Engine default options and auto-scaling. Nobody knows how much traffic you will get. Watch and see what happens.
  • 69. YES AND NO! Expose your services as API to the frontend Frontend is rendered via a Go template. On that rendered page, a Single Page App can run in memory and call your backend API. Use Go templates for other static pages. Makes routing easier.
  • 70. YES AND NO! Expose your services as API to the frontend Frontend is rendered via a Go template. On that rendered page, a Single Page App can run in memory and call your backend API. Use Go templates for other static pages. Makes routing easier. But no need to create two deployment units No need for premature optimisation (scaling). One Go binary is simpler than two Go binaries! 
 Static assets are loaded from the file system in your container.
  • 71. CI/CD
  • 72. CI/CD Google Cloud Build Will trigger and deploy when you push to your Git repo. Maintaining your own Jenkins server and setting up a build pipeline can be more time-consuming than you might think.
  • 73. CI/CD Google Cloud Build Will trigger and deploy when you push to your Git repo. Maintaining your own Jenkins server and setting up a build pipeline can be more time-consuming than you might think. App Engine Deployment Straightforward versioning and service concept via DNS – version.service.appname Promoting app to production, traffic splitting etc. – 
 supported out of the box
  • 76. The cloud can be mean and slow.
  • 77. PLAYGROUNDS SAVE TIME Create a GCP “Playground” project Got stuck with Cloud Datastore (vs. Cloud Firestore) and 
 Cloud Tasks (only certain EU region). Led me to test service offerings first via playground.
  • 79. SO MANY LAYERS AND CONCEPTS Also, ask yourself : Is there a rich domain? Or are you really building a CRUD app?
  • 82. Take notice when nobody tells you to separate functionality into lots and lots of really small methods and delegating objects.
  • 83. A QUESTION OF PHILOSOPHIES?
  • 84. A QUESTION OF PHILOSOPHIES?
  • 85. A QUESTION OF PHILOSOPHIES? Robert Martin (Uncle Bob) http://2017.agilesummit.gr/speakers/uncle-bob/
  • 86. A QUESTION OF PHILOSOPHIES? John Ousterhout https://www.youtube.com/watch?v=bmSAYlu0NcY Robert Martin (Uncle Bob) http://2017.agilesummit.gr/speakers/uncle-bob/
  • 87. DEEP VS SHALLOW MODULES
  • 88. DEEP VS SHALLOW MODULES Shallow ModuleDeep module Interface Functionality
  • 89. DEEP VS SHALLOW MODULES Shallow Module “The best modules are deep: they allow a lot of functionality to be accessed through a simple interface. A shallow module is one with a relatively complex interface, but not much functionality: it doesn’t hide much complexity.” 
 – From A Philosophy of Software Design, John Ousterhout Deep module Interface Functionality
  • 90. EXAMPLE OF A DEEP MODULE Meme Image Generation Package “meme”, image.go: Simple interface, a lot of functionality.
  • 91. PASS-THROUGH CODE TENDS TO BE SHALLOW – BUT HOW MUCH SEPARATION?
  • 93. Separate the outside from the inside Kind of onion, just fewer layers
  • 94. Separate the outside from the inside Kind of onion, just fewer layers Outside (package http) Protocol, routing (gorilla/mux), handlers
  • 95. Separate the outside from the inside Kind of onion, just fewer layers Outside (package http) Protocol, routing (gorilla/mux), handlers Inside (package meme) Core, your actual (business) functionality
  • 98. IMPLICIT INTERFACE CONFORMANCE Awesome Golang feature, but here…
  • 99. IMPLICIT INTERFACE CONFORMANCE Awesome Golang feature, but here…
  • 100. IMPLICIT INTERFACE CONFORMANCE Awesome Golang feature, but here…
  • 101. IMPLICIT INTERFACE CONFORMANCE Awesome Golang feature, but here… To be able to inject a different implementation, you would need to either create an interface that mirrors the datastore api or create a generic interface -> shallow wrapper
  • 102. IMPLICIT INTERFACE CONFORMANCE Awesome Golang feature, but here… To be able to inject a different implementation, you would need to either create an interface that mirrors the datastore api or create a generic interface -> shallow wrapper Have a look at google/go-cloud for unstructured binary storage (supports GCP and AWS)
  • 103. STRONGER ARGUMENT FOR AN INTERFACE?
  • 104. STRONGER ARGUMENT FOR AN INTERFACE? Logging Needed almost everywhere! But Go’s default logging has limitations.
  • 105. STRONGER ARGUMENT FOR AN INTERFACE? Logging Needed almost everywhere! But Go’s default logging has limitations. Even better: Structured Logging Implicit conformance to uber-go/zap for structured logging
  • 106. STRONGER ARGUMENT FOR AN INTERFACE? Logging Needed almost everywhere! But Go’s default logging has limitations. Even better: Structured Logging Implicit conformance to uber-go/zap for structured logging
  • 107. HOW TO HANDLE CROSS- CUTTING CONCERNS…?
  • 109. CONTEXT OBJECT PATTERN Reduce coupling of method parameters Instead of passing the logger through method parameters, pass a Go context object through middleware.
  • 110. CONTEXT OBJECT PATTERN Reduce coupling of method parameters Instead of passing the logger through method parameters, pass a Go context object through middleware.
  • 111. CONTEXT OBJECT PATTERN Reduce coupling of method parameters Instead of passing the logger through method parameters, pass a Go context object through middleware. Still not ideal, but good enough? Also see: https://medium.com/@gosamv/using-gos-context-library-for-logging-4a8feea26690
  • 114. FINALLY, BEING CONSISTENT… Strong Consistency After creating, the user should see the most recent list of meme reminders 
 (strong consistency supported by Cloud Datastore)
  • 115. FINALLY, BEING CONSISTENT… Strong Consistency After creating, the user should see the most recent list of meme reminders 
 (strong consistency supported by Cloud Datastore) Eventual Consistency Meme detail view might not have been generated and stored yet – 
 but you can always apologise to the user. Eventual consistency is often fine.
  • 117. CONCLUSION Keep it simple (but not stupid!) Reduce the number of “things” you need to deal with – both from an architecture and a product perspective.
  • 118. CONCLUSION Keep it simple (but not stupid!) Reduce the number of “things” you need to deal with – both from an architecture and a product perspective. Challenge existing “best practices” Have you been brainwashed by cargo cults in the past? The “best” practices always depend on the context and scope.
  • 119. CONCLUSION Keep it simple (but not stupid!) Reduce the number of “things” you need to deal with – both from an architecture and a product perspective. Challenge existing “best practices” Have you been brainwashed by cargo cults in the past? The “best” practices always depend on the context and scope. Develop end-to-end Allows you to make better decisions for the entire system – and to iterate quickly for your MVP!