移动端获取视频第一帧移动端_后端即服务-第1部分

移动端获取视频第一帧移动端

BaaS –简介 (BaaS – Introduction)

Backend as a Service, or depending on your tastes, Mobile Backend as a Service or even Server Stack as a Service is a relatively new cloud offering that is starting to gain momentum in many areas, not just the mobile world.

后端即服务,或者根据您的喜好,“移动后端即服务”甚至“服务器堆栈即服务”是一种相对较新的云产品,在许多领域(不仅仅是移动世界)开始势头强劲。

BaaS, as we shall call it for the sake of brevity, has carved its own little niche nestled neatly between Platform as a Service (PaaS) and Software as a Service (SaaS).  Unsurprisingly, it does exactly what it says on the tin – that is – it provides a near complete server side stack including persistence, user management, data retrieval and querying, file storage and a few other things at the flick of a switch.

为了简洁起见,我们将其称为BaaS,它在平台即服务(PaaS)与软件即服务(SaaS)之间巧妙地刻画了自己的小众市场。 毫不意外的是,它确实做到了它所说的话-也就是说,它提供了近乎完整的服务器端堆栈,包括持久性,用户管理,数据检索和查询,文件存储以及其他一些功能,只需轻轻一按即可。

While the original intention of these BaaS offerings was to avoid the friction and pain of setting up and maintaining a server backend for mobile developers, their use has become much more widespread.  After all, if all you need is some data storage and/or some user management why not?

这些BaaS产品的初衷是为了避免为移动开发人员设置和维护服务器后端带来的磨擦和痛苦,但其使用却变得越来越广泛。 毕竟,如果您只需要一些数据存储和/或一些用户管理,为什么不呢?

BaaS产品的功能 (Features of BaaS Offerings)

This area of the cloud is still in its infancy and evolving on a daily basis.  The competition is quite strong with various companies looking to find a unique way to establish their product, however there are a number of baseline features that you should expect from these providers.

云的这一区域仍处于起步阶段,并且每天都在发展。 各个公司都在寻找一种独特的方式来建立自己的产品,因此竞争非常激烈,但是您应该从这些提供商那里获得许多基准功能。

基本数据存储和检索 (Basic Data Storage and Retrieval)

Obviously the most important aspect of any of these services is a way to store and retrieve your data.  This is especially useful in mobile situations where you may not be bound to a single device or in a social or collaborative application that requires data be shared.

显然,这些服务中最重要的方面是一种存储和检索数据的方法。 这在移动环境中尤其有用,在这种情况下,您可能不会绑定到单个设备,或者在需要共享数据的社交或协作应用程序中。

Existing services offer a somewhat schema-less storage model and adding new object properties (or in a relational DB sense – columns) is a matter of adding them to your client code and pushing the new data.  Current services do offer a certain level of control around schema but this is fairly simplistic and not particularly useful for constraining data sent to the services.  While this flexibility can be a boon to developer productivity initially its worth remembering that as your applications complexity grows you will need to keep tight reign on your schema.

现有服务提供了某种程度上没有模式的存储模型,而添加新的对象属性(或在关系数据库的意义上来说,就是列)是将它们添加到客户端代码并推送新数据的问题。 当前的服务确实提供了对模式的一定程度的控制,但这相当简单,并且对于约束发送给服务的数据不是特别有用。 尽管这种灵活性最初可以提高开发人员的生产力,但值得记住的是,随着应用程序复杂性的增长,您将需要严格控制架构。

Data types, as you’d expect, have a very mobile flavour.  Your typical types such as Strings, Dates, Booleans, Numbers etc. are obviously all available but the other key types that you can expect to see is GeoPoints – the ability to store location and Binary – for storing media.

如您所料,数据类型具有非常好的移动性。 您的典型类型(例如字符串,日期,布尔值,数字等)显然都可用,但是可以期望看到的其他关键类型是GeoPoints(存储位置的能力和Binary)用于存储媒体。

API和SDK (APIs and SDKs)

Exposing a single ReSTful HTTP API to your server stack can be somewhat limiting and often there are better ways to transmit data.  Due to this, and to alleviate some of the drudgery involved in communicating between your client and server, BaaS services typically give you a number of SDKs, each specific to a particular client platform.  These SDKs usually come in three flavors – iOS, Android and JavaScript (useful in, but not limited to, Shell Apps e.g. PhoneGap/Cordova based apps) and offers a cleaner abstraction to work with your service – user authentication, abstract model and collection classes, query builders etc.

向您的服务器堆栈公开单个ReSTful HTTP API可能会有所限制,并且通常有更好的方法来传输数据。 因此,为了减轻客户端与服务器之间通信所涉及的繁琐工作,BaaS服务通常为您提供许多SDK,每个SDK特定于特定的客户端平台。 这些SDK通常具有三种风格-iOS,Android和JavaScript(在但不限于Shell应用程序(例如基于PhoneGap / Cordova的应用程序)中有用),并且提供了更清晰的抽象来与您的服务一起使用-用户身份验证,抽象模型和集合类,查询构建器等。

Alongside these SDKs, there is usually a basic ReST API that allows other platforms or any bespoke solutions people may dream up to work with these BaaS offerings.  It should be noted, however, that the ReST API is generally not as feature complete as the SDKs

除了这些SDK外,通常还有一个基本的ReST API,该API允许人们可能梦dream以求的其他平台或任何定制解决方案与这些BaaS产品一起使用。 但是,应注意,ReST API通常不如SDK那样完整。

While some of the todays services keep true to their mobile roots and officially only offer mobile SDKs, services like StackMob have embraced the extended use cases and made their own official Ruby, Scala and Java SDKs.

尽管当今的某些服务保持其移动根基并正式只提供移动SDK,但StackMob等服务已经扩展了用例,并制作了自己的正式Ruby,Scala和Java SDK。

资料查询 (Data Querying)

Simple fetches of single objects and entire collections are one thing but often it is necessary to perform slightly more complex queries against your data. These services typically offer a way to perform these queries against your collections.  You’ll also find most services offer some sort of paging functionality to reduce the risk of unbounded queries being run against your data.

简单地获取单个对象和整个集合是一回事,但是通常有必要对数据执行稍微复杂一些的查询。 这些服务通常提供一种对集合执行这些查询的方法。 您还将发现大多数服务都提供某种分页功能,以减少对数据运行无限制查询的风险。

Additional queries that come into their own in the mobile space are also available – namely geospatial queries.  For example all services typically offer queries such as “find me data points that are near a certain point” or “find me data points that are within a certain radius of a certain point” – so your “Best Bars in the World” app could easily show the bars/pubs/taverns that are closest to the users current location.

在移动空间中也可以使用其他查询,即地理空间查询。 例如,所有服务通常都提供查询,例如“在某个点附近找到我的数据点”或“在某个点某个半径内的我的数据点” –因此,“世界上最好的酒吧”应用可以轻松显示距离用户当前位置最近的酒吧/酒馆/小酒馆。

二进制存储 (Binary Storage)

Mobile devices are equipped with all manner of data capture instruments – from cameras for pictures and video to microphones for audio.  Its simply no longer all just typing words into a tiny keyboard and as such the BaaS services today generally offer varying levels of binary storage.  For example, Parse offers fully integrated file uploading directly from their SDKs while StackMob simply offer a channel to add your own Amazon S3 configuration and access this data via their ReST API.  Depending on your solution requirements this may or may not be an issue.

移动设备配备了各种数据采集工具–从用于照片和视频的相机到用于音频的麦克风。 它完全不再只是在一个小键盘上键入单词,因此,如今的BaaS服务通常提供不同级别的二进制存储。 例如, Parse直接从其SDK提供完全集成的文件上传,而StackMob仅提供添加自己的Amazon S3配置并通过其ReST API访问此数据的渠道。 根据您的解决方案要求,这可能不是问题。

数据安全 (Data Security)

If you are storing users data its vital that all and sundry aren’t allowed to just access it.  Parse, Kinvey and StackMob all offer various methods to lock data down in ways you’d typically expect such as granting read/write access to data depending on logged in status, to a particular owner/user, to a particular role.  While each service offers similar features, there may be certain quirks or nuances that will want to validate against your requirements before settling on a specific provider.

如果要存储用户数据,那么至关重要的是,不允许所有人和其他人直接访问它。 ParseKinveyStackMob均提供了各种方法,可以按照您通常期望的方式锁定数据,例如根据登录状态,特定所有者/用户,特定角色授予对数据的读/写访问权限。 尽管每种服务都提供类似的功能,但是在选择特定提供商之前,可能会有一些古怪或细微差别需要根据您的要求进行验证。

认证方式 (Authentication)

What good is a server stack if you have no way to authenticate users?  Not much I’d bet.  Thankfully BaaS offerings typically give you the ability to manage users and perform the various things a user would want to do – login, logout, reset password etc. Most services offer integration into the Twitter and Facebook authentication modules

如果您无法对用户进行身份验证,那么服务器堆栈有什么好处? 我敢打赌。 值得庆幸的是,BaaS产品通常使您能够管理用户并执行用户想要执行的各种操作-登录,注销,重设密码等。大多数服务都集成到Twitter和Facebook身份验证模块中

推送通知 (Push Notifications)

Finally, in the mobile world one of the key ways to notify users of changes to data or other external events is generally facilitated through Push Notifications.  Available on almost every mobile platform, push notifications allow you to send data to users devices even when the app is running in the background.  Without the use of a BaaS service you either had to write specific integration code to each OSs specific notification system or make use of another third party cloud service such as Urban Airship.  With BaaS its entirely possible to roll all this into a single managed service – in fact Kinvey, one of the three main BaaS providers, actually integrates with Urban Airship to support push notifications.

最后,在移动世界中,通常通过“推送通知”来促进通知用户数据更改或其他外部事件的关键方法之一。 推送通知几乎可在所有移动平台上使用,即使您在后台运行应用程序,推送通知也可以将数据发送到用户设备。 在不使用BaaS服务的情况下,您要么必须为每个OS的特定通知系统编写特定的集成代码,要么必须使用诸如Urban Airship之类的第三方云服务。 随着巴斯它完全有可能推出这一切到一个单一的托管服务-事实上Kinvey ,三个主要巴斯供应商之一,实际上城市飞艇集成,支持推送通知。

BaaS产品的注意事项 (Considerations for BaaS Offerings)

Obviously as with all things cloudy there are some things you need to consider before signing your life away.

显然,与所有阴天一样,在离开生活之前,您需要考虑一些事项。

锁定 (Lock In)

A common concern for cloud technologies is that of lock-in.  You don’t want to commit to a service only to have the carpet pulled from under you in terms of pricing, support, data sovereignty etc.  You want to make sure you can get your data out as fast as possible if you need to.  You also want to make sure that platform specific code doesn’t propagate too far into your codebase or at least understand the risk involved if you do decide to heavily integrate some platforms specific functionality.  For example – Parse offers an set of (entirely optional) UI widgets with their SDKs that allow you to quickly create login screens and Parse-data bound lists – if you decided you wanted to move to StackMob or Kinvey you would need to consider the effort required to essentially re-write those elements.

对云技术的普遍关注是锁定。 您不希望仅在价格,支持,数据主权等方面脱颖而出就承诺提供服务。您想确保可以根据需要尽快获取数据。 您还希望确保平台特定的代码不会传播到您的代码库中太深,或者至少了解如果您决定大量集成某些平台特定的功能所涉及的风险。 例如, Parse提供了一组(完全可选的)UI小部件及其SDK,使您可以快速创建登录屏幕和Parse-数据绑定列表–如果您决定要移至StackMobKinvey ,则需要考虑付出的努力本质上需要重写这些元素。

数据主权 (Data sovereignty)

Where is your data being stored?  If user data is important to you, and of course it is, you’ll want to understand the implications of storing data in certain geographic locations.  For example, European user data stored in the United States is subject to certain US laws that it otherwise wouldn’t be if it was stored in Europe.

您的数据存储在哪里? 如果用户数据对您很重要,当然,这对您很重要,那么您将需要了解在特定地理位置存储数据的含义。 例如,存储在美国的欧洲用户数据受某些美国法律的约束,否则就不会存储在欧洲。

Not knowing where your data is stored or having the ability to relocate that data could land you in a sticky situation if a user takes exception to your current setup. This is an area that most providers seem to be a bit vague about.

如果用户不喜欢您当前的设置,则不知道您的数据存储在何处或无法重新定位这些数据可能会使您陷入困境。 这是大多数提供商似乎不太清楚的领域。

价钱 (Pricing)

Current BaaS services have varying pricing models.  As with most cloud offerings they generally offer a banded cost model and all have a fairly generous free tier.  Past the free tier different services offer different levels of granularity.  Understanding typical usage of your app upfront is vital.  In certain scenarios the monthly cost between any two services can be as drastic as the difference between $30 and $200 per month.

当前的BaaS服务具有不同的定价模型。 与大多数云产品一样,它们通常提供分段成本模型,并且都具有相当慷慨的免费套餐。 过去的免费套餐中,不同的服务提供了不同级别的粒度。 预先了解应用程序的典型用法至关重要。 在某些情况下,任何两项服务之间的每月费用都可能与每月30美元到200美元之间的差额一样大。

结束点 (Closing Points)

The BaaS world is still finding its feet and rather than being constrained to simply mobile devices they have been utilised in many other solutions and as such many are currently being offered as add-ons on popular PaaS services such as Heroku and AppHarborStackMob even goes as far as offering a PaaS model specifically for HTML5 apps utilising its server features.  Its truly an exciting area to be involved in.

BaaS世界仍在寻找自己的立足点,而不是仅仅局限于移动设备,它们已经在许多其他解决方案中得到使用,因此,许多此类产品作为流行的PaaS服务(例如HerokuAppHarbor)的附件提供StackMob甚至利用其服务器功能提供了专门针对HTML5应用程序的PaaS模型。 它确实是一个令人兴奋的领域。

Hopefully this article has given you a better understanding of the Mobile Backend as a Service ecosystem.  In my next article I want to cast a critical eye over the current offerings in this space (Parse, StackMob and Kinvey) and show you where they rise or fall in terms of features and concerns.

希望本文能使您对移动后端即服务生态系统有更好的了解。 在我的下一篇文章中,我想对这个领域中的当前产品( ParseStackMobKinvey )进行批判并向您展示它们在功能和关注方面的兴衰所在。

翻译自: https://www.sitepoint.com/backend-as-a-service-part-1/

移动端获取视频第一帧移动端

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值