简体   繁体   English

Google App Engine与Firebase

[英]Google App Engine vs Firebase

I am trying to decide which option to go with. 我正在尝试决定使用哪个选项。 (or another if it is better) This is for a messaging type app where there will be high volume of notifications and database writes. (或者如果更好的话,则为另一个)这适用于消息类型的应用程序,其中会有大量的通知和数据库写入。

Option 1 - Google App Engine using Cloud Endpoints and Cloud Datastore 选项1 - 使用Cloud Endpoints和Cloud Datastore的Google App Engine
Pros: 优点:

  • Able to build out an API the way I would like. 能够按照我想要的方式构建API。
  • Scalable 可扩展

Cons: 缺点:

  • More work implementing a notification system. 实施通知系统的更多工作。 (Which will end up being Firebase Cloud Messaging) (最终将成为Firebase云消息传递)

Option 2 - Firebase 选项2 - Firebase
Pros: 优点:

  • Able to use the Firebase Database, Firebase User Authentication, Firebase Cloud Messaging(notifications) 能够使用Firebase数据库,Firebase用户身份验证,Firebase云消息传递(通知)
  • Detailed use statistics for all devices 所有设备的详细使用统计信息

Cons: 缺点:

  • No API 没有API

Option 3 - Would it be possible to combine Google Cloud Endpoints and Firebase? 选项3 - 是否可以组合Google Cloud Endpoints和Firebase?

First off take a look at the chart here from the Google docs for a great comparison and contrast of the different mobile app backend services they offer. 首先来看看图表这里从谷歌文档为一个伟大的比较和它们提供的不同的移动应用后端服务的对比。 Here is the chart: 这是图表:

在此输入图像描述

My personal opinions are (Updated): 我的个人意见(更新):

Option 1 - Google App Engine using Cloud Endpoints and Cloud Datastore 选项1 - 使用Cloud Endpoints和Cloud Datastore的Google App Engine
Pros: 优点:

  • You will learn a lot more about the restful pattern writing your own API. 您将学习更多关于编写自己的API的restful模式。 You will also be forced to learn how to make restful api calls (either with iOS or Android) and that is a very valuable skill in the industry. 您还将被迫学习如何进行宁静的api调用(使用iOS或Android),这是业内非常有价值的技能。 Firebase sort of does everything for you and you won't ever learn this stuff. Firebase类似于为您完成所有事情,您将永远不会学到这些东西。
  • You have to write it yourself, but you can get really creative with your API methods and Google Cloud Messaging and the type of methods you create. 您必须自己编写,但您可以通过API方法和Google Cloud Messaging以及您创建的方法类型获得真正的创意。 They can really do anything and connect to any database too (eg MySQL, SQL Server, Datastore). 他们可以真正做任何事情并连接到任何数据库(例如MySQL,SQL Server,Datastore)。 In Firebase you must use their json based database. 在Firebase中,您必须使用基于json的数据库。 I don't recommend using a SQL database for an app but different people have different needs. 我不建议将SQL数据库用于应用程序,但不同的人有不同的需求。

Cons: 缺点:

  • It takes more work and wrapping your head around datastore can be hard at first. 它需要更多的工作,并且最初可能很难将数据存储包围起来。 It is not like a relational database like SQL. 它不像SQL这样的关系数据库。
  • Also I feel there are a few areas where you can "shoot yourself in the foot" by creating methods and queries that are very inefficient and thus take a long time to run. 此外,我觉得有一些领域可以通过创建非常低效的方法和查询来“射击自己”,因此需要很长时间才能运行。
  • One thing that is annoying for new apps is the automatic-scaling in GAE. 新应用程序令人讨厌的一件事是GAE中的自动缩放。 Long story short, if no one hits your API for about 15min then all instances are shut off. 长话短说,如果没有人在大约15分钟内点击你的API,那么所有实例都会被关闭。 Once a new call is made, it takes a significant amount of time to fire an instance back up, and execute your API method. 一旦进行了新的调用,需要花费大量时间来备份实例并执行您的API方法。 This can be annoying for new apps because new users might thing there is something wrong with the app and thus the may stop using it. 这对于新应用程序来说可能很烦人,因为新用户可能会对应用程序出现问题,因此可能会停止使用它。 You can do manual-scaling but then that costs money to have an instance on all the time (as of this writing around $27/month from my billed apps). 你可以进行手动缩放,但是这需要花钱才能有一个实例(从我的账单应用程序开始,每月约27美元/月)。 See my post here for more information on this issue and a solution I came up with. 请参阅我的帖子,了解有关此问题的更多信息以及我提出的解决方案

Option 2 - Firebase 选项2 - Firebase
Pros: 优点:

  • It is made to be easy to use for beginners and there are ample tutorials/courses on Firebase to do those popular things you want to do like send push notifications and sync data. 它对初学者来说很容易使用,并且Firebase上有大量的教程/课程来做你想要做的那些流行的事情,比如发送推送通知和同步数据。
  • Unlike GAE, it is fast out of the box. 与GAE不同,它开箱即用。 No firing up instances. 没有启动实例。 This makes it great for new apps that want to impress users with their fast data gets. 这使得它非常适合希望通过快速数据获取用户的新应用。
  • You can get around learning the nitty gritty of complicated things like adapters (Android) and networking (in mobile apps) and just rely on the Firebase classes. 您可以到处学习适配器(Android)和网络(在移动应用程序中)等复杂功能的细节,并且只需依靠Firebase类。 Maybe it is a little more noob friendly? 也许这是一个更友善的诺布? Again, the documentation is great and out-of-the-box I think there are less chances to shoot yourself in the foot by writing inefficient queries. 再一次,文档是伟大的,开箱即用我认为通过编写低效的查询来拍摄自己的机会较少。

Cons: 缺点:

  • Firebase is heavy on client code. Firebase对客户端代码很重视。 If you want an Android and an iOS app you have to write a lot of client code for both. 如果你想要Android和iOS应用程序,你必须为它们编写很多客户端代码。 In GAE, a lot of that logic is abstracted away in the GAE app. 在GAE中,很多逻辑都在GAE应用程序中被抽象出来。 But this could be an advantage if you don't really want database admins in your app and just have iOS + Android developers who know Firebase. 但如果你真的不想在你的应用程序中使用数据库管理员并且只有知道Firebase的iOS + Android开发人员,这可能是一个优势。 But for me this was the big turn off. 但对我来说,这是一个很大的转折点。
  • What if Firebase goes the way of Parse.com... Where Facebook announced they won't be supporting it anymore. 如果Firebase成为Parse.com的方式怎么办... Facebook宣布他们不再支持它了。 That would really suck! 真的很糟糕! You would be locked in to Firebase and not have developed any programming knowledge on how to make a restful API. 您将被锁定在Firebase中,并且尚未开发出有关如何创建restful API的任何编程知识。 However due to Google's heavy investing in Firebase and now upgrading GCM to Firebase Cloud Messaging, it is clear they have big plans for Firebase and it is not going anywhere. 然而,由于谷歌对Firebase的大量投资以及现在将GCM升级到Firebase云消息传递,很明显他们对Firebase有很大的计划,而且它无处可去。 So I don't think this counts as a "con" but keep it in mind? 所以我不认为这算是一个“骗局”,但记住它?

Read more in the link for possibly combining them. 阅读链接中的更多信息,以便将它们组合起来

I'm puzzled that many discussions of Firebase (including the question and answer above) fail to mention what, to me, is a very important difference: price. 我很困惑,很多关于Firebase的讨论(包括上面的问题和答案)都没有提到对我来说是一个非常重要的区别:价格。

Here is the Firebase price schedule. 这是Firebase的价格表。

Here are the Datastore and GAE pricing. 以下是数据存储GAE定价。

It can be tricky to compare these, but my interpretation is that Firebase is very expensive. 比较这些可能很棘手,但我的解释是Firebase非常昂贵。

And this should come as no surprise. 这应该不足为奇。 GAE and datastore have to compete with similar services from Amazon, Microsoft etc., and the competition is fierce. GAE和数据存储必须与来自亚马逊,微软等的类似服务竞争,竞争非常激烈。 Yes, these services are not as generic as infrastructure and SQL, of course, but they seem to be close enough that the prices remain competitive. 是的,这些服务当然不像基础设施和SQL那样通用,但它们似乎足够接近,价格仍然具有竞争力。

Firebase, on the other hand, is a premium service that competes with other backend services like Parse, and once you decide to use it I think it would be very difficult to switch. 另一方面,Firebase是一种优质服务,可与其他后端服务(如Parse)竞争,一旦您决定使用它,我认为切换非常困难。 It should come as no surprise that Google is pushing Firebase so hard - they are probably going to make a ton of money off of it since they can price it at such a premium. 谷歌如此努力地推动Firebase应该毫不奇怪 - 他们可能会从中赚取大量资金,因为他们可以以如此高的价格定价。

In my opinion, the upshot of this is that Firebase is a good choice for low volume and high-margin services, but if you plan to create a typical, consumer oriented, ad supported service that would depend on large volume to make money, then the cost of Firebase may kill your profit. 在我看来,这样做的结果是Firebase是低容量和高利润服务的不错选择,但是如果你计划创建一个典型的,面向消费者的,广告支持的服务,这将取决于大量赚钱,那么Firebase的成本可能会损害您的利润。

2017-10 Addition : 2017-10增加

I looked at Firebase again with the recent release of Firestore. 我最近发布的Firestore再次查看了Firebase。

I think it is important to be aware of another issue: using Firestore for an Android app means using the Firebase client library which is heavily dependent on Google Play Services, which means you can't deploy to non-Google devices including Amazon Fire tablets and (I believe) the entire Chinese market. 我认为重要的是要注意另一个问题:将Firestore用于Android应用程序意味着使用严重依赖于Google Play服务的Firebase客户端库,这意味着您无法部署到非Google设备,包括Amazon Fire平板电脑和(我相信)整个中国市场。

One thing that I have recently learned as I am struggling to find a solution for it is that firebase does not offer any work around device to device notification ; 我最近学到的一件事是,我正在努力寻找解决方案,因为firebase不提供任何有关设备到设备通知的工作; while it does offer server to device push notification and it's pretty easy to set up. 虽然它确实提供服务器到设备推送通知,但它很容易设置。 But the former lack of feature is very important and there's a conspiracy theory that it's because they are trying to push you to use other google products as well. 但前者缺乏功能是非常重要的,并且有一个阴谋论,因为他们试图推动你使用其他谷歌产品。

Or perhaps, since it wasn't developed at first they kept it the same. 或者,也许,因为它最初没有开发,所以它们保持不变。 I have figured that app engine is a way to connect the firebase and the devices for this purpose and so I would lean towards combining both firebase and other google products in this case app engine . 我认为app引擎是为此目的连接firebase和设备的一种方式,因此我倾向于将firebase和其他谷歌产品结合在这种情况下的app引擎中 If you plan to do more back end processing such as image processing, etc, then you are looking at app engine and compute engine for sure which could be integrated with Firebase resulting in a hypothetically powerful backend solution. 如果您计划进行更多后端处理(如图像处理等),那么您正在查看应用引擎和计算引擎,以确保哪些可以与Firebase集成,从而产生一个假设强大的后端解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM