<?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[Tech at ZET - Medium]]></title>
        <description><![CDATA[Documenting tech innovations on ZET - Medium]]></description>
        <link>https://medium.com/tech-at-zet?source=rss----5f256530b162---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Tech at ZET - Medium</title>
            <link>https://medium.com/tech-at-zet?source=rss----5f256530b162---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:24:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/tech-at-zet" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enhancing Fintech Reliability with Cloud-Native Webhooks]]></title>
            <link>https://medium.com/tech-at-zet/enhancing-fintech-reliability-with-cloud-native-webhooks-ed801b6fb2c3?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/ed801b6fb2c3</guid>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[sqs]]></category>
            <dc:creator><![CDATA[Jaya Majji]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 11:15:40 GMT</pubDate>
            <atom:updated>2023-09-21T11:51:32.366Z</atom:updated>
            <content:encoded><![CDATA[<p>In the fast-paced world of fintech, where every transaction and piece of data holds immense value, the flow of information between services is paramount. To ensure seamless communication and uninterrupted data transfer, webhooks have become indispensable for many financial technology companies. In this blog, we’ll explore how ZET, a fintech company, has leveraged webhooks and at ZET we have transformed webhooks to a cloud-native architecture to guarantee high availability and reliability in their operations</p><p><strong>The Power of Webhooks</strong></p><p>Webhooks are automated HTTP requests triggered by specific events in a source system, sent to a destination system with a payload of data. They enable real-time communication between different software systems, making them ideal for event-driven interactions. At ZET we utilise webhooks in several critical areas:</p><p>1.<strong> Payment Gateway (PG) Confirmation</strong></p><p>When customers make payments, Our platform needs to receive payment confirmation promptly. Webhooks allow the Payment Gateway to trigger real-time notifications to our systems, ensuring that payment information is received and processed without delay.</p><p><strong>2. Transaction Information</strong></p><p>Partner organizations frequently share transaction data with our platform. By employing webhooks, these partners can trigger automatic data transfers to our services as soon as new transactions occur, streamlining the data flow.</p><p><strong>3. Internal Service Callbacks</strong></p><p>Our platform has various internal services that often execute long-running jobs that require coordination and status updates. Webhooks facilitate callbacks between these services, ensuring that each step of a task is communicated effectively.</p><p><strong>The Challenge: High Availability</strong></p><p>In the world of fintech, downtime is not an option. Even the briefest interruption in data flow can have significant consequences. So we have recognized this challenge and embarked on a mission to ensure high availability for their webhooks.</p><p><strong>The Solution: Cloud-Native Webhooks</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUu-CZJQHrtp2TxctYTR1Q.jpeg" /></figure><p>This journey towards high availability led us to embrace a cloud-native architecture for webhooks. The primary objective was to capture incoming webhook requests reliably and address processing concerns separately. Here’s how we achieved it:</p><p><strong>1. AWS API Gateway</strong></p><p>We have turned to AWS (Amazon Web Services) API Gateway, a robust solution that provides highly available endpoints for receiving webhook requests. The simplicity and ease of configuration in API Gateway made it a natural choice.</p><p><strong>2. AWS Simple Queue Service (SQS)</strong></p><p>To address the challenge of service downtime and potential data loss, we have integrated AWS SQS. Instead of processing incoming requests immediately, SQS acts as a buffer, temporarily storing the data until services are back online. This guarantees that no transactional information is lost, even during service outages.</p><p><strong>The Result: Data Reliability and Peace of Mind</strong></p><p>By implementing this cloud-native approach, we have transformed the reliability of webhooks. Downtime in any service no longer translates into missed transactional information. When services are restored, all queued items in SQS are processed, ensuring that data remains consistent and reliable.</p><p>By migrating webhooks to a cloud-native architecture using AWS API Gateway, AWS SQS, We have not only safeguarded our data but also strengthened our reputation for providing consistent and reliable financial information to our customers.</p><p>In conclusion, for any organisation, cloud-native architecture has become an invaluable tool in the pursuit of unwavering data reliability and high availability. In a digital age where financial transactions happen at lightning speed, the ability to capture, store, and process data seamlessly is the key to success, and At ZET we have unlocked this potential with precision and foresight.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed801b6fb2c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/enhancing-fintech-reliability-with-cloud-native-webhooks-ed801b6fb2c3">Enhancing Fintech Reliability with Cloud-Native Webhooks</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Localization in a Monorepo using i18n-js]]></title>
            <link>https://medium.com/tech-at-zet/streamlining-localization-in-a-monorepo-using-i18n-js-e7c521ff69d4?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/e7c521ff69d4</guid>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[i18n]]></category>
            <dc:creator><![CDATA[Prajwal T S]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 08:45:48 GMT</pubDate>
            <atom:updated>2023-08-28T08:45:38.522Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the world of app development, catering to various regions and languages is essential for reaching a global user base. This is where localization comes into play, allowing apps to adapt to different locales. One effective tool in the JavaScript realm for achieving this is <strong>i18n-js</strong>. In this article, we’ll delve into how to harness the power of i18n-js within a monorepo setup to facilitate localization across multiple apps.</p><h3>Getting Started with i18n-js</h3><p>To begin, it’s crucial to grasp the fundamentals of i18n-js. This library’s core component is the I18n class, which handles translations. The following code snippet demonstrates how to instantiate the I18n class with translation objects for two locales, English and Brazilian Portuguese.</p><pre>import { I18n } from &quot;i18n-js&quot;;<br><br>const i18n = new I18n({<br>  en: {<br>    hello: &quot;Hi!&quot;,<br>  },<br>  &quot;pt-BR&quot;: {<br>    hello: &quot;Olá!&quot;,<br>  },<br>});</pre><h3>Monorepo Challenges and Solution</h3><p>Monorepos are a common approach when developing multiple apps that share common packages. However, when dealing with localization in such a setup, challenges can arise regarding maintaining content specific to each package. To address this, consider creating a dedicated package for localization, named @localization, which will house a unified localization instance</p><pre>// Inside the @localization package<br>export const i18n = new I18n();</pre><p>Within each individual package, you can then add package-specific localization content. For example:</p><pre>import { i18n } from &#39;@localization&#39;;<br><br>const localizationObj = {<br>  en,<br>  &quot;pt-BR&quot;,<br>}<br>i18n.store(localizationObj);</pre><p>Here, en and pt-BR represent content tailored for the respective package&#39;s audience.</p><h3>Implementation Tips</h3><p>When integrating i18n-js into your monorepo, keep these implementation tips in mind:</p><ol><li><strong>Centralized Localization</strong>: By utilizing the @localization package to manage localization, you ensure a consistent approach across all packages.</li><li><strong>Package-Specific Content</strong>: The ability to store package-specific content within the @localization package simplifies content management and reduces duplication.</li><li><strong>Import Considerations</strong>: Remember to import the i18n instance from @localization instead of directly from i18n-js within your project.</li></ol><h3>Conclusion</h3><p>Localization is pivotal for making apps accessible and user-friendly across diverse linguistic backgrounds. With i18n-js and a well-structured monorepo setup, you can efficiently manage localization efforts for multiple apps. By creating a centralized localization package and utilizing package-specific content, you strike a balance between shared resources and customized localization, streamlining the development process and ensuring a consistent user experience.</p><p><em>Thank you for reading! We hope this article provides valuable insights into localization using i18n-js within a monorepo context. Feel free to share your thoughts and experiences in the comments below.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7c521ff69d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/streamlining-localization-in-a-monorepo-using-i18n-js-e7c521ff69d4">Streamlining Localization in a Monorepo using i18n-js</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Universal Apps in React Native — Part 2 — State Management]]></title>
            <link>https://medium.com/tech-at-zet/building-universal-apps-in-react-native-part-2-state-management-df9cac985acd?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/df9cac985acd</guid>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[zustand]]></category>
            <category><![CDATA[react-query]]></category>
            <dc:creator><![CDATA[Anurag Alla]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 08:43:30 GMT</pubDate>
            <atom:updated>2023-08-10T08:43:30.065Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Universal Apps in React Native — Part 2 — State Management</h3><p>State management is a topic of utmost importance in the world of React and React Native. With a plethora of options available, it can be overwhelming to explore each one in detail. However, the decision-making process revolves around determining whether your application’s state is predominantly driven by the server or the client.</p><h4>Server State:</h4><p>In our case, ensuring that our app remains synchronized with the server state is crucial in most scenarios. To achieve this, we required a library that abstracts API calls (side effects) while offering features such as caching, TypeScript support, and an exceptional developer experience (DX).</p><p>Among the various contenders, one library stood out as the clear winner: Tanstack Query (formerly known as react-query). This is by far the best library that one can use for handling server state for Restful services, given its remarkable capabilities. While SWR by Vercel came close, Tanstack Query’s superior DX, Query-based approach, automatic caching, background updates, and pagination support made it the optimal choice for our needs. However, it’s important to note that the choice would differ for graphql-based backend services, a topic beyond the scope of this blog post.</p><pre>import React from &#39;react&#39;;<br>import { View, Text, FlatList } from &#39;react-native&#39;;<br>import { useQuery } from &#39;react-query&#39;;<br>import axios from &#39;axios&#39;;<br><br>interface User {<br>  id: number;<br>  name: string;<br>}<br><br>const fetchUsers = async (): Promise&lt;User[]&gt; =&gt; {<br>  const response = await axios.get(&#39;/api/users&#39;);<br>  return response.data;<br>};<br><br>const UserList: React.FC = () =&gt; {<br>  const { data: users, isLoading, isError } <br>    = useQuery({ queryKey: [&#39;users&#39;], queryFn: fetchUsers });<br><br>  if (isLoading) {<br>    return &lt;Text&gt;Loading...&lt;/Text&gt;;<br>  }<br><br>  if (isError) {<br>    return &lt;Text&gt;Error fetching data&lt;/Text&gt;;<br>  }<br><br>  return (<br>    &lt;View&gt;<br>      &lt;Text&gt;User List&lt;/Text&gt;<br>      &lt;FlatList<br>        data={users}<br>        keyExtractor={user =&gt; user.id.toString()}<br>        renderItem={({ item }) =&gt; &lt;Text&gt;{item.name}&lt;/Text&gt;}<br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>};<br><br>export default UserList;</pre><h4><strong>Client State:</strong></h4><p>Although our application heavily relies on server state, it is essential to handle client state for various use cases in mobile apps. For instance, managing UI state to track form progress across screens or storing filter selections in listing screens. During our evaluation, we considered multiple options:</p><p><strong>Redux: </strong>Redux is a widely adopted state management solution; however, it often involves a significant amount of boilerplate code that doesn’t align well with our specific use case.</p><p><strong>Zustand:</strong> Zustand caught our attention due to its effortless setup and the ability to access a global store using hooks, similar to Redux. It strikes a balance between simplicity, maintainability, and an improved DX.</p><p><strong>Jotai:</strong> Jotai is a suitable choice for decentralized state management. However, it requires meticulous planning and additional effort to create stores. Considering our team’s familiarity with the Redux approach, we preferred a solution that offers reduced boilerplate, maintainability, and a favorable DX.</p><p>With our requirements of simplicity, maintainability, and a favorable DX in mind, we ultimately selected Zustand as our preferred client state management library. Zustand’s simple API, which closely resembles Redux, makes it an excellent fit for our project.</p><pre>import create from &#39;zustand&#39;;<br><br>interface User {<br>  id: number;<br>  name: string;<br>  email: string;<br>}<br><br>interface UserStore {<br>  users: User[];<br>  addUser: (user: User) =&gt; void;<br>  updateUser: (userId: number, user: User) =&gt; void;<br>  deleteUser: (userId: number) =&gt; void;<br>}<br><br>export const useUserStore = create&lt;UserStore&gt;((set) =&gt; ({<br>  users: [],<br>  addUser: (user) =&gt; set((state) =&gt; ({ users: [...state.users, user] })),<br>  updateUser: (userId, updatedUser) =&gt; {<br>    set((state) =&gt; ({<br>      users: state.users.map((user) =&gt;<br>        user.id === userId ? { ...user, ...updatedUser } : user<br>      ),<br>    }));<br>  },<br>  deleteUser: (userId) =&gt;<br>    set((state) =&gt; ({ users: state.users.filter((user) =&gt; user.id !== userId) })),<br>}));</pre><h4><strong>Conclusion</strong></h4><p>In conclusion, our journey at Zet to bring our fintech solutions to every platform led us to the selection of three powerful libraries:</p><p>Nativewind (<a href="https://medium.com/@zetapp/building-universal-apps-in-react-native-part-1-design-system-243749fbab72">read part 1 of this series</a>) for our design system, Zustand for client state management, and Tanstack Query for handling server state.</p><p>By combining the power of Nativewind, Zustand, and Tanstack Query, we have built a robust foundation for our universal app. These libraries empower us to deliver our fintech solutions seamlessly across all platforms, providing a superior user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df9cac985acd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/building-universal-apps-in-react-native-part-2-state-management-df9cac985acd">Building Universal Apps in React Native — Part 2 — State Management</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[☞ Should we use Global State?]]></title>
            <link>https://medium.com/tech-at-zet/should-we-use-global-state-2601df2fd167?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/2601df2fd167</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Nikhil Saxena]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 09:59:21 GMT</pubDate>
            <atom:updated>2023-05-11T08:48:06.996Z</atom:updated>
            <content:encoded><![CDATA[<h3>☞ When to use Global State?</h3><p>When you’re building React Native apps, you gotta think about state management, right? There are a few ways to do it, but one of the most popular is global state. In this blog post, we’ll talk about what global state is, whether it’s the best option for your app, and how to use it.</p><h3>What is Global State?</h3><p>So, global state is just a single state object that you can access and change from any component in your app. This means that you can keep track of everything in one place and make sure that everyone is on the same page.</p><p>It’s super easy to create global state in React Native using the Context API. Here’s an example:</p><pre>import React, { createContext, useState } from &#39;react&#39;;<br><br>export const GlobalContext = createContext();<br><br>export const GlobalProvider = ({ children }) =&gt; {<br>  const [state, setState] = useState({});<br><br>  return (<br>    &lt;GlobalContext.Provider value={[state, setState]}&gt;<br>      {children}<br>    &lt;/GlobalContext.Provider&gt;<br>  );<br>};</pre><p>In this code, we’re making a GlobalProvider component that wraps everything in our app. We create a GlobalContext object with createContext, set an empty object as the initial state with useState, and then make that state available to all of our components with GlobalContext.Provider.</p><h3>Pros and Cons of Global State</h3><p>So, there are some pretty sweet things about global state:</p><ul><li><strong>Easy to Use:</strong> Global state is super simple to use — you can access it from anywhere in your app!</li><li><strong>Saves Time:</strong> Using global state can save you time by avoiding having to pass state down through multiple components.</li></ul><p>But, there are some downsides, too:</p><ul><li><strong>Easy to Misuse:</strong> It’s really easy to use global state too much, which can make your code hard to keep track of.</li><li><strong>Performance Issues:</strong> If your state object gets too big or too many components are using it at once, your app might slow down.</li></ul><h3>When to Use Global State</h3><p>So, when should you use global state? Here are a few examples:</p><ul><li><strong>User Authentication:</strong> If you need to keep track of whether someone is logged in across your whole app, global state is a good way to do it.</li><li><strong>Theme Settings:</strong> If you want to let your users switch between light and dark mode, global state can make it easy.</li><li><strong>API Responses:</strong> If you want to cache responses from your server and use them in multiple parts of your app, global state is a good choice.</li></ul><h3>Managing Global State</h3><p>When you’re using global state, it’s important to keep everything organised. You can use the useContext hook to access the global state from any component in your app.</p><p>Here’s an example:</p><pre>import React, { useContext } from &#39;react&#39;;<br>import { View, Text } from &quot;react-native&quot;; <br>import { GlobalContext } from &#39;./GlobalState&#39;;<br><br>export const MyComponent = () =&gt; {<br>  const [state, setState] = useContext(GlobalContext);<br>  <br>  const handlePress = () =&gt; {<br>    setState({ ...state, someValue: true });<br>  }<br><br>  return (<br>    &lt;View&gt;<br>      &lt;Text&gt;{state.someValue}&lt;/Text&gt;<br>      &lt;Button onPress={handlePress}&gt;Update State&lt;/Button&gt;<br>    &lt;/View&gt;<br>  )<br>}</pre><p>In this code, we’re importing the GlobalContext object and using useContext to get the state and setState values. Then, we just use those values like we would any other state.</p><h3>Final Words</h3><p>So, there you have it — global state can be a pretty sweet way to manage state in your React Native app. It’s easy to use, can save you time, and can be really helpful in certain situations. But, you gotta be careful — using it too much can cause performance issues and make your code hard to manage. So, make sure you’re weighing the pros and cons before you decide whether to use it or not!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2601df2fd167" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/should-we-use-global-state-2601df2fd167">☞ Should we use Global State?</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</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 implemented A/B(Experiment) service?]]></title>
            <link>https://medium.com/tech-at-zet/how-we-implemented-a-b-experiment-service-f43bf202913e?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/f43bf202913e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[springboot-2]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Naveen Kumar]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 13:16:20 GMT</pubDate>
            <atom:updated>2023-07-26T13:16:20.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A4JMD1trM1sBoPWF" /><figcaption>Photo by <a href="https://unsplash.com/@fatosi?utm_source=medium&amp;utm_medium=referral">Fatos Bytyqi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><strong>Why A/B testing?</strong></blockquote><p>In business, sometimes we might have multiple solutions/features(flow in an app, colour, design) by our hypothesis and we may not be sure which one will work for the customers. So we decide to test them all out by releasing those features to a certain set of customers. We then analyse the data and make a calculated decision of which feature is serving best to our customers and decide to make it a permanent part of our app showing it to all users while deprecating other feature.</p><blockquote><strong>What is A/B testing?</strong></blockquote><p>A/B testing, also known as split testing, is a marketing experiment wherein you split your audience to test a number of variations of a campaign and determine which performs better. In other words, you can show version A of a content/feature/behaviour to one half of your audience, and version B to another.</p><blockquote><strong>Why not to use 3rd party services?</strong></blockquote><p>We did use 3rd party X for A/B.</p><p>With X, We observed the following problems:</p><ul><li>High latency because of server side tagging</li><li>Feature complexity</li><li>Tracking and Impact measurement of split sections.</li><li>High cost</li></ul><blockquote><strong>What our service offers?</strong></blockquote><p>This service (implemented as a micro-service) will enable clients to do A/B testing. We can do any number of experiments with multiple features(return values).</p><p>This is designed keeping in mind about scalability and further enhancements.</p><p>Common functionality includes:</p><ol><li>Ability to control a feature go-live on a restricted basis (specific users)</li><li>Enabling any feature for random(%) users</li><li>Evaluating the feature on the basis of user profile/specific parameters with complex logic</li><li>Ability to control a front-end feature (UI element) on a restricted basis</li><li>Adding/Editing the features in any experiment</li><li>Capability to make segments mutually exclusive</li><li>Ability to find out which user fall under a particular segment</li><li>All other analyses that could stem from such experiment</li></ol><blockquote><strong>Tech Stack:</strong></blockquote><p>Springboot, Java 8, Maven, Mysql, Groovy</p><blockquote><strong>Schema Design:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*4BmaP824sNa6epew" /></figure><p>Here is a short description what above entities save. All entities extend BasEntity to get the common columns across all entities.</p><ol><li><strong>Experiment:</strong> All experiments will gets saved here with uniques name and optional description.</li><li><strong>Feature:</strong> An experiment can have multiple features which will be saved in this table with unique name, optional description and experiment_id as foreign key to experiment table. <br>Value is what that feature will return to the client in json format. <br>Whitelisted_users will contain list of user_id as a comma separated list which will tell what users are assigned to this feature.</li><li><strong>Logic:</strong> Since each experiment can have certain criteria to divide the user segment on some condition, this condition will be saved in condition column of logic table. (We will come to implementation later)</li><li><strong>User_Feature_Mapping:</strong> Since we might want that once a user is assigned to certain feature, it will remain in same feature for future api calls. In other words, we might want to maintain consistency instead of evaluating logic(condition) every time.</li></ol><blockquote><strong>Flow Design:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*Q56GfXnf0gOPK11k" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/0*uu_xSH5I20CpN4OD" /></figure><p>Now we will see what above 2 flows means:</p><p>The <strong>usePreCalculated</strong> flag is important here as it means whether we want to reuse the value contained in User_Feature_Mapping table or evaluate condition from logic table again.</p><ol><li>If it is false, we will check in whitelisted_list of each feature of the experiment. If it exits then return value, else we will evaluate the logic and then accordingly return the feature value;</li><li>If it is true, we will first check in user_feature_mapping table if that user_id and experiment_id is present. If yes then we return the value. If not, then we will follow above step (step 1)</li></ol><blockquote>Note: Every time we evaluate the logic, we will save the result in user_feature_mapping table</blockquote><blockquote><strong>How do we evaluate condition?</strong></blockquote><p>We are storing groovy code in condition column of logic table. Below is just one sample example:</p><pre>import groovy.lang.GroovyShell;<br><br>public class GroovyDemo {<br>    public static void main(String[] args) {<br>        System.out.println(&quot;This represents some random code&quot;);<br><br>        String groovyScript = &quot;println &#39;first line of Groovy output&#39;\n&quot; +<br>                &quot;println &#39;second line of Groovy output&#39;&quot;;<br><br>        GroovyShell groovyShell = new GroovyShell();<br><br>        // instead of passing a String you could pass a<br>        // URI, a File, a Reader, etc... See GroovyShell javadocs<br>        groovyShell.evaluate(groovyScript);<br><br>        System.out.println(&quot;This represents some more random code&quot;);<br>    }<br>}</pre><p>We chose groovy shell for its sheer amount of flexibility. We can execute complex functions and even call external methods and apis with the code stored as a text. This is beneficial when our use case is complex such as we want to assign user segments on the basis of certain user properties or parameter which can only be fulfilled by 3rd party apis.</p><p>For example, if we want to divide the A/B as 90:10, we can do modulo 10 operation on user_id and assign result 0 to segment B and remaining to segment A. We can change the ratio or even logic any number of times without the need of redeploying.</p><blockquote><strong>List of APIs:</strong></blockquote><ol><li>To create an experiment</li><li>To edit the experiment</li><li>To get the details of an experiment</li><li>To add a feature to an experiment</li><li>To edit a feature</li><li>To edit whitelisted users list for certain feature</li><li>To Evaluate an experiment and return response in json (Major Api)</li></ol><blockquote><strong>Data Tracking:</strong></blockquote><p>In order to analyse our features’ performance, we need to store events in one place, be it DB or 3rd party like Mixpanel that will help us to create funnels and compare our features’ performance in any given timeframe to get insights and make a decision regarding which feature to be final.</p><blockquote><strong>Way ahead:</strong></blockquote><p>We can aim for introducing caching for optimisation of latency. Also using GroovyShell introduces a high waiting time in the queue if number of requests per unit time is high. This can be avoided by writing a general function in the code itself which will split the users according to the percentage given in the feature table while GroovyShell still can be kept for high flexibility it offers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f43bf202913e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/how-we-implemented-a-b-experiment-service-f43bf202913e">How we implemented A/B(Experiment) service?</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backend-driven dynamic forms in React/React-native: Part 1]]></title>
            <link>https://medium.com/tech-at-zet/backend-driven-dynamic-forms-in-react-react-native-part-1-2e3140e4f6c?source=rss----5f256530b162---4</link>
            <guid isPermaLink="false">https://medium.com/p/2e3140e4f6c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[dynamic-form]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Prajwal T S]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 13:07:27 GMT</pubDate>
            <atom:updated>2023-07-26T12:21:02.011Z</atom:updated>
            <content:encoded><![CDATA[<p>Forms are a critical aspect of user interaction on both web and app platforms. They serve as essential tools for collecting necessary information from users, ranging from simple text inputs to complex selections and date pickers. Form management encompasses various elements, including field types, UI configurations, and validations. Popular form management libraries such as react-hook-form and formik, along with validation libraries like zod and yup, provide developers with a multitude of options to handle these complexities effectively.</p><p><strong>The Frontend Dilemma</strong></p><p>Traditionally, frontend development has been the primary focus for form creation and maintenance. All field configurations and validations were developed and managed within the frontend codebase. While this approach is suitable for applications with a few static forms, it becomes cumbersome when dealing with a large number of constantly evolving forms, as seen in survey applications or platforms requiring dynamic user data collection.</p><p><strong>The Need for Backend-Driven Forms</strong></p><p>The demand for backend-driven forms arises when there is a necessity for a high volume of forms that require constant development and maintenance. For instance, consider a scenario where a platform needs to onboard multiple banks and create application forms for various financial products like credit cards and loans. Building and maintaining these forms solely on the frontend would be impractical and time-consuming.</p><p><strong>The Advantages of Backend-Driven Dynamic Forms</strong></p><p>While backend-driven forms may incur a higher initial setup cost, the long-term benefits outweigh this investment. Once the system is built, creating and modifying forms becomes a swift process with zero deployment required. Furthermore, a well-implemented backend-driven form system minimizes the need for developer intervention after the initial setup.</p><p><strong>Choosing the Right Technologies</strong></p><p>When implementing a backend-driven dynamic form solution, choosing the appropriate technologies is crucial. In our use case, we opted for the following:</p><ol><li><strong>React-Hook-Forms for Form Management</strong>: Among the available form management libraries, we chose react-hook-forms due to its lightweight nature and support for uncontrolled forms. This library streamlines form handling and makes it easier to integrate with backend-driven systems.</li><li><strong>AGV for Validations</strong>: For managing validations, we selected AGV, a library used to evaluate JSON schemas. JSON schemas provide a JSON serializable representation of validation rules, making them suitable for backend-driven systems. Moreover, AGV allows us to utilize the same validation schema in other programming languages, such as Java or Python, offering increased flexibility.</li><li><strong>JSON Schema over Yup and Zod</strong>: While yup and zod are popular validation libraries, we opted for JSON Schema due to its specification-based approach. JSON Schema&#39;s ability to serialize validation rules into JSON format aligns seamlessly with backend-driven systems, making it an ideal choice for our use case.</li></ol><p><strong>Conclusion</strong></p><p>Implementing backend-driven dynamic forms can significantly enhance form management capabilities for applications requiring a large number of constantly evolving forms. By leveraging technologies like react-hook-forms for efficient form management and AGV with JSON Schema for robust validations, developers can streamline the process of creating, modifying, and maintaining forms. The initial setup cost is offset by the long-term benefits of a rapid and flexible form management system that reduces developer intervention and ensures a seamless user experience. Whether it&#39;s onboarding banks or creating surveys, backend-driven dynamic forms prove to be a valuable asset for modern web and app platforms.</p><p><em>Stay tuned for Part 2, where we’ll delve into the implementation details. Keep an eye on this space!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e3140e4f6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-zet/backend-driven-dynamic-forms-in-react-react-native-part-1-2e3140e4f6c">Backend-driven dynamic forms in React/React-native: Part 1</a> was originally published in <a href="https://medium.com/tech-at-zet">Tech at ZET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>