<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Building Goalwise - Medium]]></title>
        <description><![CDATA[Stories on how we are doing product, design, customer success and tech at Goalwise - Medium]]></description>
        <link>https://medium.com/building-goalwise?source=rss----3a97be13ec3c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Building Goalwise - Medium</title>
            <link>https://medium.com/building-goalwise?source=rss----3a97be13ec3c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:01:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/building-goalwise" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to implement ModSecurity WAF with NGINX]]></title>
            <link>https://medium.com/building-goalwise/how-to-implement-modsecurity-waf-with-nginx-15fdd42fa3?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/15fdd42fa3</guid>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[modsecurity]]></category>
            <category><![CDATA[web-application-firewall]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 15:39:02 GMT</pubDate>
            <atom:updated>2019-04-15T08:33:50.821Z</atom:updated>
            <content:encoded><![CDATA[<p>Almost a third of world’s websites use NGINX web server and this number is growing as we speak. The reason more and more organisations are choosing NGINX as the go to web server is simple. It delivers good performance and is lightweight but robust at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uPpnnhBPVhn9YakX" /><figcaption>Photo by <a href="https://unsplash.com/@aligns?utm_source=medium&amp;utm_medium=referral">Jordan Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Web Application Firewall (WAF)</h4><p>What is a web application firewall and how is it different from a network firewall? A network firewall monitors and controls incoming and outgoing network traffic based on pre-determined rules. Usually a request that is a malicious request or an attack is going to look like proper traffic to a network firewall. There are next-gen network firewalls that are application aware but they come as part of the infrastructure stack and not the application stack. A web application firewall is going to protect against application level attacks as part of the application stack. As the application is developed and tested, the WAF policies and rules are going to be part of the process and is going to get deployed with the stack. WAF as part of Layer 7 or HTTP Layer security is going to inspect the HTTP traffic and depending on the rules is going to alert, log or block the request.</p><h4>When to use WAF?</h4><ol><li>Compliance requirement.</li><li>Buffer for development team. If there are any vulnerabilities found they can be mitigated at the WAF level immediately while the development team can change the code and patch the issue.</li></ol><h4>What is ModSecurity?</h4><p>This was developed back in 2002 as an Apache module by a sole author Ivan Ristić. Around 2012 the licensing for this module was changed and this allowed modules to be developed for servers like NGINX and IIS. As ModSecurity module has been around for a while now there has been different versions released for it. The latest version (at the time of writing this blog) v3 has considerable performance boost compared the older version. It is also available as dynamic module which means you don’t need to compile NGINX again with this module but just the module can be compiled and plugged into the web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*Y2e-23K7JJCecu9lsQasew.png" /><figcaption>Major difference in ModSecurity + Nginx architecture between v3 and earlier versions</figcaption></figure><h4>Installing ModSecurity v3</h4><p>We will be delving into the details of installing this module on AWS EC2 with Amazon Linux. This blog assumes that you already have NGINX installed which is up and running and you have a basic knowledge of NGINX configuration files.</p><p><strong>Note:</strong> NGINX version 1.11.5 or later is required.</p><h4>Prerequisite Packages</h4><p>If you had compiled NGINX from source earlier on the server it is possible that all the packages are already present on the server.</p><pre>yum install gcc make automake curl curl-devel httpd-devel autoconf libtool pcre pcre-devel libxml2 libxml2-devel</pre><h4>Compile ModSecurity v3 module from source</h4><p>There are two parts to code compilation. Compilation of ModSecurity code as a dynamic module for NGINX. Compilation of the connector which will link the dynamic module to the web server running. Because of the modular nature of ModSecurity project to plug it into different servers you just need to compile the corresponding connector for that server. There are separate connectors available for NGINX, Apache and IIS that I know of.</p><p>Compiling ModSecurity code</p><pre>$ git clone --depth 1 -b v3/master --single-branch <a href="https://github.com/SpiderLabs/ModSecurity">https://github.com/SpiderLabs/ModSecurity</a></pre><pre>$ cd ModSecurity <br>$ git submodule init <br>$ git submodule update <br>$ ./build.sh <br>$ ./configure <br>$ make <br>$ make install</pre><pre><em>During the process of installation it is safe to ignore the below message.</em><br>fatal: No names found, cannot describe anything.</pre><pre>Depending on the machine the compilation should be complete in about 12-15 mins.</pre><p>Compile ModSecurity connector for NGINX as a dynamic module</p><pre>$ git clone --depth 1 <a href="https://github.com/SpiderLabs/ModSecurity-nginx.git">https://github.com/SpiderLabs/ModSecurity-nginx.git</a></pre><p>Though only dynamic module is going to be compile complete source code of Nginx is required to compile the modules.</p><p>Determine which version of Nginx is installed and the source code for that specific version from the official site.</p><pre>$ nginx -v<br>nginx version: nginx/1.14.1</pre><pre>Get the source code<br>$ wget <a href="http://nginx.org/download/nginx-1.14.1.tar.gz">http://nginx.org/download/nginx-1.14.1.tar.gz</a><br>$ tar -xvzmf <a href="http://nginx.org/download/nginx-1.14.1.tar.gz">nginx-1.14.1.tar.gz</a></pre><p>Now that we have all the code lets compile the modules. There is a catch to compiling the module. The modules should be compiled with the same params as the nginx on your server was compiled. You will be able to list all the original configure arguments using nginx -V command.</p><pre>$ cd <a href="http://nginx.org/download/nginx-1.14.1.tar.gz">nginx-1.14.1.tar.gz</a><br>$ ./configure <em>&lt;original configuration here&gt;</em> --add-dynamic-module=../ModSecurity-nginx<br>$ make modules <br>$ cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules</pre><p>Couple of things to note in the above compilation.</p><ul><li>You can remove the --with-xxxxx-module=dynamic options from the original configuration if the dependencies are not available.</li><li>When copying the shared object (.so) file you need to make sure you have copied it to the correct folder on your server. The path mentioned in the above command is general location but this may change based on the server configuration.</li></ul><h4>Load ModSecurity dynamic module in Nginx</h4><p>Add the following load_module directive the top-level configuration file at <strong>/etc/nginx/nginx.conf </strong>file. It instructs NGINX to load ModSecurity dynamic module while loading the configurations.</p><pre>load_module modules/ngx_http_modsecurity_module.so;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*Sx3K9dtm8Cy9mYWJMc5jgA.png" /><figcaption>Placing dynamic module before any section starts in the configuration.</figcaption></figure><p>If while loading the module you come across an error which is along the lines “Failed to load locate the unicode map file from: unicode.mapping” you can follow this <a href="https://github.com/SpiderLabs/ModSecurity/issues/1941">thread</a>. What basically you need to do is copy <a href="https://github.com/SpiderLabs/ModSecurity/blob/49495f1925a14f74f93cb0ef01172e5abc3e4c55/unicode.mapping">this file</a> at <strong>/etc/nginx/modsec/unicode.mapping</strong></p><h4>Configure ModSecurity module</h4><p>It is cleaner to have a separate folder where all the modSecurity configuration files can be saved. Here we will be using a standard recommendation for configuration file from TrustWave SpiderLabs the current maintainer of ModSecurity project.</p><pre>$ mkdir /etc/nginx/modsec <br>$ wget -P /etc/nginx/modsec/ https://raw.githubusercontent.com/SpiderLabs/ModSecurity/v3/master/modsecurity.conf-recommended <br>$ mv /etc/nginx/modsec/modsecurity.conf-recommended /etc/nginx/modsec/modsecurity.conf</pre><p>By default the configuration in this file is set to <strong>DetectionOnly </strong>which means the malicious requests will be detected and logged but will not be dropped. Change the directive to actively drop requests. I would recommend doing this on a staging instance and testing the application before making it live on any production instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*DwHA52GEkrbsq6c-carXSw.png" /><figcaption>Configuring the engine to actively drop malicious request.</figcaption></figure><p>For purpose of this blog we will configure couple of simple rule. Put the following text in <strong>/etc/nginx/modsec/main.conf</strong>:</p><pre>Include &quot;/etc/nginx/modsec/modsecurity.conf&quot;</pre><pre># Basic test rule</pre><pre>SecRule ARGS:blogtest &quot;@contains test&quot; &quot;id:1111,deny,status:403&quot;</pre><pre>SecRule REQUEST_URI &quot;@beginsWith /admin&quot; &quot;phase:2,t:lowercase,id:2222,deny,msg:&#39;block admin&#39;&quot;</pre><p><em>Rule 1</em> says if there is a query parameter named “blogtest” with a value “test” in it drop the request.</p><p><em>Rule 2</em> says if there is a URI which begins with admin drop the request.</p><p>In production environment you would probably want to have better rules which actually prevent malicious requests. <a href="https://www.nginx.com/resources/admin-guide/nginx-plus-modsecurity-waf-owasp-crs/">OWASP Core Rule Set</a> is probably a good place to begin.</p><h4>Enabling ModSecurity Module</h4><p>Till now all we have done is install the module, ask NGINX to load it and set up some configuration for the module. This does not mean that the servers that you have configured will now start making use of the configurations. We need to enable this module for the hosts that we want covered by adding the following two directives:</p><pre>server {<br>    # Other server directives here<br>    modsecurity on;<br>    modsecurity_rules_file /etc/nginx/modsec/main.conf;<br>}</pre><p>It is not necessary to enable this module for all locations on the server. You can also have a configuration which says only enable on certain paths while not on others. I am not sure why you would want to do that but it actually depends on your use case.</p><pre>server {<br>    listen 443;<br>    # modsecurity on; # All traffic over 443 have ModSec on<br> <br>    location / {<br>       proxy_pass <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a>;<br>       modsecurity off; # ModSec off by default<br>    }</pre><pre>    location /waf {<br>       proxy_pass <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a>;<br>       modsecurity on;<br>       modsecurity_rules_file /etc/nginx/modsec/main.conf;<br>       error_log /var/log/nginx/waf.log;<br>    }<br>}</pre><p><strong>Testing the configuration</strong></p><p>Let’s run some curl requests to test our simple rules created earlier.</p><pre>$ curl <a href="http://localhost/adminaccess">http://localhost/adminaccess</a><br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;403 Forbidden&lt;/title&gt;&lt;/head&gt;<br>&lt;body bgcolor=&quot;white&quot;&gt;<br>&lt;center&gt;&lt;h1&gt;403 Forbidden&lt;/h1&gt;&lt;/center&gt;<br>&lt;hr&gt;&lt;center&gt;nginx/1.14.1&lt;/center&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><pre>$ curl <a href="http://localhost/admin-login">http://localhost/admin-login</a><br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;403 Forbidden&lt;/title&gt;&lt;/head&gt;<br>&lt;body bgcolor=&quot;white&quot;&gt;<br>&lt;center&gt;&lt;h1&gt;403 Forbidden&lt;/h1&gt;&lt;/center&gt;<br>&lt;hr&gt;&lt;center&gt;nginx/1.14.1&lt;/center&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><pre>$ curl <a href="https://localhost/?blogtest=thisistestparam">https://localhost?blogtest=thisistestparam</a><br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;403 Forbidden&lt;/title&gt;&lt;/head&gt;<br>&lt;body bgcolor=&quot;white&quot;&gt;<br>&lt;center&gt;&lt;h1&gt;403 Forbidden&lt;/h1&gt;&lt;/center&gt;<br>&lt;hr&gt;&lt;center&gt;nginx/1.14.1&lt;/center&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZueEEjlxMH-9Sl0yyMnNrQ.png" /><figcaption>The request and the reason it is dropped being logged.</figcaption></figure><h4>Conclusion</h4><p>There is no such thing as enough security. Having security at different layers mitigates the threat to a larger extent than having a single level of security. Web Application Firewalls acts as the last line of defence against a malicious attack. ModSecurity is an open source project which combines seamlessly with NGINX and also has the capability to apply OWASP core rule sets. This makes it a good place to start securing your applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15fdd42fa3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/how-to-implement-modsecurity-waf-with-nginx-15fdd42fa3">How to implement ModSecurity WAF with NGINX</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I saved adding more space to RDS]]></title>
            <link>https://medium.com/building-goalwise/how-i-saved-adding-more-space-to-rds-2286f35bf117?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2286f35bf117</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[rds]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 12:12:25 GMT</pubDate>
            <atom:updated>2019-01-28T12:12:24.866Z</atom:updated>
            <content:encoded><![CDATA[<p>Working at a startup sometimes means coding and releasing projects in very short time under a lot of pressure. As a CTO it is my responsibility to put more thought into the design and make sure the architecture is robust and flexible. As I have always advocated it is more important to put in extra effort thinking over the design than to start coding and think on the fly while doing it.</p><h4>The mistake</h4><p>About 18 months ago there was a project that needed to be completed as soon as possible. We needed to show a copy of all the transactional emails that were being sent to the users on one of our internal dashboards. I was already working on another big project (redeem) for product at the time. So when the developer came with the idea of storing the html content of the email in a database table, without giving much thought to it I approved the project.</p><h4>The problem</h4><p>A couple of weeks back I got an automated email notification from AWS stating there was only 4% of free space remaining on the production database. This took me by surprise because I was not expecting to run low on space on production for another year or so. I started looking for the culprit which was eating up all the space. Surprisingly it was actual production data which was consuming the space. This was unexpected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6q47ngmMwKXYE-Reh73cdw.png" /><figcaption>Free space available on the production database</figcaption></figure><p>Looking further in the table details I found that the table with the maximum size was the one storing the emails. On an average we send out about 1200 transactional emails per day. Over a period of a year and half this table had become a mammoth compared to the other tables in the database. How did this happen. Turns out what started as a simple transaction email store was now storing every email that was being sent from the system. Unfortunately I do not have the exact screenshot showing the size of the table from the time of the incident but it looked something as below.</p><pre><strong>SELECT<br>   </strong>table_schema <strong>as </strong>&quot;Database Name&quot;, <strong>table_name</strong>,<br>   <em>Sum</em>(data_length + index_length) / 1024 / 1024 &quot;Used Space in MB&quot;,<br>   <em>Sum</em>(data_free) / 1024 / 1024 &quot;Free Space in MB&quot;,<br>   <em>Sum</em>(data_length + index_length + data_free) / 1024 / 1024 &quot;Total Space in MB&quot;<br> <strong>FROM </strong>information_schema.tables<br> <strong>GROUP BY </strong>table_schema, <strong>table_name<br> ORDER BY </strong><em>SUM</em>(data_length + index_length + data_free) <strong>DESC limit </strong>1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*UyJwPKJxONIdiIXNwrv75w.png" /><figcaption>Size of the table was approximately 10 GB</figcaption></figure><h4>The fix</h4><p>The easiest solution would be to add more space to the database but this would be adding band-aid to a bleeding cut and not stitching it up. The rate at which the customer base is growing I would end up adding more and more space to the database every few months. The table was almost growing at about 750mb every 2 weeks.</p><p>A better solution would be to:</p><ul><li>Stop storing the email content in the database and start storing it in html files in S3 and store the link to the file in the table.</li><li>Migrate the existing data in the table to S3.</li><li>Update the internal dashboard to handle both type of data stored in the column (link to file and also the actual html so that it does not break during the transition)</li></ul><p>Thanks to some quick coding from <a href="https://medium.com/u/c8726ae9450e">Harpal Singh</a> this was all done in couple of days.</p><p>Now it was time to optimise the table and release the allocated space.</p><pre>OPTIMIZE TABLE &lt;table name&gt;;</pre><p>I was hoping this would solve the issue but the command resulted in error optimize, error, Temporary file write failure. This meant I would actually have to add space to the database in order to release it. On talking to the AWS support they suggested to add the same amount of space as the size of the table. Well I thought great I will add some space, run the command and then reduce the size of the database. So I added about 10 GB of space and ran the command. It worked great and all I needed to do was to now reduce the size of the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xL_4GNK70ZZzr3V-VCmTLQ.png" /><figcaption>Total free space after successful table optimsation.</figcaption></figure><h4>The bummer</h4><p>Turns out increasing the size of AWS RDS is easy to achieve but the same is not true for reducing the size even though the entire database size is significantly smaller than the total free space available. This is what the customer care suggested as a workaround to achieve what I was looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bnHOJtHnoQUBAudKk4G1Q.png" /></figure><p>I however did not follow these steps as a week later I need to migrate all AWS services to a different region. I will talk more about the migration in a later blog. Followed the steps outlined in the support ticket in the new region and finally got the database size as I wanted.</p><h4>Conclusion</h4><ul><li>It is important to think what you are doing and how it is going to affect the overall product in the long run.</li><li>It is better to apply a permanent solution to a problem than go for temporary fixes.</li><li>Karma is a bitch :)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2286f35bf117" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/how-i-saved-adding-more-space-to-rds-2286f35bf117">How I saved adding more space to RDS</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we use Publish-subscribe pattern over Observer pattern]]></title>
            <link>https://medium.com/building-goalwise/why-we-use-publish-subscribe-pattern-over-observer-pattern-a7197b0b3de6?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a7197b0b3de6</guid>
            <category><![CDATA[pub-sub]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[sns]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Fri, 23 Nov 2018 07:10:16 GMT</pubDate>
            <atom:updated>2018-11-23T07:10:16.571Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why we use Publish-Subscribe pattern over Observer pattern</h3><p>Publish-subscribe pattern has been around for sometime now and provides easy scalability and loose coupling. When building a system it is important to have a good design in place to avoid sleepless nights as the system grows. It is important to spend some time thinking over it rather than just jumping in to code.</p><p>Working at a startup time is a luxury that I never have. So when it came to data APIs for frontend I followed the traditional client server pattern. On every request I calculated all the data and sent it out as response. This worked fine in the beginning but as the users and their data increased the API responses started getting slower. This was a red flag and something had to be done before it blew up in my face.</p><p>I started off by breaking up the things that were being done in API calls in two categories:</p><ol><li>Essential — those tasks without which the user cannot proceed</li><li>Background — those tasks which can be run in the background and the user does not have to wait for it to complete.</li></ol><p>Let us consider what happens after a successful payment. Our payment gateway vendor sends a response. User is waiting to see the success screen. At a very basic level the following things are being done:</p><ul><li>Make database updates (essential)</li><li>Perform related calculations (background)</li><li>Send email and SMS notification (background)</li></ul><p>Thankfully all of the APIs catering to the UI on all platforms are written in Node.js so making this change was not a difficult job. Now for all the APIs as soon as the essential tasks are over, a response is returned to the UI and the remaining tasks continue in the background. This worked fine for a while but I knew it had two issues:</p><ul><li>Code was tightly coupled</li><li>This approach would not do well at scale</li></ul><p>However making this change gave me some time to think over a better approach to solving this problem.</p><p>I reviewed the things that needed to be done tech wise at a company level and not just on user actions. <a href="https://www.goalwise.com/">Goalwise</a> being an investment platform needs to do a lot of number crunching at a daily level and most of these calculations depend on the price of investments at the end of each day. Rather than breaking up every API task in essential and background it made more sense to classify events that occur in the company. I began with the simplest and most important business unit:</p><ul><li>Change of transaction status — A customer has made a purchase or a redeem transaction and its status has changed</li></ul><h4>How it works</h4><p>Every investment transaction in Goalwise goes through the following phases in its life cycle:</p><p><em>Initiated State → Intermediate State → End State</em></p><p>On every change of state the publisher (in this case the node API mentioned earlier) after completing the essential tasks publishes a message to AWS-SNS. SNS in turn triggers lambda functions which perform the relevant background tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMNShfG03fuWXSoox_pgnw.png" /><figcaption>Rough representation of transaction handling architecture</figcaption></figure><p>This design has given me room to perform a lot of tasks in the background without consuming the resources serving the data APIs. It has also given me all the flexibility that comes with using lambda.</p><h4>Conclusion</h4><ul><li>Having a long term vision and working towards it is important. I couldn’t allocate all the time in building the current architecture so I broke it up in phases.</li><li>It is important to keep scale in mind when coding.</li><li>Always leave room for enhancements.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7197b0b3de6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/why-we-use-publish-subscribe-pattern-over-observer-pattern-a7197b0b3de6">Why we use Publish-subscribe pattern over Observer pattern</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Being a tech savvy company in an offline industry]]></title>
            <link>https://medium.com/building-goalwise/being-a-tech-savvy-company-in-an-offline-industry-e7bc57e481f0?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/e7bc57e481f0</guid>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[mutual-funds]]></category>
            <category><![CDATA[operations]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Sat, 06 Oct 2018 13:24:36 GMT</pubDate>
            <atom:updated>2018-10-06T13:28:42.427Z</atom:updated>
            <content:encoded><![CDATA[<p>We believe in lean and efficient teams rather than large teams. We talked about this in the previous <a href="https://medium.com/building-goalwise/how-we-moved-to-serverless-architecture-at-goalwise-using-aws-lambda-811aa8e4e799">blog</a> as well and how tech team at <a href="https://www.goalwise.com/">Goalwise</a> is trying to do its part in order to adhere to this philosophy. However this does not just end at one team but is something that every team in the company tries to do. Our operations team is no different.</p><p>Being an online mutual fund distributor there are a lot of things that our back office has to do. Our <a href="https://www.goalwise.com/">site</a> is where the story begins but the operations team drives it home. They are the bridge between what customer wants and the mutual fund industry needs — from the KYC of the customer to the transaction execution and everything in between.</p><p>Currently Goalwise provides its users the following services operationally:</p><ol><li>KYC — one cannot invest in the markets if this is not done.</li><li>Transactions — purchase/redeem of mutual funds</li><li>NCT — Non commercial transactions</li></ol><p>All these services are provided by different vendors and all of them have their own way of doing things. It is difficult to remember every vendor’s specific requirements and even more tedious to train people on them. Thankfully some of the vendors provide API for some if not all of their services that we consume.</p><h4>Know Your Client (KYC)</h4><p>These are done via <a href="https://www.sebi.gov.in/sebi_data/attachdocs/1342781956280.pdf">KYC Registration Agency (KRA)</a>. Initially when the volume was not high this process was done manually. With a growth rate of about 10% per month it became very important to figure out a way to effectively handle the volume. It was a prime candidate for streamlining and it started with revisiting the process of activating an account on Goalwise. We realised that it was a multifold task. Internally we needed a system to to verify all the documents that the user has uploaded and from the KRA we needed an API which can be integrated with our system.</p><p>There are no set of documents which we could find from the KRA explaining how to do the KYC in detail. So we documented all we had learnt over the past year and built our knowledge base. After having a long discussion with our COO <a href="https://medium.com/u/5d0bbeed6016">Savitri Bobde</a>, the flow for the account activation and KYC was finalised. We realised it is more important to invest in process than individual. The tech team created an internal tool which enforced the learnings from the knowledge base and integrated the KYC API. The tool worked great and with a little documentation about the process now anyone in the operations team can use the tool to register a new KYC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WS81_QcnwaU8UYl0" /><figcaption>by <a href="https://unsplash.com/@rawpixel?utm_source=medium&amp;utm_medium=referral">rawpixel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Transactions</h4><p>Transactions are a very critical task. The margin of error for this task is 0. With about thousands of transactions per day (at the time of writing this blog) and only one person allocated to this task, it becomes very important that there is ample support from tech and extremely robust process for uploading the transactions to <strong>Registrar</strong> &amp; <strong>Transfer Agent (RTAs).</strong> Thankfully the RTAs do provide APIs for transaction upload which makes the process faster. For smooth execution of transactions, the operations team goes through the verification checklist which includes the current KYC status of every user whose transactions are to be uploaded. In case there are any issues after the transaction has been uploaded to the RTA, they are resolved immediately after discussing with the concerned person at the corresponding AMC team of the RTA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WVtwbFAGsCuXg1jt" /><figcaption>by <a href="https://unsplash.com/@rawpixel?utm_source=medium&amp;utm_medium=referral">rawpixel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Non Commercial Transactions (NCTs)</h4><p>Starting an investment in mutual funds is not the only thing that any customer would require. With time details of the customers would change, say for example when the customer started investing the bank account was in HDFC but now after a job switch it is ICICI. The bank account registered with the AMCs right now is HDFC and upon redeeming, the money would goto the HDFC account. The customer can raise a request online at the Goalwise portal to change the existing bank account with all the AMCs from HDFC to ICICI.</p><p>At the moment Goalwise provides the following NCTs:</p><ul><li>Change of bank</li><li>Change of address</li><li>Change of nominee</li><li>Change of contact details</li><li>Change of broker</li><li>Consolidation of folios</li></ul><p>All of these services require a lot of form filling and documents. Thankfully these are generated automatically using our internal tools. Creating the filled up forms are the easy part of the process. The difficult part is following up with the every AMC in order to get these application forms processed. The operations team diligently sets remainders and calls up the AMCs to expedite the process for a better user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G30atlLFkHnFL78I" /><figcaption>by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Operations traditionally in the mutual fund industry has been done offline and still most of it is done in a similar fashion. The RTAs, KRAs and AMCs are slowly adopting technology in their processes. Till the time they catch up it is going to be an uphill battle but we will make sure that our operations team is ready for it everyday</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7bc57e481f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/being-a-tech-savvy-company-in-an-offline-industry-e7bc57e481f0">Being a tech savvy company in an offline industry</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I avoided AWS RDS upgrade with SQL tuning]]></title>
            <link>https://medium.com/building-goalwise/how-i-avoided-aws-rds-upgrade-with-sql-tuning-61e12db99a5?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/61e12db99a5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Wed, 03 Oct 2018 04:27:34 GMT</pubDate>
            <atom:updated>2018-11-23T06:58:44.673Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I avoided AWS RDS size upgrade with SQL tuning</h3><p>I work at a fast growing startup where technology plays a crucial role in handling data, documents and enforcing processes. Working at a startup means limited resources. There are projects queued to be finished, enhancements on existing projects.</p><p>While working on a project I tend to think over every aspect of it, from the UI, to backend and until the database structure. The SQLs that are going to run the processing of data that will be done in the backend and finally the display on the UI. Being in the tech field for over a decade there are two things that I have realised:</p><ul><li>Leave room for enhancement.</li><li>Performance is not a separate project.</li></ul><p>There is a particular project in the company which required to gather some data from the database and push it to the CRM (Customer Relationship Management Software) every 15 mins. What I did in this project is a classic example of what not to do while coding. With the growing customer base it was becoming very difficult to manage things and a CRM could prove to be of great help.</p><p>Company got the account created and I got the API credentials and documentation. There were already other things in line for development for the product and this was importing for managing the existing customers. It was a classic time crunch scenario and managed to finish and deploy the CRM update project in half a day.</p><p>I did not give any thought to the fact that it is going to be running every 15 mins. Neither did I leave any space in the code for future enhancements. It was one SQL and one API format function and thats it. Few days later another request to push some more data came and I added some more joins in the SQL. Over the next few months this kept happening and I kept adding more and more to the SQL. Finally it had become a giant mess of joins and sub queries which ran every 15 mins.</p><p>I knew fully well what I had done was wrong and with time as we would get more users this was going to come back to bite me. Since this job was running in the background there was no visible page which would indicate a performance issue. Couple of weeks back the site just started running slow and critical scheduled jobs were not getting completed in time. I checked the load on the site, checked for memory leaks disk spaces everything was fine. Finally while checking the database I found that we had run out of AWS CPU Credit balance and AWS was throttling the CPU usage for the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzF4NKUuZ0SppMN1GDJqeg.png" /><figcaption>RDS CPU credit balance before and after SQL tuning</figcaption></figure><p>I had already enabled slow query logging and upon checking my mistake with the CRM project was here to bite me. The SQL which used to complete execution in half a second a year ago was now taking on an average 150 seconds to complete. SQL explain showed that cardinal product was returning 1.8 million rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KtVxbTpKX-ReykQ5HOq8Pw.png" /><figcaption>Not the exact plan but something on the similar lines</figcaption></figure><p>After a meeting with the product team to understand if the requirements had changed over time for this project it turned out that there was no longer a need for the SQL mess that I had written and simple select query on one table would suffice. Also the CRM update was not needed to be made every 15 mins rather every hour and on demand on certain user actions.</p><p>I quickly changed the SQL and deployed it in production. Within hours of deployment I could see the CPU credit balance filling up and there was no need to upgrade the database. I took a couple of days more to work on other slow running queries and created indexes as required or modified queries where needed to obtain optimal performance. This exercise has been so helpful that we are currently observing the usage of the RDS in order to evaluate if we need to downgrade the class of the hardware.</p><p>Take aways from this whole exercise:</p><ul><li>Product requirements are not always the same and will evolve over time. It is important to revisit the requirements periodically.</li><li>It is not always about adding more code to solve issues, reducing code is just as important.</li><li>Setting up alarms on key metrics.</li><li>Reiterating on the what I had already mentioned earlier in the blog — Performance is not a separate project</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61e12db99a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/how-i-avoided-aws-rds-upgrade-with-sql-tuning-61e12db99a5">How I avoided AWS RDS upgrade with SQL tuning</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we moved to serverless architecture at Goalwise using AWS Lambda]]></title>
            <link>https://medium.com/building-goalwise/how-we-moved-to-serverless-architecture-at-goalwise-using-aws-lambda-811aa8e4e799?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/811aa8e4e799</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws-step-functions]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <dc:creator><![CDATA[Ayush Singh]]></dc:creator>
            <pubDate>Tue, 11 Sep 2018 04:35:31 GMT</pubDate>
            <atom:updated>2018-09-11T04:37:13.270Z</atom:updated>
            <content:encoded><![CDATA[<p>We believe in lean and efficient teams rather than large teams and then having the overhead of managing them to improve productivity. Goalwise, being a fintech start-up, has a lot of focus on process automation. This reduces human resources required and manual errors.</p><p>Currently there are a lot of features that need number crunching on a daily basis like the capital gains calculations, streaks calculation, scheduled transaction generations and many more. At the early stages of the company cron jobs were written which ran on the EC2 servers. This solution was not my first choice but given the time constraints it was a good one. Cron jobs are a great way to get scheduled tasks done as long as the server doesn’t die.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FeMOYLN6HtJKtW%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fsystem-overload-eMOYLN6HtJKtW&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FeMOYLN6HtJKtW%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="303" frameborder="0" scrolling="no"><a href="https://medium.com/media/a09a9b38ffeecc048c3593148b674358/href">https://medium.com/media/a09a9b38ffeecc048c3593148b674358/href</a></iframe><p>As we started shipping more features, the number of cron jobs started increasing. This brought about a new problem of increasing the EC2 capacity. I had managed to run all the scheduled jobs on t2.micro instance with code written to run for frugal memory consumption and some clever cron job scheduling. This approach though economical, made the code very hard to maintain and add enhancements. Eventually as the number of users increased I reached to a point where the only way out was to increase the EC2 size. With the customer base increasing by about 10% monthly there would be a need to move to a larger EC2 instance every 9 months (This is a rough calculation based on the ratio of number of api drops to memory consumed by the server process threads running. Every time there is an api call dropped error registered more memory is allocated to the server. Eventually there will not be enough memory left on the EC2 instance to allocate). This translated directly into increasing cost for the company (almost 2x every 9 months).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rcoC55gkOglpEyeg" /><figcaption>by <a href="https://unsplash.com/@katyukawa?utm_source=medium&amp;utm_medium=referral">Kat Yukawa</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I started looking for ways to get over these two problems. One thing was very clear that increasing the server capacity was not the solution to the problem. First thing I did was that I had a look at the existing code and checked if there is anything that can be written better. I listed them down but did not go about making these changes straight away as I was not sure if we would be needing the code at all in the future.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl41m17b1ggScfYWNG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl41m17b1ggScfYWNG%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl41m17b1ggScfYWNG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="271" frameborder="0" scrolling="no"><a href="https://medium.com/media/88393948fe9de63c007d6450b5e70fab/href">https://medium.com/media/88393948fe9de63c007d6450b5e70fab/href</a></iframe><p>Next I had a discussion with the product team to get a better view of the upcoming features not just for the next month or quarter but for the year. This discussion did not just include the features that were already scheduled to be released at some point in time but also ideas which hadn’t been thought through yet as a fully formed feature.</p><p>After the meeting with product team I met with the operations team to understand their pain points and what parts of their daily jobs could be automated.</p><p>Next was the customer experience team. Goalwise provides top notch customer experience and anything that can be done to help the customer experience team do their job better had to be done.</p><p>These meetings were very helpful as they gave me an overall idea what was coming tech’s way in the future and how much heavy-lifting scheduled jobs will need to do. After analysing all the requirements that I was able to gather, I started looking at options available to get things done on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lHYf8HHX-dzr4fbk" /><figcaption>by <a href="https://unsplash.com/@grohsfabian?utm_source=medium&amp;utm_medium=referral">Fabian Grohs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>After doing a bit of research I shortlisted two solutions which could fit my needs:</p><ul><li>the spot instance way, or</li><li>the server less Lambda way</li></ul><p>To make my final decision I had a look at the requirements again. Turns out most of the requirements were going to be triggered based on two events — user action or scheduled for a particular time in the day. This essentially meant that the code that was going to be written for the scheduled job would also be a part of the product as an event-triggered calculation. As a developer I did not want to maintain multiple sets of code doing the same thing. I saw two main problems with the spot instance approach.</p><ul><li>Reliable provisioning for time sensitive task while the triggers for lambda has failure retries built in.</li><li>I would still have to keep increasing the EC2 size as the traffic on the website increases while lambda gave me the option to scale horizontally without any extra effort.</li></ul><p>AWS Lambda was the way to go.</p><p>I was all excited to start working on AWS Lambda but it came with its own set of limitations. Though lambda was easy to trigger on user actions it was not designed to run batch jobs. ‘Step Functions’ stepped in to save the day. It allowed the job orchestration and reporting the way which suited my needs best.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl3q2UyW34cT2rcgko%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl3q2UyW34cT2rcgko%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl3q2UyW34cT2rcgko%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3f80f55875041bcb0cd880f4169e122/href">https://medium.com/media/a3f80f55875041bcb0cd880f4169e122/href</a></iframe><p>In a couple of weeks of code, I was able to write a basic framework for serverless jobs for Goalwise. This framework focused mostly on dealing with the AWS APIs and laid out some basic standard for writing jobs. With these building blocks in place I could run hundreds of lambdas in parallel to do the calculations and then combine the results and flush them to the database depending on the class the of the database and load on it :) I am not going into the details of it in this blog (may be later I will write one).</p><p>I ran it in production in parallel with one of the existing cron jobs and monitored the results. With a few more changes to the framework, code was performing as expected but with a lot more reliability. It was time to flip the switch and go live with it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FVsAKwpeTXuMGQ%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fkung-fu-panda-VsAKwpeTXuMGQ&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FVsAKwpeTXuMGQ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/4029dd92a7f1f02a8852e1bb3220d794/href">https://medium.com/media/4029dd92a7f1f02a8852e1bb3220d794/href</a></iframe><p>Three months later almost all the scheduled jobs are now serverless with the framework further evolving into performing more and more of the dev-ops tasks ‘codomaticaly’ thanks to the AWS APIs. At present the dashboard data, streak calculation, capital gains report calculation, KYC recon, graph calculation and a lot more are run on lambda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xLocMiRACOScCkT_" /><figcaption>by <a href="https://unsplash.com/@walkingondream?utm_source=medium&amp;utm_medium=referral">Olga DeLawrence</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To do the same thing on EC2 instance I would need a t2.medium machine which with the yearly no upfront reserved instance applied would approximately cost $45. The current usage of lambda and step functions combined is $4.87. By the end of this year hopefully I will be able to migrate the remaining few jobs too and shut down the EC2 :) On the website and app we roughly get about a million api calls a month which is being handled by a single t2.small instance. I hope to move move all the api calls to lambda 3rd quarter next year. By my calculations, this should reduce the compute cost by almost 80%!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=811aa8e4e799" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/how-we-moved-to-serverless-architecture-at-goalwise-using-aws-lambda-811aa8e4e799">How we moved to serverless architecture at Goalwise using AWS Lambda</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we scaled customer delight and got to 18,000 users in 2 years via word-of-mouth]]></title>
            <link>https://medium.com/building-goalwise/how-we-scaled-customer-delight-and-got-to-18-000-users-in-2-years-via-word-of-mouth-3ae73119a123?source=rss----3a97be13ec3c---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ae73119a123</guid>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[customer-experience]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Savitri Bobde]]></dc:creator>
            <pubDate>Thu, 02 Aug 2018 14:25:30 GMT</pubDate>
            <atom:updated>2018-08-03T05:21:41.120Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qp_ofw4SY-aouAxx" /><figcaption>Photo by <a href="https://unsplash.com/@zacharytnelson?utm_source=medium&amp;utm_medium=referral">Zachary Nelson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="http://www.goalwise.com/">Goalwise</a> is a personal wealth management startup based in India — now more than 2 years old and with over 18,000 users (mainly acquired via word-of-mouth). Our growth strategy is pretty much based on one mantra — the customer experience should be great!</p><p>Basically that means that everything that the user touches should delight them or at the very least not annoy them given the industry we are in. Typically, if a user is delighted about something they will tell maybe <em>a maximum</em> of 5 friends but if they are annoyed with something then they are likely to tell <em>at least</em> 5 friends.</p><h3>The Problem</h3><p>We were not even a year old and we had a problem. Not all problems are bad. Some, as they say, are good problems to have. We had a ‘good’ problem — the number of users were growing faster than we had estimated. This resulted in a small team (less than 15 in total — including tech, advisory, customer support, operations etc.) trying to service more than 4000 users in a technologically backward industry with lot of offline processes. And of course we weren’t really prepared for it — no one is.</p><p>This good problem resulted in 3 bad problems:</p><ol><li>Things started to ‘break’ — Things start falling through the cracks because we weren’t really used to servicing so many people. For example delay in verifying documents and activating accounts, not being able to answer chats immediately because you are also on a call with another user and other similar things. These were things that we could get past by apologising to our users but these are exactly the things that prevent us from truly delighting our users. And that was a big problem because that was our ‘growth strategy’.</li><li>We didn’t know which problems to prioritise — There were many things that needed attention. Most of the problems were being fixed on the spot as and when they came up. Some of them were recurring issues but no one was tracking them so that later they could be fixed once for all. This was mainly because there was no time to take a step back, take stock of the big picture and think of scalable solutions.</li><li>Loss of accountability — We couldn’t fix accountability to departments/people because we did not have a process to document all the things that were going wrong in the first place. Heck, we did not even have proper documentation of processes to be followed especially when tasks involved inter-departmental work. For example, if a user has not submitted a required document because of which his account cannot be activated, who should remember to follow up — customer care or operations? This just led to more frustration amongst everyone with no actionable points.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FgVoQge4JXndPq%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffrustrated-brave-tired-gVoQge4JXndPq&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FgVoQge4JXndPq%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="228" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce83099d8126aa03221e22fe8abc85aa/href">https://medium.com/media/ce83099d8126aa03221e22fe8abc85aa/href</a></iframe><h3>What did we do?</h3><p>Although at the time, the issues were not as clear in my head as they are now in hindsight, we knew that small things were going wrong, we were getting sadder with every apology and we had to start improving somewhere. So I came up with a simple sheet called the <strong>User Happiness Sheet (UHS)</strong>.</p><p>It had 2 kinds of entries made <em>as and when they happened</em> -</p><p><strong>Sorry entry </strong>— When we said sorry to a user for a mistake we had committed or a bug in the product. For example, if a user could not upload his document properly would count as a sorry. If the error message was confusing, that would be counted as a sorry as well. If we had told a user that we will get back to them by end of day and did not, then that would be counted as a sorry. But if we did not have a feature because we did not think it was important and a user complains of it, it wasn’t counted as a sorry (but was passed on as feedback for product).</p><p><strong>Thank You entry</strong> — When a user complimented us enough for us to say Thank you to them. For example, a user sent us a lovely printed letter saying how good he feels about investing with us. That counted as 1 thank you. But if the user just said something like ‘Thanks for the help’ it wasn’t counted since we wouldn’t be replying with a thank you to this. So it had to be a compliment to which we say ‘Thank you for your appreciation’ or something like that. All 5-star reviews on Facebook and Play store were also a part of it.</p><p>For each entry, we noted the date, the userid, the exact words of the user leading to this entry and which department would this be attributed to.</p><p>For example, delay in account activation would be attributed to the ops team, incorrect info provided on chat/email would be attributed to the care team, bugs would be attributed to the tech team, UX issues would be attributed to the product team etc.</p><p>The same would be done for thank you’s as well. If the user was appreciative of more than one type of thing (eg product + customer support), then it would be attributed to both. And some entries were attributed to Team Goalwise. For e.g. a 5 star review on Facebook praising us for our overall experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J2GSiroe2TNRX78g" /><figcaption>A part of our current User Happiness Sheet with Sorry and Thank You entries (user names removed)</figcaption></figure><p>Since all the communication went through the customer care team, they were responsible for making the UHS entries for themselves as well as other teams.</p><p>And every week we calculated the Thank you:Sorry ratio aka our User Happiness Score. When multiple departments were responsible for a sorry or thank you and then 1 point would get split amongst them. So this gave us a User Happiness Score at the overall level and each department level. We also had columns which explained exactly what the compliment was about or the mistake was.</p><p>The sheet was accessible to everyone in our start-up and not just the department heads. Everyone could see what was going on. We made it a discussion point in our department and all-hands meetings.</p><p>The first week we did it, we realised our hunch was right. We were saying way more sorry’s than thank you’s. The Thank you: Sorry Ratio was 0.55 i.e. we had almost 2 sorry’s for every thank you. It was disappointing especially since we really wanted to build our brand on user delight.</p><p>It’s important to note here that all our mistakes would go into this sheet as a Sorry even if the user was not really pissed off because of it. But to earn thank you entries, we had to do delight a user enough that he gives us a compliment. So it was difficult to get a high ratio especially in the phase we were in almost by design, but anything worthwhile is never easy.</p><p>And we could see that the issues were not things that could be fixed overnight. We needed to automate a lot of processes internally to decrease manual errors, improve our QA before we shipped features to reduce bugs etc. All of this required time and investment (and leadership).</p><p>But we kept recording and measuring and discussing till it became common vocabulary.</p><p>And then something happened.</p><blockquote><strong>We started improving just because we were measuring transparently.</strong></blockquote><p>Manual errors started going down as people became more aware of how their work is going to be evaluated — by the UHS yardstick. Then they started pushing for documentation and setting up processes on their own rather than it being forced from top down.</p><p>We set a target for ourselves — to get the Thank You-Sorry ratio to 1 in the next quarter. This really brought all departments together in a mission mode and everyone started looking for ways to eliminate sources of sorrys and to increase customer delight. In a sense, it became our north star metric across the organisation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl4pSXyrGBwGxjQHL2%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fl4pSXyrGBwGxjQHL2&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl4pSXyrGBwGxjQHL2%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/489e28f388efbad88d0a7f760d12a04a/href">https://medium.com/media/489e28f388efbad88d0a7f760d12a04a/href</a></iframe><p>We analysed everything that was going wrong and of things that were earning us thank yous.</p><p>Usually they fell in one of the categories below and could be attributed to a lack in our processes:</p><p><strong>Sorry’s:</strong></p><p>Manual errors</p><ul><li>Lack of automation in internal operations processes</li><li>Lack of documentation of processes</li><li>Lack of processes themselves</li></ul><p>Bugs</p><ul><li>Lack of testing</li><li>Lack of proper requirements from product before the tech team started development</li></ul><p>Incorrect communication, missed follow-ups</p><ul><li>Lack of knowledge</li><li>Lack of accountability</li><li>Lack of tracking communication</li></ul><p><strong>Thanks You’s:</strong></p><p>Knowledgeable and friendly customer support</p><ul><li>Focus on training of customer support</li></ul><p>Honest advice</p><ul><li>Focus on company values</li></ul><p>Great Product</p><ul><li>Focus on design and usability</li></ul><p>Every week all unit heads would go through the sheet, look at all the new entries, trace it to the underlying cause and come up with a solution. This list of solutions would then be discussed and prioritised and put on our roadmap. This went a long way in fixing accountability. And of course things that were breaking more frequently or/and were easy to fix were prioritised first.</p><p>Instead of just adding new features, tech spent a good part of that quarter in automating internal processes. We built two internal products — one for care and one for ops — implementing workflows unique to our industry.</p><p>Not all problems and solutions were technological though. Most of them involved setting up well defined processes and giving people clear ownership (and hence accountability). Sometimes it also meant saying no to a user if it meant making an exception to a tricky process (and there were quite a few of those initially).</p><p>And all departments worked hard towards it and we reached the target of UHS of 1 in just the next 2 months!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl4EpblDY4msVtKAOk%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fthenextstep-l4EpblDY4msVtKAOk&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl4EpblDY4msVtKAOk%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e11a209c9c97024d2ee03cfeb20774b3/href">https://medium.com/media/e11a209c9c97024d2ee03cfeb20774b3/href</a></iframe><p>Even if one department hadn’t put all it’s weight behind it we wouldn’t have been able to achieve it.</p><p>Over the past year, our User Happiness Score has gone from 0.55 to 1.72 even as our user base has grown multi-fold. We have been able to keep the number of sorry’s under check and increased our thank-you’s even though we keep experimenting with our product and processes with a small team.</p><p>This is reflected in the external world as well — currently we are one of the highest rated Mutual Fund investing apps on <a href="https://play.google.com/store/apps/details?id=com.goalwise&amp;hl=en_IN">Google Play (4.6)</a> and <a href="https://www.facebook.com/pg/goalwise/reviews/">Facebook (5.0)</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*7Wc8PPkXRsauUlVD" /><figcaption>UHS Sorry’s and Thank You’s over the last year</figcaption></figure><p>Our User Happiness Score has been instrumental in helping us come this far.</p><p>We could have used NPS to measure how we were doing (and we did use it) but UHS gave us a much more granular and actionable look into what was going wrong and how to fix it and we were able to rally our entire organisation around it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ae73119a123" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-goalwise/how-we-scaled-customer-delight-and-got-to-18-000-users-in-2-years-via-word-of-mouth-3ae73119a123">How we scaled customer delight and got to 18,000 users in 2 years via word-of-mouth</a> was originally published in <a href="https://medium.com/building-goalwise">Building Goalwise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>