<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 
        <base href="https://issues.jboss.org"> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt" bgcolor="#f5f5f5"> 
            <!-- header here --> 
            <tbody>
                <tr> 
                    <td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
                        <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                            <tbody>
                                <tr> 
                                    <td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="https://static.jboss.org/developer/gravatar/84386cc35cecf75d5eed5c9142e5f154?d=mm&amp;s=48" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td> 
                                    <td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="davidmartin" id="email_davidmartin" href="https://issues.jboss.org/secure/ViewProfile.jspa?name=davidmartin" style="color:#3b73af;; color: #3b73af; text-decoration: none">David Martin</a> <strong>updated</strong> an issue </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
                        <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate"> 
                            <tbody>
                                <tr> 
                                    <!-- there needs to be content in the cell for it to render in some clients --> 
                                    <td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="page-title-pattern-first-line " style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="https://issues.jboss.org/browse/AEROGEAR" style="color: #3b73af; text-decoration: none">AeroGear</a> / <a href="https://issues.jboss.org/browse/AEROGEAR-2681" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-fa6ca221-d2a7-424d-a94e-a7b37e0a45ef" height="16" width="16" border="0" align="absmiddle" alt="Epic" style="vertical-align: text-bottom"></a> <a href="https://issues.jboss.org/browse/AEROGEAR-2681" style="color: #3b73af; text-decoration: none">AEROGEAR-2681</a> </td> 
                                                </tr> 
                                                <tr> 
                                                    <td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://issues.jboss.org/browse/AEROGEAR-2681" style="color: #3b73af; text-decoration: none">Investigate and spike for sync.next architecture</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  wrapper-special-margin" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 10px; padding-bottom: 5px" bgcolor="#ffffff"> 
                                        <table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Change By:</th> 
                                                    <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="davidmartin" id="email_davidmartin" href="https://issues.jboss.org/secure/ViewProfile.jspa?name=davidmartin" style="color:#3b73af;; color: #3b73af; text-decoration: none">David Martin</a> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  issue-description-container" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 5px; padding-bottom: 10px" bgcolor="#ffffff"> 
                                        <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> <span class="diffaddedchars" style="background-color:#ddfade;"><br>h2. Data Sync Server - Chat Proof of Concept<br><br>h3. Phase 1 - Initial End to End<br><br>h4. Technical Goals<br><br></span> <span class="diffcontext">*</span> <span class="diffaddedchars" style="background-color:#ddfade;"> get a working end to end graphql client &amp; server, storing data in a real database<br>* become familiar with graphql concepts such as 'schema', 'queries', 'mutations', 'subscriptions'<br>* understand how a resolver integrates between a graphql request and a database<br><br>h4. Server<br><br>* The server has a hardcoded graphql schema file with a single entity 'Messages'<br>** id (some unique server generated id)<br>** content (text content of a message)<br>** user_id (unique user id, can be the device client id initially)<br>** timestamp (server timestamp for when the message was saved to the server)<br>* The schema file has queries defined for:<br>** create Message<br>** list Message<br>* Queries have hardcoded resolver implementations for postgreSQL<br><br>h4. Client<br><br>* The Android showcase app has a new menu item, 'Chat'<br>* The 'Chat' screen shows a list view of all messages, ordered by timestamp, and the user_id beside each message<br>* The screen also has a text input and 'Send' button at the bottom, which creates a new 'Message'<br>** a new 'Message' has the following fields set by the client:<br>*** content<br>*** user_id<br>* The 'Message' model, and associated 'create' and 'list' queries will be generated using the apollo gradle plugin, based on the graphql schema file<br>* The app has a 'subscription' to the 'Message' create query. When a new 'Message' is created by any app user, connected apps will be notified, and their UI updated with the latest messages on the 'Chat' screen.<br><br>h3. Phase 2 - Dynamic Resolvers<br><br>h4. Technical Goals<br><br>* develop generic postgreSQL resolver(s) that don't require schema knowledge ahead of time for 'create' and 'list' queries.<br>* have an API for setting what shema the server should use<br><br>h4. Server<br><br>* Add a new API to the server that allows setting the schema from a file at runtime<br>** the API should accept a graphql schema file, with entities, queries etc.. defined<br>** only queries with certain names should be accepted at this time i.e. create_&lt;entity&gt; or list_&lt;entity&gt; e.g. create_Message, list_Message. This is to facilitate the ability to dynamically resolve data<br>* Based on defined queries in the schema file set via the API, the server should resolve them dynamically against postgreSQL.<br><br>h4. Client<br><br>* no changes<br><br>*NOTE: 'update' is actually a 'mutation', but for simplicity its referred to as a 'query' here.*<br><br>h3. Phase 3 - Offline updates<br><br>h4. Technical Goals<br><br>* Develop a way for applying updates on the Client when its offline, and have them be applied on the server when online again.<br><br>h4. Server<br><br>* potentially no changes<br><br>h4. Client<br><br>* Modify the Apollo GraphQL Client to add a mutation strategy for applying updates in the App first, to a local db, in cases where the App is not connected to the server<br>* Updates should be considered applied from the clients point of view as soon as they are applied locally<br>* Detect when the App is reconnected to the server, and send the locally applied updates to the server. <br>** This needs a lot of though on how best to manage the merging of new server changes with local db changes. e.g. should they be merged on the clients local db, or should they be nuked/overwritten with the latest changes from the server? Is a change/transaction log needed to be kept/replicated?<br><br><br><br><br>*Previous description content below*<br><br>*</span> <span class="diffcontext"> Research on the current offering by other vendors:<br>** Firebase<br>** Amazon AppSync<br>** Apollo Graphql<br>** DeepStream.io<br><br>We want to find out:<br>* high level architecture of their products<br>* how data gets synced<br>* offline support and how it is implemented<br>* query support (done on the client or the server)<br>* what type of data store they are using on clients<br>* authentication &amp; authorisation support and how it's implemented<br>* integrating with other enterprise backend datastore and how they are implemented<br>* server-to-server sync support<br><br>We have done this for couchbase mobile (https://issues.jboss.org/browse/RHMAP-19616?jql=text%20~%20%22couchbase%20db%22). We can use it as an example.<br><br><br>Branch of Android Showcase App for graphql spikes<br>* https://github.com/aerogear/android-showcase-template/tree/graphql-spike<br><br>Branch of a graphql server for server spikes<br>* https://github.com/david-martin/starwars-server/tree/notes-spike<br><br><br>Some open questions<br>* Can you link directly to a specific Grafana dashboard (e.g. for linking to grafana from openshift ui)?<br>* Is there a default prometheus exporter for graphql?<br>* Can metadata be associated with a schema? (e.g. so you could define a role users should have to access an entity)</span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                                        <table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                                            <tbody>
                                                                <tr> 
                                                                    <td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://issues.jboss.org/browse/AEROGEAR-2681#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-5f9b0314-838f-4259-a348-1f2923d07d13" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td> 
                                                                    <td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://issues.jboss.org/browse/AEROGEAR-2681#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td> 
                                                                </tr> 
                                                            </tbody>
                                                        </table> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <!-- there needs to be content in the cell for it to render in some clients --> 
                                <tr> 
                                    <td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
                        <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                            <tbody>
                                <tr> 
                                    <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian JIRA <span id="footer-build-information">(v7.5.0#75005-<span title="fd8c849d4e278dd8bbaccc61e707a716ad697024" data-commit-id="fd8c849d4e278dd8bbaccc61e707a716ad697024}">sha1:fd8c849</span>)</span> </td> 
                                    <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                        <table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-2ef3c952-2a24-4c35-be03-9b51a7508e25" alt="Atlassian logo" title="Atlassian logo" width="169" height="36" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>   
    </body>
</html>