# Microservices ด้วย Symfony (Symfony) > API Gateway, service discovery, distributed transactions, event-driven architecture, resilience patterns - 22 คำถามสัมภาษณ์ - Senior - [คำถามสัมภาษณ์: Symfony](https://sharpskill.dev/th/technologies/symfony/interview-questions.md) ## 1. API Gateway ในสถาปัตยกรรม microservices คืออะไร? **คำตอบ** API Gateway คือจุดเข้าใช้งานเพียงจุดเดียวสำหรับทุกคำขอจากไคลเอนต์ไปยัง microservices มันทำหน้าที่เป็น reverse proxy ที่กำหนดเส้นทางคำขอไปยังบริการที่เหมาะสม จัดการการยืนยันตัวตน, rate limiting, การแคช และการรวมผลลัพธ์ ในระบบนิเวศ Symfony โซลูชันอย่าง Kong, Traefik หรือการพัฒนาแบบกำหนดเองด้วย Symfony สามารถทำหน้าที่เป็น Gateway ได้ ## 2. pattern ใดที่ช่วยให้จัดการ distributed transactions ข้าม microservices หลายตัวได้โดยไม่ต้องใช้ global locking? **คำตอบ** pattern Saga จัดการ distributed transactions โดยแบ่งมันออกเป็นลำดับของทรานแซกชันในระดับท้องถิ่น แต่ละบริการจะดำเนินการทรานแซกชันท้องถิ่นของตนและเผยแพร่ event เพื่อกระตุ้นทรานแซกชันถัดไป เมื่อเกิดความล้มเหลว จะมีการดำเนินการ compensating transactions เพื่อย้อนกลับการเปลี่ยนแปลง pattern นี้หลีกเลี่ยงการล็อกแบบกระจายและเพิ่มความพร้อมใช้งาน ## 3. Symfony Messenger ช่วยอำนวยความสะดวกในการสื่อสารแบบอะซิงโครนัสระหว่าง microservices อย่างไร? **คำตอบ** Symfony Messenger ช่วยให้ส่งข้อความไปยัง transport ภายนอกอย่าง RabbitMQ, Amazon SQS หรือ Redis ได้ แต่ละ microservice สามารถเผยแพร่ข้อความไปยัง bus และบริการอื่นจะบริโภคข้อความเหล่านั้นแบบอะซิงโครนัส ข้อความจะถูก serialize (JSON, Protobuf) และสามารถข้ามขอบเขตของบริการได้ ทำให้เกิด loose coupling ## มีอีก 19 คำถาม - pattern Circuit Breaker คืออะไร และจะนำไปใช้กับ Symfony ได้อย่างไร? - ข้อได้เปรียบหลักของรูปแบบ Database per Service ในสถาปัตยกรรม microservices คืออะไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Symfony อื่นๆ - [PHP สมัยใหม่ (8.1+)](https://sharpskill.dev/th/technologies/symfony/interview-questions/php-modern-features.md): 20 คำถาม, Junior - [พื้นฐาน Symfony](https://sharpskill.dev/th/technologies/symfony/interview-questions/symfony-basics.md): 25 คำถาม, Junior - [Routing & Controllers](https://sharpskill.dev/th/technologies/symfony/interview-questions/routing-controllers.md): 20 คำถาม, Junior - [Twig & Templates](https://sharpskill.dev/th/technologies/symfony/interview-questions/twig-templates.md): 20 คำถาม, Junior - [พื้นฐาน Doctrine ORM](https://sharpskill.dev/th/technologies/symfony/interview-questions/doctrine-orm-basics.md): 25 คำถาม, Junior - [ฟอร์ม Symfony](https://sharpskill.dev/th/technologies/symfony/interview-questions/forms.md): 22 คำถาม, Junior - [การตรวจสอบความถูกต้องของข้อมูล](https://sharpskill.dev/th/technologies/symfony/interview-questions/validation.md): 18 คำถาม, Junior - [Dependency Injection & Services](https://sharpskill.dev/th/technologies/symfony/interview-questions/dependency-injection.md): 24 คำถาม, Mid-Level - [Security & Authentication](https://sharpskill.dev/th/technologies/symfony/interview-questions/security-authentication.md): 26 คำถาม, Mid-Level - [Doctrine ขั้นสูง](https://sharpskill.dev/th/technologies/symfony/interview-questions/doctrine-advanced.md): 24 คำถาม, Mid-Level - [API Platform](https://sharpskill.dev/th/technologies/symfony/interview-questions/api-platform.md): 22 คำถาม, Mid-Level - [Serializer Component](https://sharpskill.dev/th/technologies/symfony/interview-questions/serializer.md): 20 คำถาม, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/th/technologies/symfony/interview-questions/events-subscribers.md): 20 คำถาม, Mid-Level - [Console & Commands](https://sharpskill.dev/th/technologies/symfony/interview-questions/console-commands.md): 18 คำถาม, Mid-Level - [Messenger Component](https://sharpskill.dev/th/technologies/symfony/interview-questions/messenger.md): 22 คำถาม, Mid-Level - [HTTP Client](https://sharpskill.dev/th/technologies/symfony/interview-questions/http-client.md): 18 คำถาม, Mid-Level - [Cache & ประสิทธิภาพ](https://sharpskill.dev/th/technologies/symfony/interview-questions/cache.md): 20 คำถาม, Mid-Level - [Workflow Component](https://sharpskill.dev/th/technologies/symfony/interview-questions/workflow.md): 18 คำถาม, Mid-Level - [Testing Symfony](https://sharpskill.dev/th/technologies/symfony/interview-questions/testing.md): 22 คำถาม, Mid-Level - [Mailer Component](https://sharpskill.dev/th/technologies/symfony/interview-questions/mailer.md): 16 คำถาม, Mid-Level - [การแปลและ i18n](https://sharpskill.dev/th/technologies/symfony/interview-questions/translations.md): 16 คำถาม, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/th/technologies/symfony/interview-questions/easyadmin.md): 18 คำถาม, Mid-Level - [สถาปัตยกรรม Symfony](https://sharpskill.dev/th/technologies/symfony/interview-questions/architecture-patterns.md): 24 คำถาม, Senior - [ประสิทธิภาพและการเพิ่มประสิทธิภาพ](https://sharpskill.dev/th/technologies/symfony/interview-questions/performance-optimization.md): 22 คำถาม, Senior - [ความปลอดภัยขั้นสูง](https://sharpskill.dev/th/technologies/symfony/interview-questions/security-advanced.md): 22 คำถาม, Senior - [Custom Bundles](https://sharpskill.dev/th/technologies/symfony/interview-questions/custom-bundles.md): 20 คำถาม, Senior - [Real-time & WebSockets](https://sharpskill.dev/th/technologies/symfony/interview-questions/real-time.md): 18 คำถาม, Senior - [Deployment & DevOps](https://sharpskill.dev/th/technologies/symfony/interview-questions/deployment-devops.md): 20 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/symfony/interview-questions/microservices