search
HomeBackend DevelopmentPHP Tutorial淘宝资深架构师微博的一句话,小弟我来问问

淘宝资深架构师微博的一句话,我来问问
淘宝资深架构师在微博上说了这么一句话,内容如下
“做Web,前端还是PHP(或者Ruby, Python,Perl)起步快,发展到一定阶段后再分层,中间层再用C/C++, Java,Go这类的语言实现高性能,分布式服务。所以学好两门语言还是有必要的。”

链接在此
请问这个前端是怎么定义的?或者这个前端指的是什么?
因为就我目前的水平,我理解的前端是html css js之类的


------解决方案--------------------
N,应该更广义一些,泛指直接面对使用者的表现/接收层
------解决方案--------------------
一般把与用户交互的层称为前端,php这类脚本也是在与用户打交道。后端是指数据存储或计算的层。比如db,比如日志,日志分析等等。

不过我个人认为php这类脚本的定位也应该是中间层,就像mvc模型中的c属于前端与后端的桥梁。
------解决方案--------------------
淘宝的前端不是php做的吗?底层可能就是c,c++,java
------解决方案--------------------
 当涉及到 高性能 分布式的前提下 PHP就到了前端了...这里说的前端可能泛指了一些,因为在一些项目里PHP很多时候也在处理输出,而不是抛出数据.大约才有这么一说吧.

这个东西没有科学标准,所以楼主也不需要纠结,怎么说都对。
------解决方案--------------------
他说的前端不是我们平时所理解的前端,同5楼意见

DAO以下据说一般是C++或者JAVA了
------解决方案--------------------
不一定要跨语言的,用接口就可以,把数据传到其他语言的接口,就像接力赛,各自跑一段
我做这个事情已经多年,只要格式化一段数据在最短时间扔给下家接收,所以有很长时间没”接触“数据库了

引用:
引用:他说的前端不是我们平时所理解的前端,同5楼意见

DAO以下据说一般是C++或者JAVA了
我还没到那个级别。我写的代码都是一个语言的。你了解怎么在一个项目里面夸语言写吗?
比如你说的,dao用java,可能dao上面用php,这个是怎么结合的

------解决方案--------------------
引用:
我还没到那个级别。我写的代码都是一个语言的。你了解怎么在一个项目里面夸语言写吗?
比如你说的,dao用java,可能dao上面用php,这个是怎么结合的



DAO还是可以用PHP来写的,跨语言的时候换一个DAO类就可以,这个DAO类实现REST模式的数据操作,而JAVA那边就提供REST服务
我也没实际玩过,但手上的项目已经准备进入这一阶段了.然而其实由于我不精通JAVA,当然不会用JAVA搞REST,还是用PHP做REST服务平台的(主要是为了做分离,不是为了实现跨语言),以后再看情况要不要换JAVA吧...公司也没有意思请PHP以外的技术人员的样子,比如员工抽空学一下,了解一下.NET都表现出不高兴呢
------解决方案--------------------
不同语言的交互,最简单的方法可以采用i/o输出的接口来进行。比如java请求一个php的接口返回一段json,java拿到这个json然后去做自己的处理,得到结果后再post给.net。

不过也有别的办法,比如Apache Thrift。先前是facebook开发的,这个东西充当一个翻译的角色。它会把源语言的数据结构转换为自己的一种中间语言(DSL),然后再转换为目标语言可以识别的数据类型。不过这个东西有点庞大,需要一定的学习成本。
也有一些比较轻量级的,google的protocolbuf。
------解决方案--------------------
引用:
引用:不一定要跨语言的,用接口就可以,把数据传到其他语言的接口,就像接力赛,各自跑一段
我做这个事情已经多年,只要格式化一段数据在最短时间扔给下家接收,所以有很长时间没”接触“数据库了
上面打错字了,是JSON数据。还有,你说不一定要跨语言的。从我目前的水平来看你的回复,我认为是已经夸语言了。因为你说把数据传到其他语言的接口。不知错……


他说的没有错,那并不算跨语言。那就是我说的第一种方法。
真正的跨语言,需要php可以读取或引用java或.net的数据类型,这需要一定的转换工作。再比如c要读取c++的class数据时,需要将其转换为struct,因为c没有class。Thrift和protocolbuf就是类似这样工作的。

第一种方法所有语言使用的都是第三方的数据类型:json、xml等。
------解决方案--------------------
嗯,不是真正的跨语言,除了JSON,XML,还有BSON,要求不是非常非常高的话相信这些数据格式通过REST就已经能满足了.但是REST是基于http协议的,一般用于Web开发领域
非Web开发或者Web底层模块可能就是真正的跨语言翻译数据与对象了吧.
------解决方案--------------------
淘宝网的主页,商品页面等等一些 用户常用的web应用用php来做。效率比java,c++要高。

淘宝中中和支付有关的功能,用c++或php去做。
因为涉及到钱,这样的功能实在太重要了。考虑到安全性等等因素。所以不用php。
还有,php中可以调用java 手册中有

这是我的理解
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

Simple Guide: Sending Email with PHP ScriptSimple Guide: Sending Email with PHP ScriptMay 12, 2025 am 12:02 AM

PHPisusedforsendingemailsduetoitsbuilt-inmail()functionandsupportivelibrarieslikePHPMailerandSwiftMailer.1)Usethemail()functionforbasicemails,butithaslimitations.2)EmployPHPMailerforadvancedfeatureslikeHTMLemailsandattachments.3)Improvedeliverability

PHP Performance: Identifying and Fixing BottlenecksPHP Performance: Identifying and Fixing BottlenecksMay 11, 2025 am 12:13 AM

PHP performance bottlenecks can be solved through the following steps: 1) Use Xdebug or Blackfire for performance analysis to find out the problem; 2) Optimize database queries and use caches, such as APCu; 3) Use efficient functions such as array_filter to optimize array operations; 4) Configure OPcache for bytecode cache; 5) Optimize the front-end, such as reducing HTTP requests and optimizing pictures; 6) Continuously monitor and optimize performance. Through these methods, the performance of PHP applications can be significantly improved.

Dependency Injection for PHP: a quick summaryDependency Injection for PHP: a quick summaryMay 11, 2025 am 12:09 AM

DependencyInjection(DI)inPHPisadesignpatternthatmanagesandreducesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itallowspassingdependencieslikedatabaseconnectionstoclassesasparameters,facilitatingeasiertestingandscalability.

Increase PHP Performance: Caching Strategies & TechniquesIncrease PHP Performance: Caching Strategies & TechniquesMay 11, 2025 am 12:08 AM

CachingimprovesPHPperformancebystoringresultsofcomputationsorqueriesforquickretrieval,reducingserverloadandenhancingresponsetimes.Effectivestrategiesinclude:1)Opcodecaching,whichstorescompiledPHPscriptsinmemorytoskipcompilation;2)DatacachingusingMemc

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.