SlideShare a Scribd company logo
1 of 38
Download to read offline
© - BASE, Inc.
Building API server-side
architecture for Beginners
GopherCon
. . - @hgsgtk
© - BASE, Inc.
Talk abstract
• A practical approach to build server-side
architecture in a Go project
• Especially for teams who do not have Go
experience in business
© - BASE, Inc.
Kazuki Higashiguchi / Backend engineer in Japan!
About me
@hgsgtk
BASE BANK, Inc. / Dev Division / Tech lead
© - BASE, Inc.
Problem of building architecture for beginners
Approach to build architecture
Summary
Talk structure
© - BASE, Inc.
Problem of building architecture
for beginners
Approach to build architecture
Summary
Talk structure
© - BASE, Inc.
Why I need server-side architecture
.Keep a design easy to change
• -> Separate external input/output and
business logic
.Reach common understanding of
implementation policies in a team
• -> To make readable and maintainable code
© - BASE, Inc.
• No absolute answer for any projects
• We should determine a suitable architecture
for the project
Reality of building architecture
© - BASE, Inc.
• We should consider various things
• Service requirements
• Team member ability
• Service scale
• etc
To determine a suitable architecture
© - BASE, Inc.
Problem of building architecture for beginners
• We should consider various things
• Service requirements
• Team member ability
• Service scale
• etc
For beginners, “Team member ability” is
a factor that can not be ignored
© - BASE, Inc.
Go beginners have a lot of questions
How to implement API server
by net/http package
How to write an unit test
How to use interface type
- Go basic questions -
© - BASE, Inc.
If we determine complicated architecture from the beginning
How to implement API server
by net/http package
How to write an unit test
- Go basic questions -
ex. “Adopt clean architecture!”
How to use interface type
© - BASE, Inc.
How to implement API server
by net/http package
How to write an unit test
- Go basic questions -
ex. “Adopt clean architecture!”
- Architecture questions -
What’s clean architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in use
case layer?
How to use interface type
If we determine complicated architecture from the beginning
© - BASE, Inc.
How to implement API server
by net/http package
How to write an unit testing
- Go basic questions -
ex. “Adopt clean architecture!”
- Architecture questions -
What’s clean architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in use
case layer?
How to use interface type
If we determine complicated architecture from beginning
There are many questions
in team members’ mind
© - BASE, Inc.
If we determine complicated architecture from beginning
How to implement API server
by net/http package
How to write unit testing
How to use interface type
- Go Basic Questions -
ex. “Adopt Clean Architecture!”
- Architecture Questions -
What’s clean architecture?
How to apply Dependency
Inversion Principle in Go?
What we should write in use
case layer?
When it gets worst,
Confusing 🤯
© - BASE, Inc.
Why I need server-side architecture
.Keep a design easy to change
• -> Separate external input/output and
business logic
.Common understanding of implementation
policies in a team
• -> To make readable and maintainable code
We are not able to achieve
“common understanding” 🤯
© - BASE, Inc.
Problem of building architecture for beginners
Approach to build architecture
Summary
Talk structure
© - BASE, Inc.
Approach to build architecture
Architectural
complexity
Go Skills/Knowledge
© - BASE, Inc.
Approach to build architecture
Architectural
complexity
the final
architecture
. Define “the final architecture”
that seems to be good for the project
Go Skills/Knowledge
© - BASE, Inc.
Approach to build architecture
Architectural
complexity
the final architecture
. Set intermediate goals to
“the final architecture”
Go Skills/Knowledge
© - BASE, Inc.
Example of my team
• The team have few Go experience in
business
• The Team has backend engineers
• usually use PHP in work
© - BASE, Inc.
Example of my team
Architectural
complexity
Layered
Architecture + DIP
Simple Model-Controller
Model-Controller + DIP
.
.
Go Skills/Knowledge
© - BASE, Inc.
Architectural
complexity
Layered
Architecture + DIP
Simple Model-Controller
Model-Controller + DIP
.
.
Go Skills/Knowledge
. Define Layered Architecture + DIP
as “the final architecture”
Example of my team
© - BASE, Inc.
Layered Architecture + DIP
• Refer to Layered Architecture
• Apply DIP (Dependency Inversion
Principle) to isolate domain logic
from infrastructure
implementations(ex. database
handling)
© - BASE, Inc.
Architectural
complexity
Layered
Architecture + DIP
Simple Model-Controller
Model-Controller + DIP
.
.
Go Skills/Knowledge
. Set intermediate goals
Example of my team
© - BASE, Inc.
st goal: Simple Model-Controller
• Simple design only with
controller and model
• Model includes implementations
such as handling a database
• To get used to Go API
development
© - BASE, Inc.
At st goal, team will acquire
How to implement API server
by net/http package
How to write an unit test
How to use interface type
- Go Basic Questions -
Got it!
© - BASE, Inc.
At st goal, team will acquire
How to implement API server
by net/http package
How to write an unit test
How to use interface type
- Go Basic Questions -
Got it!
Acquire Go Basic from simple design code
© - BASE, Inc.
nd goal: Model-Controller + DIP
• Separate infrastructure
implementations from model
• Prepare repository package and
move database handling
implementation to datastore
package. (apply DIP)
• Get used to how to use interface
in Go
© - BASE, Inc.
- Go Basic Questions -
Final goal: “Layered Architecture + DIP”
- Architecture Questions -
What’s layered architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in
application layer?
How to use interface type
At nd goal, team will acquire
How to implement API server
by net/http package
How to write an unit test
Got it!
© - BASE, Inc.
Got it! - Go Basic Questions -
Final goal: “Layered Architecture + DIP”
- Architecture Questions -
What’s layered architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in
application layer?
How to use interface type
At nd goal, team will acquire
How to implement API server
by net/http package
How to write an unit test
Acquire Basic of Go and Archictecture
from more complicated design
© - BASE, Inc.
Final goal: Layered Architecture + DIP
• Introduce service package
corresponding to “service
application layer” in DDD as
processing becomes more
complicated
© - BASE, Inc.
- Go Basic Questions -
Final goal: “Layered Architecture + DIP”
- Architecture Questions -
What’s layered architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in
application layer?
How to use interface type
At final goal, team will reach
How to implement API server
by net/http package
How to write an unit test
Got it!
© - BASE, Inc.
- Go Basic Questions -
Final goal: “Layered Architecture + DIP”
- Architecture Questions -
What’s layered architecture?
How to apply Dependency
Inversion Principle in Go?
What should we write in
application layer?
How to use interface type
At final goal, team will reach
How to implement API server
by net/http package
How to write an unit test
Got it! Reach common understanding of
implementation policies
© - BASE, Inc.
Go Skills/Knowledge
Architectural
complexity
Layered
Architecture + DIP
Simple Model-Controller
Model-Controller + DIP
.
.
Approach to build architecture
To acquire Go skills and knowledge rapidly
© - BASE, Inc.
To acquire Go skills and knowledge rapidly
.Use standard package as much as possible
• To learn Go language itself
• ex. use net/http package to serve HTTP
.Write a test
• To get feedback on the code design (such as
testability)
• For quick refactoring
© - BASE, Inc.
Problem of building architecture for beginners
Approach to build architecture
Summary
Talk structure
© - BASE, Inc.
Summary
• In my approach, an architecture grew with
team members’ ability growth
• Set a final goal and intermediate goals
• To grow rapidly, use standard package as much
as possible and write a test
© - BASE, Inc.
Feel free to ask me any Q 👍
GopherCon
. . - @hgsgtk

More Related Content

Similar to slides.pdf

Manchester ITExpo Talk: DevOps large and small - Cambridge Satchel
Manchester ITExpo Talk:  DevOps large and small - Cambridge SatchelManchester ITExpo Talk:  DevOps large and small - Cambridge Satchel
Manchester ITExpo Talk: DevOps large and small - Cambridge SatchelJwooldridge
 
Getting out of the monolith hell
Getting out of the monolith hellGetting out of the monolith hell
Getting out of the monolith hellmimmozzo_
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development PipelineGlobalLogic Ukraine
 
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Vadym Kazulkin
 
Android Development: Approach for Agile Teams
Android Development: Approach for Agile TeamsAndroid Development: Approach for Agile Teams
Android Development: Approach for Agile TeamsAnay Kamat
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell TeamingNovell
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell TeamingNovell
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell TeamingNovell
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell TeamingNovell
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life DevOps.com
 
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,..."Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...Yandex
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Vadym Kazulkin
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development PipelineIzzet Mustafaiev
 
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsen
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsenapidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsen
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsenapidays
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneciberkleid
 
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...Technical Agility institute
 
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
 
Building Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C ZiegelerBuilding Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C Ziegelermfrancis
 
Convince your boss to go Serverless at serverless week Brazil
Convince your boss to go Serverless at serverless week BrazilConvince your boss to go Serverless at serverless week Brazil
Convince your boss to go Serverless at serverless week BrazilVadym Kazulkin
 

Similar to slides.pdf (20)

Manchester ITExpo Talk: DevOps large and small - Cambridge Satchel
Manchester ITExpo Talk:  DevOps large and small - Cambridge SatchelManchester ITExpo Talk:  DevOps large and small - Cambridge Satchel
Manchester ITExpo Talk: DevOps large and small - Cambridge Satchel
 
Getting out of the monolith hell
Getting out of the monolith hellGetting out of the monolith hell
Getting out of the monolith hell
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
 
Android Development: Approach for Agile Teams
Android Development: Approach for Agile TeamsAndroid Development: Approach for Agile Teams
Android Development: Approach for Agile Teams
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell Teaming
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell Teaming
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell Teaming
 
Custom Development with Novell Teaming
Custom Development with Novell TeamingCustom Development with Novell Teaming
Custom Development with Novell Teaming
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,..."Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development Pipeline
 
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsen
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsenapidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsen
apidays LIVE JAKARTA - GraphQL, gRPC, REST, Oh My! by Mike Amundsen
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
 
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
 
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
Building Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C ZiegelerBuilding Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C Ziegeler
 
Convince your boss to go Serverless at serverless week Brazil
Convince your boss to go Serverless at serverless week BrazilConvince your boss to go Serverless at serverless week Brazil
Convince your boss to go Serverless at serverless week Brazil
 

Recently uploaded

Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 

Recently uploaded (20)

Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 

slides.pdf

  • 1. © - BASE, Inc. Building API server-side architecture for Beginners GopherCon . . - @hgsgtk
  • 2. © - BASE, Inc. Talk abstract • A practical approach to build server-side architecture in a Go project • Especially for teams who do not have Go experience in business
  • 3. © - BASE, Inc. Kazuki Higashiguchi / Backend engineer in Japan! About me @hgsgtk BASE BANK, Inc. / Dev Division / Tech lead
  • 4. © - BASE, Inc. Problem of building architecture for beginners Approach to build architecture Summary Talk structure
  • 5. © - BASE, Inc. Problem of building architecture for beginners Approach to build architecture Summary Talk structure
  • 6. © - BASE, Inc. Why I need server-side architecture .Keep a design easy to change • -> Separate external input/output and business logic .Reach common understanding of implementation policies in a team • -> To make readable and maintainable code
  • 7. © - BASE, Inc. • No absolute answer for any projects • We should determine a suitable architecture for the project Reality of building architecture
  • 8. © - BASE, Inc. • We should consider various things • Service requirements • Team member ability • Service scale • etc To determine a suitable architecture
  • 9. © - BASE, Inc. Problem of building architecture for beginners • We should consider various things • Service requirements • Team member ability • Service scale • etc For beginners, “Team member ability” is a factor that can not be ignored
  • 10. © - BASE, Inc. Go beginners have a lot of questions How to implement API server by net/http package How to write an unit test How to use interface type - Go basic questions -
  • 11. © - BASE, Inc. If we determine complicated architecture from the beginning How to implement API server by net/http package How to write an unit test - Go basic questions - ex. “Adopt clean architecture!” How to use interface type
  • 12. © - BASE, Inc. How to implement API server by net/http package How to write an unit test - Go basic questions - ex. “Adopt clean architecture!” - Architecture questions - What’s clean architecture? How to apply Dependency Inversion Principle in Go? What should we write in use case layer? How to use interface type If we determine complicated architecture from the beginning
  • 13. © - BASE, Inc. How to implement API server by net/http package How to write an unit testing - Go basic questions - ex. “Adopt clean architecture!” - Architecture questions - What’s clean architecture? How to apply Dependency Inversion Principle in Go? What should we write in use case layer? How to use interface type If we determine complicated architecture from beginning There are many questions in team members’ mind
  • 14. © - BASE, Inc. If we determine complicated architecture from beginning How to implement API server by net/http package How to write unit testing How to use interface type - Go Basic Questions - ex. “Adopt Clean Architecture!” - Architecture Questions - What’s clean architecture? How to apply Dependency Inversion Principle in Go? What we should write in use case layer? When it gets worst, Confusing 🤯
  • 15. © - BASE, Inc. Why I need server-side architecture .Keep a design easy to change • -> Separate external input/output and business logic .Common understanding of implementation policies in a team • -> To make readable and maintainable code We are not able to achieve “common understanding” 🤯
  • 16. © - BASE, Inc. Problem of building architecture for beginners Approach to build architecture Summary Talk structure
  • 17. © - BASE, Inc. Approach to build architecture Architectural complexity Go Skills/Knowledge
  • 18. © - BASE, Inc. Approach to build architecture Architectural complexity the final architecture . Define “the final architecture” that seems to be good for the project Go Skills/Knowledge
  • 19. © - BASE, Inc. Approach to build architecture Architectural complexity the final architecture . Set intermediate goals to “the final architecture” Go Skills/Knowledge
  • 20. © - BASE, Inc. Example of my team • The team have few Go experience in business • The Team has backend engineers • usually use PHP in work
  • 21. © - BASE, Inc. Example of my team Architectural complexity Layered Architecture + DIP Simple Model-Controller Model-Controller + DIP . . Go Skills/Knowledge
  • 22. © - BASE, Inc. Architectural complexity Layered Architecture + DIP Simple Model-Controller Model-Controller + DIP . . Go Skills/Knowledge . Define Layered Architecture + DIP as “the final architecture” Example of my team
  • 23. © - BASE, Inc. Layered Architecture + DIP • Refer to Layered Architecture • Apply DIP (Dependency Inversion Principle) to isolate domain logic from infrastructure implementations(ex. database handling)
  • 24. © - BASE, Inc. Architectural complexity Layered Architecture + DIP Simple Model-Controller Model-Controller + DIP . . Go Skills/Knowledge . Set intermediate goals Example of my team
  • 25. © - BASE, Inc. st goal: Simple Model-Controller • Simple design only with controller and model • Model includes implementations such as handling a database • To get used to Go API development
  • 26. © - BASE, Inc. At st goal, team will acquire How to implement API server by net/http package How to write an unit test How to use interface type - Go Basic Questions - Got it!
  • 27. © - BASE, Inc. At st goal, team will acquire How to implement API server by net/http package How to write an unit test How to use interface type - Go Basic Questions - Got it! Acquire Go Basic from simple design code
  • 28. © - BASE, Inc. nd goal: Model-Controller + DIP • Separate infrastructure implementations from model • Prepare repository package and move database handling implementation to datastore package. (apply DIP) • Get used to how to use interface in Go
  • 29. © - BASE, Inc. - Go Basic Questions - Final goal: “Layered Architecture + DIP” - Architecture Questions - What’s layered architecture? How to apply Dependency Inversion Principle in Go? What should we write in application layer? How to use interface type At nd goal, team will acquire How to implement API server by net/http package How to write an unit test Got it!
  • 30. © - BASE, Inc. Got it! - Go Basic Questions - Final goal: “Layered Architecture + DIP” - Architecture Questions - What’s layered architecture? How to apply Dependency Inversion Principle in Go? What should we write in application layer? How to use interface type At nd goal, team will acquire How to implement API server by net/http package How to write an unit test Acquire Basic of Go and Archictecture from more complicated design
  • 31. © - BASE, Inc. Final goal: Layered Architecture + DIP • Introduce service package corresponding to “service application layer” in DDD as processing becomes more complicated
  • 32. © - BASE, Inc. - Go Basic Questions - Final goal: “Layered Architecture + DIP” - Architecture Questions - What’s layered architecture? How to apply Dependency Inversion Principle in Go? What should we write in application layer? How to use interface type At final goal, team will reach How to implement API server by net/http package How to write an unit test Got it!
  • 33. © - BASE, Inc. - Go Basic Questions - Final goal: “Layered Architecture + DIP” - Architecture Questions - What’s layered architecture? How to apply Dependency Inversion Principle in Go? What should we write in application layer? How to use interface type At final goal, team will reach How to implement API server by net/http package How to write an unit test Got it! Reach common understanding of implementation policies
  • 34. © - BASE, Inc. Go Skills/Knowledge Architectural complexity Layered Architecture + DIP Simple Model-Controller Model-Controller + DIP . . Approach to build architecture To acquire Go skills and knowledge rapidly
  • 35. © - BASE, Inc. To acquire Go skills and knowledge rapidly .Use standard package as much as possible • To learn Go language itself • ex. use net/http package to serve HTTP .Write a test • To get feedback on the code design (such as testability) • For quick refactoring
  • 36. © - BASE, Inc. Problem of building architecture for beginners Approach to build architecture Summary Talk structure
  • 37. © - BASE, Inc. Summary • In my approach, an architecture grew with team members’ ability growth • Set a final goal and intermediate goals • To grow rapidly, use standard package as much as possible and write a test
  • 38. © - BASE, Inc. Feel free to ask me any Q 👍 GopherCon . . - @hgsgtk