<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brian McNamara</title>
    <description>The latest articles on DEV Community by Brian McNamara (@brianvendia).</description>
    <link>https://dev.to/brianvendia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F799630%2Fd3f5d8e1-fabe-4daa-a5fb-0f09b265fb2f.jpeg</url>
      <title>DEV Community: Brian McNamara</title>
      <link>https://dev.to/brianvendia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brianvendia"/>
    <language>en</language>
    <item>
      <title>Scale Your Partner Ecosystem with Vendia Share</title>
      <dc:creator>Brian McNamara</dc:creator>
      <pubDate>Mon, 31 Jan 2022 16:39:56 +0000</pubDate>
      <link>https://dev.to/brianvendia/scale-your-partner-ecosystem-with-vendia-share-42dg</link>
      <guid>https://dev.to/brianvendia/scale-your-partner-ecosystem-with-vendia-share-42dg</guid>
      <description>&lt;p&gt;&lt;a href="https://www.vendia.net/product?utm_source=Devto&amp;amp;utm_id=Feature"&gt;Vendia Share&lt;/a&gt; simplifies the process of sharing data in real-time between organizations in a controlled, secure, and ledgered manner. Traditionally, sharing data in this manner is tough. There are several challenges that come to mind.&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenges
&lt;/h1&gt;

&lt;p&gt;Maintaining a single source of truth between organizations can be difficult. Databases are a popular information store, but securely sharing data from them with other organizations involves a number of compliance, security, and networking considerations that often mean slow action. Some organizations choose to share critical data with partners via spreadsheets. Using this method presents its own set of challenges. It's not apparent which spreadsheet is the latest and most complete source of truth.&lt;/p&gt;

&lt;p&gt;Vendia Share helps you solve this problem by provisioning a node for each organization that you wish to share data with. Each node provides a consistent view of the data that is shared with other parties, and each node has its own API endpoint dedicated to the organization that needs to securely access the data.&lt;/p&gt;

&lt;p&gt;Centralized approaches to data sharing often result in disjointed authentication (AuthN) and authorization (AuthZ). The central organization will likely have a preference for how partners will log in to access data. It will also likely have existing tooling and mechanisms in place to support users. However, partners in the data network may have different means of authenticating and managing users. Vendia Share is flexible enough to allow each participant in a Uni to configure their own authorization type.&lt;/p&gt;

&lt;p&gt;Onboarding new participants to a partner data network historically has been difficult. Often technical teams need to update topologies and networks for each new addition. The steps involved to bring in a new partner can take days if not months. Vendia Share reduces the time to minutes and does without the support of highly valuable engineers, as you will see in this post.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started with Partner Onboarding
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Creating Vendia Share Accounts
&lt;/h2&gt;

&lt;p&gt;Vendia customers share data using a Vendia Share Universal Application (or "Uni" for short). Each participant in a Uni has a dedicated node for reading and writing data. We will simulate two companies sharing data by using two Vendia Share accounts. If you are not familiar with how to create a Vendia Share account, please consult our &lt;a href="https://www.vendia.net/blog/getting-started-with-vendia-share#creating-an-account"&gt;Getting Started&lt;/a&gt; documentation. We will refer to these accounts as &lt;strong&gt;Account 1&lt;/strong&gt; and &lt;strong&gt;Account 2&lt;/strong&gt;. You will create your Uni using &lt;strong&gt;Account 1&lt;/strong&gt;. &lt;strong&gt;Account 2&lt;/strong&gt; will be invited to join the Uni and create its own Vendia Share node. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The example in the blog will use two separate Vendia Share accounts associated with the same email account. I've used the &lt;a href="https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html"&gt;plus ("+") sign&lt;/a&gt; to associate two Vendia Share users with the same email account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Uni
&lt;/h2&gt;

&lt;p&gt;For the purposes of this walkthrough, we will use the &lt;a href="https://www.vendia.net/docs/share/quickstart/simple-product-catalog"&gt;Product Catalog&lt;/a&gt; from our Quick Starts. Once you've created a Uni using &lt;strong&gt;Account 1&lt;/strong&gt;, feel free to proceed with the remainder of the steps in this blog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The commands below assume a Uni name of &lt;code&gt;test-uni-management&lt;/code&gt;. Adjust commands below that use the Uni name to match the one you used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inviting Your Partner
&lt;/h2&gt;

&lt;p&gt;Now that the Uni is up and running, you will invite &lt;strong&gt;Account 2&lt;/strong&gt; to the Uni. You can do this either with the Vendia Share web app or the Share CLI. For the purpose of this blog, you'll use the CLI syntax. My &lt;strong&gt;Account 1&lt;/strong&gt; e-mail address format is &lt;code&gt;brian+account1@vendia.net&lt;/code&gt; and my &lt;strong&gt;Account 2&lt;/strong&gt; e-mail address is &lt;code&gt;brian+account2@vendia.net&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Vendia Share features RBAC support for controlling who has access to your Uni - we will be posting a more detailed blog of how that capability works in a future blog post. One of the RBAC features is the ability to invite another Vendia user to create a node and join your Uni. We accomplish this task with the following command.&lt;/p&gt;

&lt;p&gt;First, ensure you have authenticated to the Share CLI using the &lt;code&gt;share login&lt;/code&gt; command. Be sure to use the Vendia account associated with &lt;strong&gt;Account 1&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;% share login
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Enter your Vendia email address
Enter your email: brian+account1@vendia.net

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Enter your password &lt;span class="k"&gt;for &lt;/span&gt;brian+account1@vendia.net
Password: &lt;span class="k"&gt;*********&lt;/span&gt;

✔  Logged &lt;span class="k"&gt;in &lt;/span&gt;as brian+account1@vendia.net

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have authenticated successfully, use the &lt;code&gt;share uni invite&lt;/code&gt; command to begin the invitation process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;share uni invite &lt;span class="nt"&gt;--uni&lt;/span&gt; test-uni-management &lt;span class="nt"&gt;--user&lt;/span&gt; brian+account2@vendia.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The name of my Uni is &lt;code&gt;test-uni-management&lt;/code&gt;. Be sure to adjust the command and use the name of the Uni you created.&lt;/p&gt;

&lt;p&gt;You will see output that is similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Invite Successful

User brian+account2@vendia.net successfully invited to Uni test-uni-management
brian+account2@vendia.net has been sent an email invite link.

For brian+account2@vendia.net to join, they must:
 - click email link
 - OR join by running the share uni join CLI command with the token below

Invite token:    12345678-abcd-1234-abcd-123456789012
Expires on:      2022-01-30T02:26:24.872624
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will export that invite token as an environment variable (be sure to substitute your invite token in the syntax that follows)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This command will save the Invite token for later use by **Account 2**
export VENDIA_TOKEN=12345678-abcd-1234-abcd-123456789012
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;strong&gt;Account 2&lt;/strong&gt; email address should have a message from Vendia, inviting you to join the Uni created by &lt;strong&gt;Account 1&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Joining the Uni with Account 2
&lt;/h2&gt;

&lt;p&gt;You can use the Vendia Share web app when logged in as &lt;strong&gt;Account 2&lt;/strong&gt; to complete the Uni join process. You can click on the link included in the invitation email. However, I will show you how to use the Share CLI to complete the same task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Make sure you've created the &lt;code&gt;VENDIA_TOKEN&lt;/code&gt; variable from the &lt;code&gt;share uni invite&lt;/code&gt; output.&lt;/p&gt;

&lt;p&gt;You will need to log out using &lt;code&gt;share logout&lt;/code&gt; and log back in with &lt;code&gt;share login&lt;/code&gt;. Specify the email address and password associated with &lt;strong&gt;Account 2&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;% share &lt;span class="nb"&gt;logout
&lt;/span&gt;You are now logged out of brian+account1@vendia.net

Run &lt;span class="s2"&gt;"share login"&lt;/span&gt; to log back &lt;span class="k"&gt;in&lt;/span&gt;
% share login
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Enter your Vendia email address
Enter your email: brian+account2@vendia.net

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Enter your password &lt;span class="k"&gt;for &lt;/span&gt;brian+account2@vendia.net
Password: &lt;span class="k"&gt;*********&lt;/span&gt;

✔  Logged &lt;span class="k"&gt;in &lt;/span&gt;as brian+account2@vendia.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you're authenticated as &lt;strong&gt;Account 2&lt;/strong&gt; you can run &lt;code&gt;share uni join&lt;/code&gt; to accept the invitation and specify your node's settings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;share uni join --uni test-uni-management \
--token $VENDIA_TOKEN \
--config '{"name":"account2-node","userId":"brian+account2@vendia.net", "region":"us-west-2", "settings": {"apiSettings": {"auth": {"authorizerType": "API_KEY"}}}}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see output similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;addition of new node account2-node &lt;span class="k"&gt;in &lt;/span&gt;uni addition of new node account2-node &lt;span class="k"&gt;in &lt;/span&gt;uni test-uni-management.unis.vendia.net is now &lt;span class="k"&gt;in &lt;/span&gt;progress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The name of my Uni is &lt;code&gt;test-uni-management&lt;/code&gt;. Be sure to adjust the command and use the name of the Uni you created.&lt;/p&gt;

&lt;p&gt;You can observe the deployment process of the Node for &lt;strong&gt;Account 2&lt;/strong&gt; by running the &lt;code&gt;share get&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;share get &lt;span class="nt"&gt;--uni&lt;/span&gt; test-uni-management
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see output similar to the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Getting test-uni-management info...
┌─────────────────────┐
│   Uni Information   │
└─────────────────────┘
Uni Name:    test-uni-management.unis.vendia.net
Uni Status:  ADDING
Node Count:  2
Nodes Info:
├─ ⬢ ProductCatalog
│  ├─ name: ProductCatalog
│  ├─ status: RUNNING
│  └─ resources:
└─ ⬢ account2-node
   ├─ name: account2-node
   ├─ status: DEPLOYING
   └─ resources:

To display schema &amp;amp; initial state, use the &lt;span class="nt"&gt;--json&lt;/span&gt; flag. Example: &lt;span class="s2"&gt;"share get test-uni-management.unis.vendia.net --json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The node creation process will take a few minutes. When the node creation is complete, feel free to step through the &lt;a href="https://www.vendia.net/docs/share/quickstart/simple-product-catalog#step-3---query-catalog-data"&gt;Product Catalog Quick Start&lt;/a&gt; and observe how data updates can be viewed by both participants in the Uni.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup
&lt;/h2&gt;

&lt;p&gt;Once you are finished running the example you can delete the Uni. You will run the &lt;code&gt;share uni delete&lt;/code&gt; command as &lt;strong&gt;Account 1&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;share uni delete &lt;span class="nt"&gt;--uni&lt;/span&gt; test-uni-management
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;WARNING:&lt;/strong&gt; Deleting a Uni is destructive and will remove all of its underlying data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The name of my Uni is &lt;code&gt;test-uni-management&lt;/code&gt;. Be sure to adjust the command and use the name of the Uni you created.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;In this blog post, you created a Uni and added a second participant in minutes, allowing multiple partners to quickly and securely share data in real-time. Once you have completed the walkthrough, feel free to share your results on social media and tag Vendia (Twitter: &lt;a href="https://twitter.com/VendiaHQ"&gt;@VendiaHQ&lt;/a&gt;, Linkedin: &lt;a href="https://www.linkedin.com/company/vendiahq/"&gt;Vendia&lt;/a&gt;) so that we can see what you built!&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>graphql</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Why We Combined GraphQL and a Serverless Distributed Ledger</title>
      <dc:creator>Brian McNamara</dc:creator>
      <pubDate>Wed, 19 Jan 2022 22:30:00 +0000</pubDate>
      <link>https://dev.to/brianvendia/why-we-combined-graphql-and-a-serverless-distributed-ledger-1bm6</link>
      <guid>https://dev.to/brianvendia/why-we-combined-graphql-and-a-serverless-distributed-ledger-1bm6</guid>
      <description>&lt;p&gt;&lt;a href="https://www.vendia.net/product?utm_source=Devto&amp;amp;utm_id=Feature"&gt;Vendia Share&lt;/a&gt; is a SaaS offering that takes away the toil required to share data with partners in a controlled, secure, and ledgered manner. We do this by allowing customers to create Universal Applications (Unis) and inviting their partners to participate.&lt;/p&gt;

&lt;p&gt;Each participant in a Uni has cloud resources created on their behalf. One of the resources is a managed, scalable, resilient, and secure GraphQL API that allows partners to create web, mobile, and backend applications to read data from and write data to a Uni.&lt;/p&gt;

&lt;p&gt;While technical readers may be familiar with the concept of a REST API, there may be some among you who are not as familiar with GraphQL. For those of you with GraphQL experience, Vendia Share does take a non-traditional approach in some areas as well.  In this post, we'll dive a bit deeper and explore GraphQL and look at why Vendia selected GraphQL as its primary interface. Through this post, you'll learn more about GraphQL and how it can improve your development experience with Vendia Share.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is GraphQL?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://engineering.fb.com/2015/09/14/core-data/graphql-a-data-query-language/"&gt;GraphQL was created by Meta / Facebook in 2012&lt;/a&gt; as a way to solve problems encountered when rebuilding their native mobile applications. The team was frustrated with the differences between the data they wanted to use in their applications and the server queries that were required and was challenged to pull in data from many disparate sources. They saw the importance of seeing data not just as a resource but as a graph.&lt;/p&gt;

&lt;p&gt;GraphQL is a query language for APIs and a runtime for fulfilling those queries with existing data. GraphQL is a &lt;a href="https://spec.graphql.org/"&gt;open specification&lt;/a&gt;; it is not controlled or managed by a single vendor. GraphQL clients and servers can be written in a &lt;a href="https://graphql.org/code/"&gt;number of programming languages&lt;/a&gt;. There is no requirement to use particular data stores to persist data.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are Some Benefits of GraphQL?
&lt;/h1&gt;

&lt;p&gt;There are several notable benefits of using GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Precision
&lt;/h2&gt;

&lt;p&gt;GraphQL allows clients to request exactly what they need and nothing more. This means that developers don't have to worry about over-fetching and under-fetching data. It's not uncommon to experience these issues when using other API strategies like REST. Eliminating these minimizes the number of network requests and client memory use required to satisfy an application's needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Many Resources in One Request
&lt;/h2&gt;

&lt;p&gt;GraphQL allows applications to get all the data they need - even if they are different types - in a single request. This means fewer requests and, ultimately, more responsive applications for end users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Strong Typing
&lt;/h2&gt;

&lt;p&gt;GraphQL is strongly typed. This means that developers can know what is required by a GraphQL server to satisfy a request without having to be planning for type mismatches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subscriptions
&lt;/h2&gt;

&lt;p&gt;Subscriptions provide a mechanism for fetching data from a GraphQL server over a long-lived connection (usually via WebSocket). They are a handy mechanism for providing updates to GraphQL clients when new objects are created or existing objects have updates made.&lt;/p&gt;

&lt;h1&gt;
  
  
  Vendia Share + GraphQL
&lt;/h1&gt;

&lt;p&gt;Let's dive a bit deeper into Vendia Share's usage of GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vendia Share Foundations
&lt;/h2&gt;

&lt;p&gt;Unis are created in part by a data model. This model is expressed through the JSON Schema Draft-07 standard and is used by the Vendia Share service to create GraphQL APIs for each participant. The API allows developers to run queries and mutations to interact with their data model. Because these capabilities are automatically created by Vendia Share, developers don't need to be concerned about developing and maintaining them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Did Vendia Pick GraphQL?
&lt;/h1&gt;

&lt;p&gt;We had to make a choice regarding API standards in our very early days. It came down to selecting either REST or GraphQL. Spoiler alert - we chose GraphQL. Here are a few specific dimensions we considered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;It's not easy to build out functionality to allow developers to selectively choose data to return just the data they want via REST. Yes, it can be done. However, the problems of over-fetching and under-fetching remain - they just shift to the API provider. We made a conscious decision early to use GraphQL so that we would not be incurring additional compute or data transfer hits resulting from over- and under-fetching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subscriptions are Easier
&lt;/h2&gt;

&lt;p&gt;REST does not have a great pattern for asynchronous, server-side updates to clients other than polling, rolling-your-own, or using HTTP/2 throughout. We see GraphQL subscription operations as a better method to receive these updates. Applications can use WebSockets to detect when changes have been made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer Friendly
&lt;/h2&gt;

&lt;p&gt;There are a number of programming language clients and frameworks that support GraphQL. We would not be introducing additional burden on developers of our platform. In addition, developers have the built-in ability to introspect to learn how to read from and write data to their Uni.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accommodating Changes to the Uni Data Model
&lt;/h2&gt;

&lt;p&gt;We recognized the shape of data stored in a Uni would likely evolve over time as business needs changed. We felt it would be easier to accommodate these changes using GraphQL in an automated manner that simply worked.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;In my experience, having context affords better understanding. We felt it important to understand not just what GraphQL is - although it is super important when working with Vendia Share - but why we've made the decision to choose GraphQL for our API strategy in the first place. We've created some &lt;a href="https://github.com/vendia/examples/tree/main/features/share/graphql"&gt;code examples&lt;/a&gt; that demonstrate how to interact with Vendia-generated GraphQL APIs using several programming languages. Stay tuned for an upcoming post where we'll dive a bit deeper into how you can take advantage of some Vendia-specific GraphQL goodies like transactions, conditional operations, and examining GraphQL operations that have been committed to your Uni.&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>graphql</category>
      <category>blockchain</category>
      <category>database</category>
    </item>
  </channel>
</rss>
