Which PHP framework is suitable for highly concurrent API interfaces?

Source: Internet
Author: User
Tags kohana
Now we use kohana. Now we use kohana.

Reply content:

Now we use kohana.

Yaf phalcon is a good framework written in c and has good performance.

Three Solutions
1. Large and comprehensive framework
Yii laravel

2. Light routing framework
Lumen Slim

3. asynchronous framework
ReactPHP
Https://github.com/reactphp/react

Consider your business scenario. If the business scenario is complex, use 1. You need to implement high flexibility quickly. 2. If there are a large number of IO operations, use 3.

No swoole figure is displayed. You can't help it.
Yaf is not suitable for high concurrency. Yar is just a bit old.
My personal suggestion is:
Swoole + apache thrift

Yaf is essentially a basic framework and only provides a simple and crude basic URI routing function.
The most important thing is concurrency, multithreading, and timer. Yaf itself cannot be implemented.
Therefore, swoole has obvious advantages at this time. Swoole can run stably on the server for a long time in the form of deamon, directly using socket to provide concurrent services.
After thrift is integrated, data can be provided for various other terminals. For example, apps and web pages (yaf can be used to read data as the front-end to provide high performance), and even Data Interaction for C, c ++ and other terminals is very convenient.

You can consider the Blink Framework I wrote https://github.com/bixuehujin/blink. its design intent is to build a high-performance API service.

Blink is a micro-High-Performance Web framework designed to build the "long running" service. The underlying layer is based on the Swoole http server, and the performance is guaranteed.

Blink provides simple and elegant APIs for Building Web applications with high scalability and allows developers to use them more flexibly. It provides common components such as routing, login authentication, dependency injection, and log processing.

High concurrency is essentially unrelated to the framework... The framework only encapsulates some components. High concurrency depends on the architecture design, how asynchronous message queues are implemented, and how cache is implemented. You cannot simply hope for the framework. Otherwise, finally, you will find that adding a framework or not adding a framework is an effect ..

What is the relationship between this and the framework?

Use the framework you are most familiar.
High concurrency mainly focuses on two points:
1. System Architecture
2. the business logic is somewhat related to the framework, but the focus is not on the framework.

System Architecture
The main consideration is the load, network request support, easy O & M, solution discussion, and machine addition.

Business Logic
As a developer, you need to know that the business is under pressure to read and write files in the database.
Cache and asynchronous processing solutions can be implemented as needed

Under the real high concurrency, the program logic itself and the single point will be the bottleneck. The best load balancing solution is the ultimate solution to support infinite growth of high concurrency.

High concurrency has nothing to do with the framework

The performance of highly concurrent APIs depends on the architecture, cache, and database !!! It has nothing to do with the framework !!!

The PHP framework is designed to solve the problem of development efficiency. Compared with JAVA and C/C ++, PHP Execution efficiency is slow enough. The framework is built on PHP with a bunch of code, therefore, PHP is not recommended for the ultimate performance.

The general bottleneck is not in PHP, but in IO. Therefore, it is not important to select anything. It is important to be familiar with it. Problems can be solved quickly

Must be yar of laruence

Yaf is a famous masterpiece of laruence. Yaf should be used if the framework is to pursue high performance. It is said that Baidu uses a modified Yaf version internally.
The latest Yaf version is 2.3.5 released on:
Http://pecl.php.net/package/yaf
Http://php.net/manual/zh/book.yaf.php

Lumen.

Swoole

Php7...

Why frame

We recommend that you set up hhvm or php7 with yaf.

Io-intensive high concurrency should be scheduled to the io layer using the epoll model, and then the db is designed. Theoretically, it has little to do with cgi. If you are talking about CPU-intensive high concurrency, please ignore my answer

If I sayYII2Will it be beaten?

Yaf or lumen

The company currently uses yaf

BulletPHP

In general, high-concurrency php acts as the intermediate layer. Some infrastructure in java will package most of the logic. In fact, php uses data from the backend to customize the data to the front end, and perform some authentication processing, so we are actually doing interface packaging, so we can choose some lightweight and efficient. If we consider the learning cost, we can try to use a simple framework like slim, if the team is strong enough to connect yaf, another scenario is that php is a sub-application and also a service, that is to say, the soa service is not java, but php, the best programming language in the world, so communication between them is a big problem. Fortunately, laruence also has a yar product, therefore, it is understood that Weibo uses yaf and yar, and I don't know if I am not Weibo, so I don't know if I am too much. However, I can choose what to do based on my own scenarios. I cannot copy the models of other companies.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.