Software Architecture Patterns: 5 minutes read

29-Oct-21

คัมภีร์เทพ IT

See the original english version Click here!

 

เมื่อมีใครสักคนที่เข้าสู่โลกของ Software Engineering วันหนึ่งเขาจะต้องเรียนรู้พื้นฐานของ Software Architecture Patterns หากคุณยังใหม่กับการเขียน Code คุณอาจไม่รู้ว่าจะหา Resource เพื่อเรียนรู้ Architecture Patterns เบื้องต้นจากที่ไหน ดังนั้น บทความนี้เราจะมาทำความเข้าใจในเบื้องต้นกับ Software Architecture Patterns ใน 5 นาที

เนื้อหาจากบทความนี้ มาจากส่วนหนึ่งของหนังสือ Software Architecture Patterns โดย Mark Richards ซึ่งมีประโยชน์กับคนที่ต้องการทำความเข้าใจพื้นฐานของ Software Architecture Patterns

1. Layered Architecture

มันเป็น Architecture ทั่วไปสำหรับ Monolithic Applications แนวคิดพื้นฐานที่อยู่เบื้องหลัง Pattern นี้ก็คือ การแบ่ง App Logic ออกเป็นหลาย ๆ Layers โดยแต่ละชั้นจะ Encapsulate Role ที่กำหนดเอาไว้ ตัวอย่างเช่น Persistence Layer จะรับผิดชอบ Communication ของ App ของคุณกับ Database Engine

Figure 1. Layered architecture pattern (link to the original source of the picture)

2. Event-Driven Architecture

แนวคิดเบื้องหลัง Pattern นี้คือการแยก Application Logic ออกเป็น Single-Purpose Event Processing Components ที่รับและประมวลผล Events แบบ Asynchronous สำหรับ Pattern นี้เป็นหนึ่งใน Distributed Asynchronous Architecture Patterns ยอดนิยม ซึ่งเป็นที่รู้จักกันดีในแง่ Scalability และ Adaptability ที่สูง

Figure 2. Event-driven architecture broker topology (link to the original source of the picture)

3. Microkernel Architecture

Mikrokernel Architecture หรือที่เรียกว่า Plugin Architecture คือ Design Pattern ที่มี 2 Components หลัก ซึ่งประกอบด้วย Core System และ Plug-in Modules (หรือ Extensions) ตัวอย่างที่ดีก็น่าจะเป็น Web Browser (Core System) ซึ่งคุณสามารถติดตั้ง Extensions (หรือ Plug-in) ได้มากมาย

Figure 3. Mikrokernel architecture (link to the original source of the picture)

4. Microservices Architecture

Microservices Architecture ประกอบด้วย Deployed Services ที่แยกกัน ซึ่งแต่ละ Services จะมีหน้าที่เพียงแค่ 1 อย่าง และ Services เหล่านั้นจะเป็นอิสระต่อกัน หาก Service ใด Service หนึ่ง เกิดล้มเหลวขึ้นมา Services อื่น ก็จะยังคงทำงานอยู่

Figure 4. Microservices architecture (link to the original source of the picture)

5. Space-Based Architecture

แนวคิดหลักที่อยู่เบื้องหลัง Space-Based Pattern ก็คือ Distributed Shared Memory เพื่อลดปัญหาที่มักเกิดขึ้นใน Database Level ให้น้อยลง

วิธีการจัดการก็คือ การแยก Application ออกเป็น Processing Units (ซึ่งสามารถปรับขนาดขึ้นและลง ได้โดยอัตโนมัติตามความต้องการ) โดยที่ Data จะถูกทำซ้ำและประมวลผลระหว่าง Units เหล่านั้น โดยไม่จำเป็นต้องมีอยู่ใน Central Database (แม้ว่าจะมี Local Storages ไว้สำหรับตอนที่ System เกิดล้มเหลวขึ้นมา)

Figure 5. Space-Based architecture (link to the original source of the picture)

ตัวอย่างที่ง่ายที่สุดสำหรับ Architecture Patterns บางส่วน ที่คุณสามารถหาได้ใน GitHub Account มีดังต่อไปนี้:

ที่มา: https://orkhanscience.medium.com/

 

 

รับตำแหน่งงานไอทีใหม่ๆ ด้วยบริการ IT Job Alert

 

อัพเดทบทความจากคนวงในสายไอทีทาง LINE ก่อนใคร
อย่าลืมแอดไลน์ @techstarth เป็นเพื่อนนะคะ

เพิ่มเพื่อน

 

บทความล่าสุด