php+开发+微服务器端,php微服务架构框架

本文介绍了微服务架构的背景及其优势和挑战,并重点探讨了PHP领域的三个微服务框架:TARS-PHP(腾讯),PHP-msf(Camera360)和Swoft。这些框架各具特点,如TARS-PHP在腾讯内部广泛应用,PHP-msf基于Swoole提供高性能服务,而Swoft则是一个全协程的高性能框架。微服务与Docker的结合也是这些框架的一大亮点。
摘要由CSDN通过智能技术生成

微服务架构浅析及三大php微服务架构框架介绍

现在是个程序员都要搞一下微服务,PHP还好,特别是java这种在国内重设计的的语言,

之前我在v2ex里面看到说写一个没啥人的小论坛后台都是原开发者把后台的 api 做成了 Spring cloud ribbon with eureka 的微服务架构,很强啊.

诞生于 2014 年的“微服务架构”,其思想经由 Martin Fowler 阐述后,在近几年持续受到重视,理论与相关实践都不断发展,目前谈架构必定会言及微服务架构。

微服务的优点

每个服务足够内聚,足够小,代码容易理解,这样能聚焦一个指定的业务功能需求。开发简单、开发效率提供,一个服务可能就是专一的只干一件事,微服务能够被小团推单独开发,这个小团队是2到5人的开发人员组成。

微服务的缺点

开发人员要处理分布式的复杂性,多服务运维艰难,随着服务的增加,运维的压力也在增大,系统部署互相依赖,服务间通信成本,数据一致性,系统集成测试,性能监控

看看了解一下php有哪些微服务架构

1.TARS-PHP(来自腾讯)

Tars这个名字来自星际穿越电影人机器人Tars,电影中Tars有着非常友好的交互方式,任何初次接触它的人都可以轻松的和它进行交流,同时能在外太空、外星等复杂地形上,超预期的高效率的完成托付的所有任务。拥有着类似设计理念的Tars也是一个兼顾易用性、高性能、服务治理的框架,目的是让开发更简单,聚焦业务逻辑,让运营更高效,一切尽在掌握。

目前该框架在腾讯内部,有100多个业务、1.6多万台服务器上运行使用。

2.PHP-msf (来自Carema360)

PHP微服务框架即“Micro Service Framework For PHP”,是Camera360社区服务器端团队基于Swoole自主研发现代化的PHP协程服务框架,简称msf或者php-msf,是Swoole的工程级企业应用框架,经受了Camera360自拍相机亿级用户高并发大流量的考验。

php-msf由Camera360服务器团队主导研发,会持续更新与维护,也希望有更多优秀的Swoole应用实践开发者加入。php-msf核心设计思想是采用协程、异步、并行的创新技术手段提高系统的单机吞吐能力,降低整体服务器成本。

php-msf 的文档少得可怜,就是简单的介绍了一下。不过如果熟悉 MVC 的 PHP 开发框架的话,只要熟练一下 API 就可以了,其他倒没什么。

作为微服务框架,与 Docker 一定是有联系的, 而我觉得 php-msf 在这方面做得很不错,而且有自己的 Docker 镜像列表来 pull,省去自己配置环境的麻烦。

3.swoft (Nelson Bighetti)

基于swoole协程2.x的高性能PHP微服务框架,框架全协程实现,性能优于传统的php-fpm模式。

没有swoole之前,php一直被"誉“为世界上最好的语言。swoole横空出世后,php就成了宇宙最好的语言了...

swoft是基于swoole的高性能协程全栈框架。看了 swoft官网介绍, 瞬间觉得是一个牛逼闪闪的框架。

想要使用swoole,如果自己手工造一个框架,时间成本太高,而且对自己的代码质量没什么信心(好吧,这才是主要原因...),如果将swoole与流行的框架,如laravel,yii2,thinkphp结合,会遇到不少坑,而且这些框架显得过于笨重。

去评论

目前还没人评论,做第一个吃螃蟹的人吧!!!

PHP Microservices by Carlos Perez Sanchez English | 29 Mar. 2017 | ASIN: B01MQGB212 | 392 Pages | AZW3 | 4.91 MB Key Features Build your own applications based on event-driven microservices and set them up on a production server. Successfully transform any monolithic application into a microservice. Monitor the health of your application, prevent downtime, and reduce costs. Book Description The world is moving away from bulky, unreliable, and high-maintenance PHP applications, to small, easy-to-maintain and highly available microservices and the pressing need is for PHP developers to understand the criticalities in building effective microservices that scale at large. This book will be a reliable resource, and one that will help you to develop your skills and teach you techniques for building reliable microservices in PHP. The book begins with an introduction to the world of microservices, and quickly shows you how to set up a development environment and build a basic platform using Docker and Vagrant. You will then get into the different design aspects to be considered while building microservices in your favorite framework and you will explore topics such as testing, securing, and deploying microservices. You will also understand how to migrate a monolithic application to the microservice architecture while keeping scalability and best practices in mind. Furthermore you will get into a few important DevOps techniques that will help you progress on to more complex domains such as native cloud development, as well as some interesting design patterns. By the end of this book you will be able to develop applications based on microservices in an organized and efficient way. You will also gain the knowledge to transform any monolithic applications into microservices. What you will learn Set up a development environment using the right strategies and tools. Learn about application design and structure to start implementing your application. Transform a monolithic application into microservices. Explore the best way to start implementing your application using testing. Understand how to monitor your microservices, handle errors, and debug the application. Deploy your finished application into a production environment and learn how to solve common problems. Know how to scale your application based on microservices once it is up–and-running. About the Author Carlos Perez Sanchez is a backend web developer with more than 10 years of experience in working with the PHP language. He loves finding the best solution for every single problem on web applications and coding, looking to push forward the best practices for development, ensuring a high level of attention to detail.He has a bachelors degree in computer engineering from the University of Alicante in Spain, and he has worked for different companies in the United Kingdom and Spain. He has also worked for American companies and is currently working for Pingvalue. You can connect with him on LinkedIn at https://www.linkedin.com/in/mrcarlosdev. Pablo Solar Vilarino is a software developer who became interested in web development when PHP 4 started becoming a popular language. Over the last few years, he has worked extensively with web, cloud, and mobile technologies for medium-to-large companies and is currently an e-commerce developer at NITSNETS. He has a passion for new technologies, code standards, scalability, performance, and open source projects. Pablo can be approached online at https://pablosolar.es/. Table of Contents What are Microservices? Development Environment Application Design Testing and Quality Control Microservices Development Monitoring Security Deployment From Monolithic to Microservices Strategies for Scalability Best Practices and Conventions Cloud and DevOps
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值