I want to know your suggestions about a good back-end to use with AngularJS as a front-end.
我想知道你对使用AngularJS作为前端的一个好的后端有什么建议。
Why is your suggested back-end good and is it easy to use, or easy to learn?
为什么你建议的后端是好的,它容易使用,还是容易学习?
4 个解决方案
#1
40
There is considerable risk in this question for opinion-based answers, so I suggest a more critical evaluation:
在这个问题中,基于观点的回答存在相当大的风险,因此我建议进行一个更为关键的评估:
Restful server-side implemenations
... Will make working with angular considerably easier and less painful as well as being true to the HTTP spec with all the good things that entails. In any language that you choose ensure that the framework allows for the minimum of effort in doing this.
…将使使用角度更容易,更不痛苦,以及在HTTP规范中使用所有必需的好东西。在您选择的任何语言中,都要确保框架允许进行最少的工作。
In my experience:
以我的经验:
PHP:
PHP:
Vanilla PHP and Codeigniter are capable but poor at doing this, I suggest avoiding them. I cannot speak for Symphony and the larger ORM-based frameworks, but I understand the learning-curve to be non-trivial. I strongly suggest staying away from CMS applications like wordpress and drupal as this kind of thing is not their purpose.
Vanilla PHP和Codeigniter能够做到这一点,但我建议避免使用它们。我不能代表Symphony和更大的基于orm的框架,但我理解学习曲线是非平凡的。我强烈建议远离像wordpress和drupal这样的CMS应用,因为这不是他们的目的。
I understand that Laravel may offer a reasonably low learning curve and is has the understanding of RESTFul interfaces baked in.
我理解Laravel可以提供一个相当低的学习曲线,并且它对RESTFul接口的理解。
NodeJS
NodeJS
NodeJS offers a very large number of frameworks for the server-side with Express and its variants being the apparent base for many of them. Express offers the flexibility to create RESTful interfaces, but does not do this by default. For more syntactic sugar it is usually necessary to wire up your own middleware.
NodeJS为服务器端提供了大量的框架,其中有Express及其变体显然是其中许多框架的基础。Express提供了创建RESTful接口的灵活性,但默认情况下不会这么做。对于更多的语法糖,通常需要连接您自己的中间件。
Ruby on Rails From what I understand there is considerable support for RESTful apis with rails.
Ruby on Rails从我的理解中得到了对RESTful api的大量支持。
Database support
PHP Vanilla PHP mysqli Support for databases works, but is too low-level for use. CodeIgnighter, Symphony, Lavel and other frameworks all offer the necessary abstraction and security for working with the database to varying degrees. Differentiating between them on this is largely a matter of taste. PHP frameworks may struggle for support for NoSQL type newer databases.
PHP香草的PHP sqmyli对数据库的支持是有效的,但是使用起来太低了。codestarghter、Symphony、Lavel和其他框架都为不同程度地使用数据库提供了必要的抽象和安全性。在这一点上区分它们在很大程度上是一种品味问题。PHP框架可能很难支持NoSQL类型的更新数据库。
NodeJS Express Supports all major forms of databases with appropriate middleware with literally thousands of options from the NPM repositories. As usual, you will have to wire them up to express yourself with varying degrees of difficulty.
NodeJS Express支持所有主要的数据库形式,使用适当的中间件,并从NPM存储库中提供数千个选项。像往常一样,你必须把它们连接起来,以不同的难度表达自己。
Ruby on Rails Rails supports the active-record pattern which offers both security and ease of use out of the box. This supports the majority of popular standard relational databases. I cannot speak for its integration for NoSQL databases however.
Ruby on Rails支持活动记录模式,它提供了安全性和开箱即用的易用性。这支持大多数流行的标准关系数据库。但是,我不能说它对NoSQL数据库的集成。
Learning curve
This is too subjective for me to say much other than a few pitfalls: the NodeJS community expects a fairly high degree of skill to get started and the callback hell problem is sufficiently large to be a serious barrier to learner server-side development.
对于我来说,这太主观了,除了几个陷阱之外,我不能说太多:NodeJS社区希望启动相当高的技能,并且回调问题非常大,对于学习者服务器端开发来说是一个严重的障碍。
Security
PHP Vanilla PHP offers little security and is not recommended. Codeigniter, Laravel and the other frameworks offer some protection with string-escaping and protection against SQL injection attacks at least.
PHP香草PHP提供很少的安全性,不推荐使用。Codeigniter、Laravel等框架至少提供了一些字符串转义保护和SQL注入攻击保护。
NodeJS Express doesn't offer too many security features out-of the box but can be hardened with modules like helmet. This is not a deficiency so much as a reflection of the unopinionated nature of the application.
NodeJS Express没有提供太多的安全特性,但可以通过头盔等模块进行加固。这与其说是缺陷,不如说是反映应用程序的固执己见的本质。
Rails I understand Rails offers basic SQL injection protection through Active Record and CSRF protection among other features out of the box.
我知道Rails通过活动记录和CSRF保护提供基本的SQL注入保护以及开箱即用的其他特性。
Personally: I use Koa (an application to supersede express) for my own server-side dev in working with angular. My legacy projects use CodeIgnighter.
我个人使用Koa(一个取代express的应用程序)用于我自己的服务器端开发。我的遗留项目使用了codestarghter。
#2
11
(disclaimer: I'm Ruby on Rails developer)
(声明:我是Ruby on Rails的开发人员)
I believe Ruby on Rails is pretty good to use as json backend.
我相信Ruby on Rails作为json后端是非常好的。
You can easily found a lot of materials and screencast about integrating it with angular, like:
你可以很容易地找到很多材料和屏幕上关于它与角的积分,比如:
-
http://railscasts.com/episodes/405-angularjs
http://railscasts.com/episodes/405-angularjs
-
http://angular-rails.com/bootstrap.html
http://angular-rails.com/bootstrap.html
And building proper JSON api with Rails can be helpful for creating mobile app etc, there also very good material about crafting good Rails RESTful Api, f.e.:
使用Rails构建合适的JSON api可以帮助创建移动应用程序等,也有关于构建良好Rails RESTful api的很好的材料,f.e。
- https://www.codeschool.com/courses/surviving-apis-with-rails
- https://www.codeschool.com/courses/surviving-apis-with-rails
#3
5
I'm biased and I recommend Go because it is able to handle huge amounts of concurrent requests and fast (5000 and up) without consuming too many resources.
我有偏见,我推荐Go,因为它能够处理大量并发请求和快速(5000或以上),而不会消耗太多资源。
However jumping between 2 languages can be painful but in the end will give you a broader understanding of programming. So if you'd like not to switch languages remain with the express framework and node.js since that's where also all the tutorials are, MEAN stack for instance (mean.io)
然而,在两种语言之间跳来跳去是很痛苦的,但最终你会对编程有更广泛的理解。因此,如果您不想切换语言,请保留express框架和节点。因为这也是所有教程的内容,例如,平均堆栈
#4
4
The back-end is up to you to choose, all back-ends should interact the same with Angular JS its more about what you are comfortable or more experienced with.
后端由您选择,所有后端都应该与有棱角的JS进行相同的交互,更多的是关于您感到舒适或更有经验的内容。
You have plenty of choices to look into:
你有很多选择要考虑:
Python: Flask and Django
Python:烧瓶和Django
Javascript: Node JS
JS Javascript:节点
Ruby: Ruby on Rails
Ruby:Ruby on Rails
PHP
PHP
Each will have their learning curves and pitfalls.
每个人都有自己的学习曲线和陷阱。
#1
40
There is considerable risk in this question for opinion-based answers, so I suggest a more critical evaluation:
在这个问题中,基于观点的回答存在相当大的风险,因此我建议进行一个更为关键的评估:
Restful server-side implemenations
... Will make working with angular considerably easier and less painful as well as being true to the HTTP spec with all the good things that entails. In any language that you choose ensure that the framework allows for the minimum of effort in doing this.
…将使使用角度更容易,更不痛苦,以及在HTTP规范中使用所有必需的好东西。在您选择的任何语言中,都要确保框架允许进行最少的工作。
In my experience:
以我的经验:
PHP:
PHP:
Vanilla PHP and Codeigniter are capable but poor at doing this, I suggest avoiding them. I cannot speak for Symphony and the larger ORM-based frameworks, but I understand the learning-curve to be non-trivial. I strongly suggest staying away from CMS applications like wordpress and drupal as this kind of thing is not their purpose.
Vanilla PHP和Codeigniter能够做到这一点,但我建议避免使用它们。我不能代表Symphony和更大的基于orm的框架,但我理解学习曲线是非平凡的。我强烈建议远离像wordpress和drupal这样的CMS应用,因为这不是他们的目的。
I understand that Laravel may offer a reasonably low learning curve and is has the understanding of RESTFul interfaces baked in.
我理解Laravel可以提供一个相当低的学习曲线,并且它对RESTFul接口的理解。
NodeJS
NodeJS
NodeJS offers a very large number of frameworks for the server-side with Express and its variants being the apparent base for many of them. Express offers the flexibility to create RESTful interfaces, but does not do this by default. For more syntactic sugar it is usually necessary to wire up your own middleware.
NodeJS为服务器端提供了大量的框架,其中有Express及其变体显然是其中许多框架的基础。Express提供了创建RESTful接口的灵活性,但默认情况下不会这么做。对于更多的语法糖,通常需要连接您自己的中间件。
Ruby on Rails From what I understand there is considerable support for RESTful apis with rails.
Ruby on Rails从我的理解中得到了对RESTful api的大量支持。
Database support
PHP Vanilla PHP mysqli Support for databases works, but is too low-level for use. CodeIgnighter, Symphony, Lavel and other frameworks all offer the necessary abstraction and security for working with the database to varying degrees. Differentiating between them on this is largely a matter of taste. PHP frameworks may struggle for support for NoSQL type newer databases.
PHP香草的PHP sqmyli对数据库的支持是有效的,但是使用起来太低了。codestarghter、Symphony、Lavel和其他框架都为不同程度地使用数据库提供了必要的抽象和安全性。在这一点上区分它们在很大程度上是一种品味问题。PHP框架可能很难支持NoSQL类型的更新数据库。
NodeJS Express Supports all major forms of databases with appropriate middleware with literally thousands of options from the NPM repositories. As usual, you will have to wire them up to express yourself with varying degrees of difficulty.
NodeJS Express支持所有主要的数据库形式,使用适当的中间件,并从NPM存储库中提供数千个选项。像往常一样,你必须把它们连接起来,以不同的难度表达自己。
Ruby on Rails Rails supports the active-record pattern which offers both security and ease of use out of the box. This supports the majority of popular standard relational databases. I cannot speak for its integration for NoSQL databases however.
Ruby on Rails支持活动记录模式,它提供了安全性和开箱即用的易用性。这支持大多数流行的标准关系数据库。但是,我不能说它对NoSQL数据库的集成。
Learning curve
This is too subjective for me to say much other than a few pitfalls: the NodeJS community expects a fairly high degree of skill to get started and the callback hell problem is sufficiently large to be a serious barrier to learner server-side development.
对于我来说,这太主观了,除了几个陷阱之外,我不能说太多:NodeJS社区希望启动相当高的技能,并且回调问题非常大,对于学习者服务器端开发来说是一个严重的障碍。
Security
PHP Vanilla PHP offers little security and is not recommended. Codeigniter, Laravel and the other frameworks offer some protection with string-escaping and protection against SQL injection attacks at least.
PHP香草PHP提供很少的安全性,不推荐使用。Codeigniter、Laravel等框架至少提供了一些字符串转义保护和SQL注入攻击保护。
NodeJS Express doesn't offer too many security features out-of the box but can be hardened with modules like helmet. This is not a deficiency so much as a reflection of the unopinionated nature of the application.
NodeJS Express没有提供太多的安全特性,但可以通过头盔等模块进行加固。这与其说是缺陷,不如说是反映应用程序的固执己见的本质。
Rails I understand Rails offers basic SQL injection protection through Active Record and CSRF protection among other features out of the box.
我知道Rails通过活动记录和CSRF保护提供基本的SQL注入保护以及开箱即用的其他特性。
Personally: I use Koa (an application to supersede express) for my own server-side dev in working with angular. My legacy projects use CodeIgnighter.
我个人使用Koa(一个取代express的应用程序)用于我自己的服务器端开发。我的遗留项目使用了codestarghter。
#2
11
(disclaimer: I'm Ruby on Rails developer)
(声明:我是Ruby on Rails的开发人员)
I believe Ruby on Rails is pretty good to use as json backend.
我相信Ruby on Rails作为json后端是非常好的。
You can easily found a lot of materials and screencast about integrating it with angular, like:
你可以很容易地找到很多材料和屏幕上关于它与角的积分,比如:
-
http://railscasts.com/episodes/405-angularjs
http://railscasts.com/episodes/405-angularjs
-
http://angular-rails.com/bootstrap.html
http://angular-rails.com/bootstrap.html
And building proper JSON api with Rails can be helpful for creating mobile app etc, there also very good material about crafting good Rails RESTful Api, f.e.:
使用Rails构建合适的JSON api可以帮助创建移动应用程序等,也有关于构建良好Rails RESTful api的很好的材料,f.e。
- https://www.codeschool.com/courses/surviving-apis-with-rails
- https://www.codeschool.com/courses/surviving-apis-with-rails
#3
5
I'm biased and I recommend Go because it is able to handle huge amounts of concurrent requests and fast (5000 and up) without consuming too many resources.
我有偏见,我推荐Go,因为它能够处理大量并发请求和快速(5000或以上),而不会消耗太多资源。
However jumping between 2 languages can be painful but in the end will give you a broader understanding of programming. So if you'd like not to switch languages remain with the express framework and node.js since that's where also all the tutorials are, MEAN stack for instance (mean.io)
然而,在两种语言之间跳来跳去是很痛苦的,但最终你会对编程有更广泛的理解。因此,如果您不想切换语言,请保留express框架和节点。因为这也是所有教程的内容,例如,平均堆栈
#4
4
The back-end is up to you to choose, all back-ends should interact the same with Angular JS its more about what you are comfortable or more experienced with.
后端由您选择,所有后端都应该与有棱角的JS进行相同的交互,更多的是关于您感到舒适或更有经验的内容。
You have plenty of choices to look into:
你有很多选择要考虑:
Python: Flask and Django
Python:烧瓶和Django
Javascript: Node JS
JS Javascript:节点
Ruby: Ruby on Rails
Ruby:Ruby on Rails
PHP
PHP
Each will have their learning curves and pitfalls.
每个人都有自己的学习曲线和陷阱。