{"id":414,"date":"2017-06-28T15:39:00","date_gmt":"2017-06-28T22:39:00","guid":{"rendered":"http:\/\/www.kenwalger.com\/blog\/?p=414"},"modified":"2017-07-10T19:59:49","modified_gmt":"2017-07-11T02:59:49","slug":"mongodbs-baas-offering-stitch","status":"publish","type":"post","link":"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodbs-baas-offering-stitch\/","title":{"rendered":"Overview of MongoDB&#8217;s BaaS offering: MongoDB Stitch"},"content":{"rendered":"<p>One of the challenges many developers have is keeping up with backend processes. Things like data security, service integrations, and code for data manipulations can take up a lot of time and resources. As a result, many have made a move to utilize a Backend as a Service (BaaS). If you have an application backed by <a href=\"http:\/\/www.mongodb.com\">MongoDB<\/a>\u00a0there is a new Baas option available, MongoDB Stitch.<\/p>\n<p>MongoDB allows you to <a href=\"https:\/\/www.mongodb.com\/cloud\/stitch\">get started<\/a> at no cost with Stitch, which is always great. At the moment it is backed by MongoDB&#8217;s Database as a Service (DBaaS) offering, <a href=\"https:\/\/www.mongodb.com\/cloud\/atlas\/\">Atlas<\/a>. In <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-atlas\/\">another post<\/a>, I discussed Atlas and am excited that these two services are connected.<\/p>\n<h3>BaaS Overview<\/h3>\n<p>A Backend as a Service approach to development allows mobile and web developers to connect their applications to backend cloud storage and utilize inherent\u00a0processing capabilities. Further, it provides many common features that users demand from sites and applications. Some of these features are security, user management, push notifications, and social networking integrations.<\/p>\n<h3>MongoDB Stitch Benefits<\/h3>\n<p>Stitch provides many capabilities\u00a0for developers to leverage the features inherent\u00a0in MongoDB along with BaaS concepts. It provides direct access to the database, whether it is already existing or new data, Stitch allows developers to focus on building their application. The backend logic is taken care of and provided.\u00a0This leads to a faster development cycle.<\/p>\n<p>Stitch takes MongoDB&#8217;s data <a href=\"https:\/\/docs.mongodb.com\/manual\/security\/\">security features<\/a> even further. It provides functionality such as end user authentication and access control on a per-field basis. For example, if the marketing department doesn&#8217;t need access to a customer&#8217;s financial information, those fields\u00a0can be excluded from their access rights. This allows developers and application stakeholders to have confidence that information and services are only available to the proper users.<\/p>\n<p>MongoDB has built Stitch in an open fashion. It provides a single API allowing access to both the MongoDB database as well as other public cloud services. This allows for microservice integration and prevents being committed to a single vendor.<\/p>\n<p>Another terrific benefit is the integration with Atlas. This allows for easy scaling of capacity and performance as an application grows. This is yet another set of duties that don&#8217;t need to be managed ourselves. We can allow the details of the backend application and infrastructure to be handled by a team of Dev-Ops folks at MongoDB and can then concentrate on the application itself.<\/p>\n<h3>MongoDB Stitch Components<\/h3>\n<p>There are three main components of Stitch, <a href=\"https:\/\/docs.mongodb.com\/stitch\/pipelines\/\">pipelines<\/a>, services, and <a href=\"https:\/\/docs.mongodb.com\/stitch\/rules\/\">rules<\/a>. Services come in two different varieties, <a href=\"https:\/\/docs.mongodb.com\/stitch\/services\/mongodb\/\">MongoDB services<\/a>, and <a href=\"https:\/\/docs.mongodb.com\/stitch\/services\/\">partner services<\/a> for integration with services like Amazon S3 or Twilio\u00a0for messaging. Let&#8217;s take a quick look at what these different components do and how they fit into an application.<\/p>\n<h6>Services<\/h6>\n<p>Services in Stitch allow for application integration and execution of common actions. There are integrations for a variety of third-party (partner) services for such tasks as user authentication through Facebook or Google, Slack, Twilio, and some components of AWS, to name a few. The <a href=\"https:\/\/docs.mongodb.com\/stitch\/services\/http\/\">HTTP Service<\/a> allows for a MongoDB Stitch application to connect to REST API services. MongoDB has a dedicated service for connecting to Atlas and has some built in pipeline operations.<\/p>\n<h6>Pipelines<\/h6>\n<p>A Stitch pipeline allows for a sequence of actions to be performed in order by the Stitch services. This is a powerful feature. It allows a series of actions to be defined all through simple JSON syntax.<\/p>\n<p>A pipeline is built in stages, each running in consecutive order. A stage runs and passes the information it generates onto the next stage. For example, you can do a MongoDB aggregation stage from your data and determine which user in the past week had the most likes on your new Snap-o-gram app. That stage could then pass that information to the Twilio Service which could send a text to their phone with this awesome accomplishment.<\/p>\n<p>There are some Built-In Actions for filtering the pipeline input, defining in an explicit way what the output of a stage will be, expression evaluation against input documents, and a project feature, to name a few. Another nice feature MongoDB has provided is the concept of <a href=\"https:\/\/docs.mongodb.com\/stitch\/reference\/namedpipelines\/\">named pipelines<\/a>. This allows for a designed pipeline to be reused within a Stitch app and referenced by name. A tremendous help for writing code that follows the DRY (don&#8217;t repeat yourself) principle.<\/p>\n<h6>Rules<\/h6>\n<p>The last major component of a MongoDB Stitch is Rules. Rules, as one might guess, allow for a control over the actions a service takes. Rules are designed and written in JSON format, as are pipelines.<\/p>\n<p>One can define a rule for read, write, and validation operations, for example. These can be used at the document level and on down to the field level. Want to prevent a service from reading specific financial data in a document? Write a rule for that. It is a powerful feature of MongoDB Stitch and provides an extra level of security for your data.<\/p>\n<h3>MongoDB Stitch Development<\/h3>\n<p>Right now there are three different options for developing a Stitch application. Using JavaScript for web applications and for mobile development there are options for Android and iOS. MongoDB has put together some great <a href=\"https:\/\/docs.mongodb.com\/stitch\/tutorials\/\">tutorials<\/a> and <a href=\"https:\/\/docs.mongodb.com\/stitch\/getting-started\/first-stitch-app\/\">getting started<\/a> guides.<\/p>\n<h3>Wrap Up<\/h3>\n<p>The name Stitch comes out of the idea of stitching together the pieces of an application and not from the Disney character in <a href=\"https:\/\/www.amazon.com\/gp\/product\/B00009XMNJ\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B00009XMNJ&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=d2d5a61e657b363b42c52c8968b778e8\" target=\"_blank\" rel=\"noopener\">Lilo &amp; Stitch<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B00009XMNJ\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/>. Given the benefits and features MongoDB Stitch brings to the table, I think it is a very appropriate name. Much like <a href=\"https:\/\/www.amazon.com\/gp\/product\/B015KM765Y\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B015KM765Y&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=79470d1ee6a76031c019d66162f4c4ba\" target=\"_blank\" rel=\"noopener\">sewing<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-na.amazon-adsystem.com\/e\/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B015KM765Y\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/>\u00a0brings all of the pieces of a garment together, MongoDB Stitch does the same thing for your application.<\/p>\n<p>I know that for myself I plan on utilizing this service on my next project.<\/p>\n<p>As with any &#8220;pre-packaged&#8221; service, one gives up some flexibility and control over your application. However, for being able to retain direct access to your MongoDB database, and the <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/glossary\/#collection\">collections<\/a> and <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/document-model\/\">documents<\/a> it contains, Stitch is a great option.\u00a0Keep in mind that as of this post, Stitch is still in a beta version. As with any beta product, things may change with the final product.<\/p>\n<p>There are several MongoDB specific terms in this post. I created a <a href=\"https:\/\/www.echoskillstore.com\/MongoDB-Dictionary\/45103\">MongoDB Dictionary<\/a> skill for the <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01DFKC2SO\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01DFKC2SO&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=f9e513223de2525a72b95cf9561db55b\" rel=\"noopener noreferrer\">Amazon Echo<\/a>\u00a0line of products. Check it out and you can say &#8220;Alexa, ask MongoDB for the definition of authentication?&#8221; and get a helpful response.<\/p>\n<hr \/>\n<p><em>Follow me on Twitter <a href=\"https:\/\/www.twitter.com\/kenwalger\">@kenwalger<\/a> to get the latest updates on my postings.<\/em><\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414&#038;t=Overview%20of%20MongoDB%E2%80%99s%20BaaS%20offering%3A%20MongoDB%20Stitch&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414&#038;p&#091;images&#093;&#091;0&#093;=https%3A%2F%2Fi0.wp.com%2Fwww.kenwalger.com%2Fblog%2Fwp-content%2Fuploads%2F2017%2F06%2Fmongodbstitch-e1498689024596.png%3Ffit%3D125%252C125%26ssl%3D1&#038;p&#091;title&#093;=Overview%20of%20MongoDB%E2%80%99s%20BaaS%20offering%3A%20MongoDB%20Stitch\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414&#038;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414&#038;title=Overview%20of%20MongoDB%E2%80%99s%20BaaS%20offering%3A%20MongoDB%20Stitch\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/reddit.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414&#038;title=Overview%20of%20MongoDB%E2%80%99s%20BaaS%20offering%3A%20MongoDB%20Stitch\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Overview%20of%20MongoDB%E2%80%99s%20BaaS%20offering%3A%20MongoDB%20Stitch&#038;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F414\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png?resize=48%2C48&#038;ssl=1\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>One of the challenges many developers have is keeping up with backend processes. Things like data security, service integrations, and code for data manipulations can take up a lot of time and resources. As a result, many have made a move to utilize a Backend as a Service (BaaS). If you have an application backed &hellip; <a href=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodbs-baas-offering-stitch\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Overview of MongoDB&#8217;s BaaS offering: MongoDB Stitch&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":417,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[73,72],"yst_prominent_words":[246,268,413,123,419,408,99,416,414,87,411,407,418,420,415,271,410,409,417,412],"class_list":["post-414","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mongodb","tag-baas","tag-stitch","pmpro-has-access"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/mongodbstitch-e1498689024596.png?fit=125%2C125&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8lx70-6G","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":3,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"predecessor-version":[{"id":451,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions\/451"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media\/417"}],"wp:attachment":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/tags?post=414"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}