[{"data":1,"prerenderedAt":1211},["ShallowReactive",2],{"blog-json-in-postgres-with-golang":3,"blog-all-for-related":755},{"id":4,"title":5,"author":6,"body":7,"cardAlt":5,"categories":739,"description":743,"draft":744,"extension":745,"headerImage":746,"keywords":747,"meta":748,"name":749,"navigation":412,"path":750,"seo":751,"series":6,"stem":752,"updated":6,"year":753,"__hash__":754},"blog\u002Fblog\u002Fjson-in-postgres-with-golang.md","Storing JSON in Postgres with Golang",null,{"type":8,"value":9,"toc":731},"minimark",[10,14,19,31,35,43,46,60,90,101,727],[11,12,13],"p",{},"There are cases when you want to store JSON blob directly instead of storing across multiiple tables. In this tutorial we will learn how to store JSON objects in Postgres and how we can implement that in Golang.",[15,16,18],"h2",{"id":17},"understanding-json-data-types-in-postgres","Understanding JSON data types in Postgres",[11,20,21,22,26,27,30],{},"PostgreSQL provides with two JSON-related data types that help us with this — ",[23,24,25],"code",{},"JSON"," and ",[23,28,29],{},"JSONB",". Both full-fill our usecase but why does Postgres provide us with 2 data types but there is a major difference in terms of efficiency.",[32,33,25],"h3",{"id":34},"json",[11,36,37,38,42],{},"This stores the ",[39,40,41],"strong",{},"exact copy"," of the JSON input. This means that you need to parse this whenever you need this. So Insertion is fast but we need to parse this everytime.",[32,44,29],{"id":45},"jsonb",[11,47,48,49,51,52,55,56,59],{},"Instead of storing the exact copy, ",[23,50,29],{}," stores a ",[39,53,54],{},"binary representation"," of the input. Now you will not have to reparse this since its already stored in decomposed binary format which ",[39,57,58],{},"makes it slower to insert but faster to query",". But, that's not all, there are more advantages which come with this.",[61,62,63,67,70,73,82],"ul",{},[64,65,66],"li",{},"It supports indexing.",[64,68,69],{},"Remove white space.",[64,71,72],{},"Key order is not preserved.",[64,74,75,76,78,79,81],{},"Duplicate keys are not allowed. ",[23,77,25],{}," will store duplicate but ",[23,80,29],{}," will only store last value.",[64,83,84,85,89],{},"It has ",[86,87,88],"em",{},"existence"," operator that tests whether a string appears as an object key or array element at the top level of the jsonb value.",[11,91,92,93,100],{},"You can explore more details with examples in the ",[94,95,99],"a",{"href":96,"rel":97},"https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002F9.4\u002Fdatatype-json.html",[98],"nofollow","official Postgres documentation",".",[102,103,104,107,111,114,186,189,311,314,333,335,339,348,351,506,513,522,528,534,705,708,710,713,722],"ads",{},[105,106],"hr",{},[15,108,110],{"id":109},"storing-json-object-in-postgres","Storing JSON object in Postgres",[11,112,113],{},"Now it's time to show how we can store JSON object in Postgres. We will create a order where we have a shopping cart which contains list of items. This cart will be stored as JSON object. First, let's create a order table.",[115,116,121],"pre",{"className":117,"code":118,"language":119,"meta":120,"style":120},"language-sql shiki shiki-themes github-light github-dark","CREATE TABLE order\n(\n    cart_id int PRIMARY KEY,\n    user_id int NOT NULL,\n    cart JSONB,\n);\n","sql","",[23,122,123,139,146,161,174,180],{"__ignoreMap":120},[124,125,128,132,135],"span",{"class":126,"line":127},"line",1,[124,129,131],{"class":130},"szBVR","CREATE",[124,133,134],{"class":130}," TABLE",[124,136,138],{"class":137},"sScJk"," order\n",[124,140,142],{"class":126,"line":141},2,[124,143,145],{"class":144},"sVt8B","(\n",[124,147,149,152,155,158],{"class":126,"line":148},3,[124,150,151],{"class":144},"    cart_id ",[124,153,154],{"class":130},"int",[124,156,157],{"class":130}," PRIMARY KEY",[124,159,160],{"class":144},",\n",[124,162,164,167,169,172],{"class":126,"line":163},4,[124,165,166],{"class":144},"    user_id ",[124,168,154],{"class":130},[124,170,171],{"class":130}," NOT NULL",[124,173,160],{"class":144},[124,175,177],{"class":126,"line":176},5,[124,178,179],{"class":144},"    cart JSONB,\n",[124,181,183],{"class":126,"line":182},6,[124,184,185],{"class":144},");\n",[11,187,188],{},"We will add 2 items to the cart table.'",[115,190,192],{"className":117,"code":191,"language":119,"meta":120,"style":120},"INSERT INTO order (cart_id, user_id, cart) VALUES ('1', '123',\n'{\n  \"items\": [\n    {\n      \"item_id\": 111,\n      \"name\": \"T-shirt\",\n      \"quantity\": 1,\n      \"price\": 250\n    },\n    {\n      \"item_id\": 222,\n      \"name\": \"Trousers\",\n      \"quantity\": 1,\n      \"price\": 600\n    }\n  ]\n}');\n",[23,193,194,220,225,230,235,240,245,251,257,263,268,274,280,285,291,297,303],{"__ignoreMap":120},[124,195,196,199,202,205,208,212,215,218],{"class":126,"line":127},[124,197,198],{"class":130},"INSERT INTO",[124,200,201],{"class":144}," order (cart_id, user_id, cart) ",[124,203,204],{"class":130},"VALUES",[124,206,207],{"class":144}," (",[124,209,211],{"class":210},"sZZnC","'1'",[124,213,214],{"class":144},", ",[124,216,217],{"class":210},"'123'",[124,219,160],{"class":144},[124,221,222],{"class":126,"line":141},[124,223,224],{"class":210},"'{\n",[124,226,227],{"class":126,"line":148},[124,228,229],{"class":210},"  \"items\": [\n",[124,231,232],{"class":126,"line":163},[124,233,234],{"class":210},"    {\n",[124,236,237],{"class":126,"line":176},[124,238,239],{"class":210},"      \"item_id\": 111,\n",[124,241,242],{"class":126,"line":182},[124,243,244],{"class":210},"      \"name\": \"T-shirt\",\n",[124,246,248],{"class":126,"line":247},7,[124,249,250],{"class":210},"      \"quantity\": 1,\n",[124,252,254],{"class":126,"line":253},8,[124,255,256],{"class":210},"      \"price\": 250\n",[124,258,260],{"class":126,"line":259},9,[124,261,262],{"class":210},"    },\n",[124,264,266],{"class":126,"line":265},10,[124,267,234],{"class":210},[124,269,271],{"class":126,"line":270},11,[124,272,273],{"class":210},"      \"item_id\": 222,\n",[124,275,277],{"class":126,"line":276},12,[124,278,279],{"class":210},"      \"name\": \"Trousers\",\n",[124,281,283],{"class":126,"line":282},13,[124,284,250],{"class":210},[124,286,288],{"class":126,"line":287},14,[124,289,290],{"class":210},"      \"price\": 600\n",[124,292,294],{"class":126,"line":293},15,[124,295,296],{"class":210},"    }\n",[124,298,300],{"class":126,"line":299},16,[124,301,302],{"class":210},"  ]\n",[124,304,306,309],{"class":126,"line":305},17,[124,307,308],{"class":210},"}'",[124,310,185],{"class":144},[11,312,313],{},"You can verify the insert using",[115,315,317],{"className":117,"code":316,"language":119,"meta":120,"style":120},"select cart from order;\n",[23,318,319],{"__ignoreMap":120},[124,320,321,324,327,330],{"class":126,"line":127},[124,322,323],{"class":130},"select",[124,325,326],{"class":144}," cart ",[124,328,329],{"class":130},"from",[124,331,332],{"class":144}," order;\n",[105,334],{},[15,336,338],{"id":337},"storing-json-in-postgres-using-golang","Storing JSON in Postgres using Golang",[11,340,341,342,347],{},"Note: If you are not familiar with basic query on Postgres in Golang. I recommend to read through ",[94,343,346],{"href":344,"rel":345},"https:\u002F\u002Fwww.calhoun.io\u002Fusing-postgresql-with-go\u002F",[98],"this article"," first.",[11,349,350],{},"First we need to create appropriate structs based on JSON keys.",[115,352,356],{"className":353,"code":354,"language":355,"meta":120,"style":120},"language-go shiki shiki-themes github-light github-dark","type Order struct {\n  CartID int `json:\"cart_id\"`\n  UserID int `json:\"user_id\"`\n  Cart Cart `json:\"cart\"`\n}\n\ntype Cart struct {\n  Items []CartItem `json:\"items\"`\n}\n\ntype CartItem struct {\n  ItemID       uuid.UUID `json:\"id\"`\n  Name         string    `json:\"name\"`\n  Quantity     int       `json:\"quantity,omitempty\"`\n  Price        int       `json:\"price,omitempty\"`\n}\n","go",[23,357,358,372,382,392,403,408,414,425,436,440,444,455,471,482,492,502],{"__ignoreMap":120},[124,359,360,363,366,369],{"class":126,"line":127},[124,361,362],{"class":130},"type",[124,364,365],{"class":137}," Order",[124,367,368],{"class":130}," struct",[124,370,371],{"class":144}," {\n",[124,373,374,377,379],{"class":126,"line":141},[124,375,376],{"class":144},"  CartID ",[124,378,154],{"class":130},[124,380,381],{"class":210}," `json:\"cart_id\"`\n",[124,383,384,387,389],{"class":126,"line":148},[124,385,386],{"class":144},"  UserID ",[124,388,154],{"class":130},[124,390,391],{"class":210}," `json:\"user_id\"`\n",[124,393,394,397,400],{"class":126,"line":163},[124,395,396],{"class":144},"  Cart ",[124,398,399],{"class":137},"Cart",[124,401,402],{"class":210}," `json:\"cart\"`\n",[124,404,405],{"class":126,"line":176},[124,406,407],{"class":144},"}\n",[124,409,410],{"class":126,"line":182},[124,411,413],{"emptyLinePlaceholder":412},true,"\n",[124,415,416,418,421,423],{"class":126,"line":247},[124,417,362],{"class":130},[124,419,420],{"class":137}," Cart",[124,422,368],{"class":130},[124,424,371],{"class":144},[124,426,427,430,433],{"class":126,"line":253},[124,428,429],{"class":144},"  Items []",[124,431,432],{"class":137},"CartItem",[124,434,435],{"class":210}," `json:\"items\"`\n",[124,437,438],{"class":126,"line":259},[124,439,407],{"class":144},[124,441,442],{"class":126,"line":265},[124,443,413],{"emptyLinePlaceholder":412},[124,445,446,448,451,453],{"class":126,"line":270},[124,447,362],{"class":130},[124,449,450],{"class":137}," CartItem",[124,452,368],{"class":130},[124,454,371],{"class":144},[124,456,457,460,463,465,468],{"class":126,"line":276},[124,458,459],{"class":144},"  ItemID       ",[124,461,462],{"class":137},"uuid",[124,464,100],{"class":144},[124,466,467],{"class":137},"UUID",[124,469,470],{"class":210}," `json:\"id\"`\n",[124,472,473,476,479],{"class":126,"line":282},[124,474,475],{"class":144},"  Name         ",[124,477,478],{"class":130},"string",[124,480,481],{"class":210},"    `json:\"name\"`\n",[124,483,484,487,489],{"class":126,"line":287},[124,485,486],{"class":144},"  Quantity     ",[124,488,154],{"class":130},[124,490,491],{"class":210},"       `json:\"quantity,omitempty\"`\n",[124,493,494,497,499],{"class":126,"line":293},[124,495,496],{"class":144},"  Price        ",[124,498,154],{"class":130},[124,500,501],{"class":210},"       `json:\"price,omitempty\"`\n",[124,503,504],{"class":126,"line":299},[124,505,407],{"class":144},[11,507,508,509,512],{},"Now we cannot directly parse the JSON struct since ",[23,510,511],{},"json.Marshal"," works with predefined datatypes. For JSON we need to create two functions -",[11,514,515,518,519,521],{},[23,516,517],{},"Value()"," - This function will return JSON encoding for our ",[23,520,399],{}," struct.",[11,523,524,527],{},[23,525,526],{},"Scan()"," - To parse JSON from database to Go struct.",[11,529,530,531,533],{},"Here is a implementation for the two methods we need for our struct to work. You can simply replace ",[23,532,399],{}," with any struct you are working with.",[115,535,537],{"className":353,"code":536,"language":355,"meta":120,"style":120},"func (c Cart) Value() (driver.Value, error) {\n  return json.Marshal(c)\n}\n\nfunc (c *Cart) Scan(value interface{}) error {\n  b, ok := value.([]byte)\n  if !ok {\n    return errors.New(\"type assertion to []byte failed\")\n  }\n  return json.Unmarshal(b, &c)\n}\n",[23,538,539,576,590,594,598,632,649,660,678,683,701],{"__ignoreMap":120},[124,540,541,544,546,550,552,555,558,561,564,566,568,570,573],{"class":126,"line":127},[124,542,543],{"class":130},"func",[124,545,207],{"class":144},[124,547,549],{"class":548},"s4XuR","c ",[124,551,399],{"class":137},[124,553,554],{"class":144},") ",[124,556,557],{"class":137},"Value",[124,559,560],{"class":144},"() (",[124,562,563],{"class":137},"driver",[124,565,100],{"class":144},[124,567,557],{"class":137},[124,569,214],{"class":144},[124,571,572],{"class":130},"error",[124,574,575],{"class":144},") {\n",[124,577,578,581,584,587],{"class":126,"line":141},[124,579,580],{"class":130},"  return",[124,582,583],{"class":144}," json.",[124,585,586],{"class":137},"Marshal",[124,588,589],{"class":144},"(c)\n",[124,591,592],{"class":126,"line":148},[124,593,407],{"class":144},[124,595,596],{"class":126,"line":163},[124,597,413],{"emptyLinePlaceholder":412},[124,599,600,602,604,606,609,611,613,616,619,622,625,628,630],{"class":126,"line":176},[124,601,543],{"class":130},[124,603,207],{"class":144},[124,605,549],{"class":548},[124,607,608],{"class":130},"*",[124,610,399],{"class":137},[124,612,554],{"class":144},[124,614,615],{"class":137},"Scan",[124,617,618],{"class":144},"(",[124,620,621],{"class":548},"value",[124,623,624],{"class":130}," interface",[124,626,627],{"class":144},"{}) ",[124,629,572],{"class":130},[124,631,371],{"class":144},[124,633,634,637,640,643,646],{"class":126,"line":182},[124,635,636],{"class":144},"  b, ok ",[124,638,639],{"class":130},":=",[124,641,642],{"class":144}," value.([]",[124,644,645],{"class":130},"byte",[124,647,648],{"class":144},")\n",[124,650,651,654,657],{"class":126,"line":247},[124,652,653],{"class":130},"  if",[124,655,656],{"class":130}," !",[124,658,659],{"class":144},"ok {\n",[124,661,662,665,668,671,673,676],{"class":126,"line":253},[124,663,664],{"class":130},"    return",[124,666,667],{"class":144}," errors.",[124,669,670],{"class":137},"New",[124,672,618],{"class":144},[124,674,675],{"class":210},"\"type assertion to []byte failed\"",[124,677,648],{"class":144},[124,679,680],{"class":126,"line":259},[124,681,682],{"class":144},"  }\n",[124,684,685,687,689,692,695,698],{"class":126,"line":265},[124,686,580],{"class":130},[124,688,583],{"class":144},[124,690,691],{"class":137},"Unmarshal",[124,693,694],{"class":144},"(b, ",[124,696,697],{"class":130},"&",[124,699,700],{"class":144},"c)\n",[124,702,703],{"class":126,"line":270},[124,704,407],{"class":144},[11,706,707],{},"Now, your DB queries should work as expected. I am not covering how to make queries in Postgres in this article. I'll leave that as a simple exercise to you.",[105,709],{},[11,711,712],{},"I hope you learned something new. Feel free to suggest improvements ✔️",[11,714,715,716,721],{},"I share regular updates and resources on ",[94,717,720],{"href":718,"rel":719},"https:\u002F\u002Ftwitter.com\u002Fmkfeuhrer",[98],"Twitter",". Let's connect!",[11,723,724],{},[39,725,726],{},"Keep exploring 🔎 Keep learning 🚀",[728,729,730],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":120,"searchDepth":141,"depth":141,"links":732},[733,737,738],{"id":17,"depth":141,"text":18,"children":734},[735,736],{"id":34,"depth":148,"text":25},{"id":45,"depth":148,"text":29},{"id":109,"depth":141,"text":110},{"id":337,"depth":141,"text":338},[740,741,742],"Programming","Database","Golang","Learn how to store JSON objects in Postgres and how to implement it in Golang.",false,"md","blog\u002Fjson-in-postgres-with-golang\u002Fjson-in-postgres-with-golang-card.webp","jsonb in golang, insert json in postgres golang, json db golang",{},"json-in-postgres-with-golang","\u002Fblog\u002Fjson-in-postgres-with-golang",{"title":5,"description":743},"blog\u002Fjson-in-postgres-with-golang","2021-02-13","sncIeSQcLg5vyzqcCmOJgsH8jJXY2HmhXGTztT-7Ufw",[756,763,769,777,786,793,800,807,813,819,825,831,837,843,850,856,862,868,874,880,886,892,898,905,911,917,923,929,935,941,947,949,955,961,967,973,979,985,992,998,1004,1010,1017,1023,1029,1036,1043,1049,1056,1062,1069,1075,1082,1088,1094,1100,1106,1112,1118,1124,1130,1136,1142,1148,1154,1161,1167,1174,1180,1186,1192,1199,1205],{"path":757,"title":758,"description":759,"categories":760,"draft":412,"year":762,"series":6},"\u002Fblog\u002Fai-assisted-workstation","Building an AI-Assisted Personal Workstation","A living log of building a practical AI-assisted workstation for software and startup work.",[761,740],"Productivity","2026-08-08",{"path":764,"title":765,"description":766,"categories":767,"draft":744,"year":768,"series":6},"\u002Fblog\u002Faws-s3-golang","Uploading images to AWS S3 in Golang","In this tutorial I cover how to upload, fetch and manage other operations for objects on AWS S3 in Golang",[742,740],"2020-01-12",{"path":770,"title":771,"description":772,"categories":773,"draft":744,"year":776,"series":6},"\u002Fblog\u002Fbooks-for-engineers","Best Books for Software Engineers","Best Books to help you build you software engineering career - ranging from fundamentats, interview prep to productivity.",[774,775],"Books","Life","2021-12-26",{"path":778,"title":779,"description":780,"categories":781,"draft":744,"year":785,"series":6},"\u002Fblog\u002Fbuilding-acrons","Building Acrons 🚀","Building Acrons, a one-stop tool to decode everyday acronyms like DIY, FOMO, and BRB without losing your flow.",[782,783,784],"Side Projects","Web","Tools","2020-05-26",{"path":787,"title":788,"description":789,"categories":790,"draft":744,"year":792,"series":6},"\u002Fblog\u002Fcap-theorem","CAP Theorem Explained","Learn the concept and misconceptions around popular CAP theorem in system design.",[791,740],"System Design","2021-07-26",{"path":794,"title":795,"description":796,"categories":797,"draft":744,"year":799,"series":6},"\u002Fblog\u002Fcode-reviews","Code Review Checklist","Why code reviews matter, and best practices that catch bugs early and keep code quality high before merge.",[798],"Engineering Principles","2020-07-20",{"path":801,"title":802,"description":803,"categories":804,"draft":744,"year":806,"series":6},"\u002Fblog\u002Fdark-mode","Add Dark mode to websites","Dark mode is ❤️️ Add it to your websites with little CSS and JS",[805,783],"Javascript","2020-07-04",{"path":808,"title":809,"description":810,"categories":811,"draft":744,"year":812,"series":6},"\u002Fblog\u002Fdate-time-golang","Working with Date and Time in Go","Learn how to use time in Golang - Multiple formats, locations and using date.",[742,740],"2020-10-09",{"path":814,"title":815,"description":816,"categories":817,"draft":744,"year":818,"series":6},"\u002Fblog\u002Fdefer-in-golang","Understanding Defer In Golang","Learn about defer keyword in golang and how it can help you avoid panics due to bugs.",[742,740],"2021-05-05",{"path":820,"title":821,"description":822,"categories":823,"draft":744,"year":824,"series":6},"\u002Fblog\u002Fenums-golang","Implementing Enums in Golang","Enums are a way to defined set of constant values. Learn how to implement enums in Go using iota with examples.",[742,740],"2021-12-18",{"path":826,"title":827,"description":828,"categories":829,"draft":744,"year":830,"series":6},"\u002Fblog\u002Fenvironment-variable-golang","Guide to Environment variables in Go","Learn what are environment variables and how to use them in Go",[742,740],"2020-08-14",{"path":832,"title":833,"description":834,"categories":835,"draft":744,"year":836,"series":6},"\u002Fblog\u002Ferror-handling-golang","Handle errors the right way — Golang","How to handle errors in golang to make your life easy",[742,740],"2020-01-30",{"path":838,"title":839,"description":840,"categories":841,"draft":744,"year":842,"series":6},"\u002Fblog\u002Ffile-upload-golang","Uploading Files in Golang with Multipart Request","Learn how to upload files from your client to server as a multipart request in Golang.",[742,740],"2021-03-13",{"path":844,"title":845,"description":846,"categories":847,"draft":744,"year":849,"series":6},"\u002Fblog\u002Fgit-branch","Git Branch 101","Branching is a new path of development that makes it a lot easier to build features. Learn why and how to use branching in git.",[848,740],"Git","2022-03-20",{"path":851,"title":852,"description":853,"categories":854,"draft":744,"year":855,"series":6},"\u002Fblog\u002Fgit-pull-request-template","Guide to Pull Request Templates","Improve collaboration and code reviews with pull request templates. Blog include PR template and how to create one on github\u002Fgitlab",[848,740],"2023-08-24",{"path":857,"title":858,"description":859,"categories":860,"draft":744,"year":861,"series":6},"\u002Fblog\u002Fgit-remove-sensitive-info","Securing Git: Remove Sensitive Information","Protect your code from security breaches by using BFG tool to remove sensitive information from Git history. Learn how to do it in this comprehensive guide.",[848,740],"2023-10-16",{"path":863,"title":864,"description":865,"categories":866,"draft":744,"year":867,"series":6},"\u002Fblog\u002Fgit-tags-explained","Git tags : Explained","What Git tags are, why and when to use them, and how to start tagging releases in your own projects.",[848,740],"2020-06-18",{"path":869,"title":870,"description":871,"categories":872,"draft":744,"year":873,"series":6},"\u002Fblog\u002Fgo-dependency-injection","Dependency Injection in Go using Wire","Learn about dependency injection, its benefits and how to implement it in Go services using wire",[742,740],"2022-11-26",{"path":875,"title":876,"description":877,"categories":878,"draft":744,"year":879,"series":6},"\u002Fblog\u002Fgo-generics","Introduction to Generics in Go","Learn about generics in Golang, it's benefits and how to implement it in applications.",[742,740],"2022-11-27",{"path":881,"title":882,"description":883,"categories":884,"draft":744,"year":885,"series":6},"\u002Fblog\u002Fgo-in-memory-cache","Building In-Memory Cache in Go","Learn about in-memory caching in Golang, it's benefits and how to implement it with and without generics with a TTL(expiry).",[742,740],"2024-03-28",{"path":887,"title":888,"description":889,"categories":890,"draft":744,"year":891,"series":6},"\u002Fblog\u002Fgo-makefile","Ultimate Makefile for Golang","Boost your productivity and save time with ultimate Makefile for Golang projects.",[742,740],"2024-06-10",{"path":893,"title":894,"description":895,"categories":896,"draft":744,"year":897,"series":6},"\u002Fblog\u002Fgo-middleware","Mastering Middlewares in Golang","Learn about middlewares, their use cases and how to implement them in Golang applications",[742,740],"2022-03-13",{"path":899,"title":900,"description":901,"categories":902,"draft":744,"year":904,"series":6},"\u002Fblog\u002Fgo-naming-conventions","Naming Conventions in Golang","Why naming conventions matter in Go, with best practices and practical examples for clear, readable, maintainable code.",[742,740,903],"Code Quality","2023-05-19",{"path":906,"title":907,"description":908,"categories":909,"draft":744,"year":910,"series":6},"\u002Fblog\u002Fgo-with-redis","Go with Redis","A practical introduction to using Redis with Golang to make your applications faster with in-memory data storage.",[742,741,740],"2020-05-03",{"path":912,"title":913,"description":914,"categories":915,"draft":744,"year":916,"series":6},"\u002Fblog\u002Fgolang-maps","Learn Maps in Golang (with examples)","A complete guide to maps in Golang: creating maps, adding and removing items, iterating, and how map equality works.",[742,740],"2020-09-10",{"path":918,"title":919,"description":920,"categories":921,"draft":744,"year":922,"series":6},"\u002Fblog\u002Fguide-to-cdn","Guide to Content Delivery Network","CDN is one of the backbone of modern world internet infrastructure. Learn about Content Delivery Network, it's working, types and benefits.",[791,740],"2022-01-23",{"path":924,"title":925,"description":926,"categories":927,"draft":744,"year":928,"series":6},"\u002Fblog\u002Fguide-to-rule-engines","Guide to Rule Engines","Rule Engines help in solving changing business requirements with ease. Learn all about Rule engines, it's working, benefits and how to implement one in Golang",[742,740],"2022-09-12",{"path":930,"title":931,"description":932,"categories":933,"draft":744,"year":934,"series":6},"\u002Fblog\u002Fhexagonal-architecture","Guide to Hexagonal Architecture","Learn how to design efficient application with hexagonal architecture with practical example",[791,740],"2020-12-13",{"path":936,"title":937,"description":938,"categories":939,"draft":744,"year":940,"series":6},"\u002Fblog\u002Fhttp-status-codes","Learn HTTP Status Codes","A tour of HTTP response status codes, what each class means, and when to use which code in your applications.",[783,740],"2020-07-30",{"path":942,"title":943,"description":944,"categories":945,"draft":744,"year":946,"series":6},"\u002Fblog\u002Fintroduction-to-goroutines","Introduction to Goroutines","Understand the basics of concurrency and learn how to work with Goroutines in golang.",[742,740],"2021-04-10",{"path":750,"title":5,"description":743,"categories":948,"draft":744,"year":753,"series":6},[740,741,742],{"path":950,"title":951,"description":952,"categories":953,"draft":744,"year":954,"series":6},"\u002Fblog\u002Fjson-web-token","Complete Guide to JWT","JSON Web Tokens are a very compact way to carry information. Learn about JWTs in depth, from its structure to when to use it.",[740,783],"2021-11-20",{"path":956,"title":957,"description":958,"categories":959,"draft":744,"year":960,"series":6},"\u002Fblog\u002Flearn-to-say-no","Learning to say No","Learn why it's important to say 'NO'. How it helps in increasing productivity and explore strategies for saying No",[775,774],"2022-04-09",{"path":962,"title":963,"description":964,"categories":965,"draft":744,"year":966,"series":6},"\u002Fblog\u002Flearn-unlearn-relearn","Learn - Unlearn - Relearn","Unlearning things to learn new is the way to grow. Discover how to do that!",[761,775],"2020-09-25",{"path":968,"title":969,"description":970,"categories":971,"draft":744,"year":972,"series":6},"\u002Fblog\u002Flinting-in-golang","Introduction to Linting in Go","Introduction to improving code quality using linting. Learn how to add linting in your Go projects.",[742,740],"2021-07-07",{"path":974,"title":975,"description":976,"categories":977,"draft":744,"year":978,"series":6},"\u002Fblog\u002Fload-balancing","Load Balancing 101","Complete guide on load balancers explaining the internal working and how does it help in making applications efficient.",[791,740],"2021-05-29",{"path":980,"title":981,"description":982,"categories":983,"draft":744,"year":984,"series":6},"\u002Fblog\u002Fmaking-decisions-the-right-way","Making Decisions: The right way","Decisions are hard! Learn how to make the right decisions always",[761,775],"2020-06-07",{"path":986,"title":987,"description":988,"categories":989,"draft":744,"year":991,"series":6},"\u002Fblog\u002Fmanage-logs-with-logrotate","Using Logrotate to manage logs","Learn how to use logrotate system utility to manage logs with example",[990,740],"Linux","2020-09-08",{"path":993,"title":994,"description":995,"categories":996,"draft":744,"year":997,"series":6},"\u002Fblog\u002Fmarshal-structs-golang","Marshal structs the right way: Golang","Why Golang marshals empty structs into your JSON instead of null, and how to marshal structs the right way.",[742,740],"2020-03-31",{"path":999,"title":1000,"description":1001,"categories":1002,"draft":744,"year":1003,"series":6},"\u002Fblog\u002Fnotes-almanack-naval","Book Notes : Almanack of Naval Ravikant","My notes\u002Fhighlights from Almanack of Naval Ravikant book by Eric Jorgenson",[774,775],"2020-10-17",{"path":1005,"title":1006,"description":1007,"categories":1008,"draft":744,"year":1009,"series":6},"\u002Fblog\u002Fnotes-anything-you-want","Book Notes : Anything you want","My notes\u002Fhighlights from Anything you want book by Derek Sivers",[774,775],"2021-09-25",{"path":1011,"title":1012,"description":1013,"categories":1014,"draft":744,"year":1016,"series":6},"\u002Fblog\u002Fnotes-getting-real","Book Notes : Getting Real","My notes and highlights from Getting Real by Jason Fried and David Heinemeier Hansson on building web applications.",[774,1015],"Startups","2020-11-03",{"path":1018,"title":1019,"description":1020,"categories":1021,"draft":744,"year":1022,"series":6},"\u002Fblog\u002Fnotes-hell-yeah-or-no","Book Notes : Hell Yeah or No","My notes\u002Fhighlights from Hell Yeah or No book by Derek Sivers",[774,775],"2020-09-16",{"path":1024,"title":1025,"description":1026,"categories":1027,"draft":744,"year":1028,"series":6},"\u002Fblog\u002Fnotes-how-to-be-a-capitalist","Book Notes : How to Be a Capitalist Without Any Capital","My notes\u002Fhighlights from How to Be a Capitalist Without Any Capital by Nathan Latka",[774,1015],"2020-01-07",{"path":1030,"title":1031,"description":1032,"categories":1033,"draft":744,"year":1035,"series":6},"\u002Fblog\u002Fnotes-lean-b2b","Book Notes : Lean B2B","My notes and highlights from Lean B2B by Étienne Garbugli on assessing markets, building MVPs, and selling to businesses.",[774,1034],"Entrepreneurship","2022-07-02",{"path":1037,"title":1038,"description":1039,"categories":1040,"draft":744,"year":1042,"series":6},"\u002Fblog\u002Fnotes-lets-talk-money","Book Notes : Let's Talk Money","My notes and highlights from Let's Talk Money by Monica Halan on managing personal finances and savings.",[774,1041],"Personal Finance","2021-02-26",{"path":1044,"title":1045,"description":1046,"categories":1047,"draft":744,"year":1048,"series":6},"\u002Fblog\u002Fnotes-obviously-awesome","Book Notes : Obviously Awesome","My notes and highlights from Obviously Awesome by April Dunford on product positioning and marketing strategy.",[774,1015],"2020-04-26",{"path":1050,"title":1051,"description":1052,"categories":1053,"draft":744,"year":1055,"series":6},"\u002Fblog\u002Fnotes-refactoring-ui","Book Notes: Refactoring UI","My notes and highlights from Refactoring UI by Adam Wathan and Steve Schoger, full of practical design tips for engineers.",[774,1054],"Design","2020-05-09",{"path":1057,"title":1058,"description":1059,"categories":1060,"draft":744,"year":1061,"series":6},"\u002Fblog\u002Fnotes-rework","Book Notes: Rework","My notes and highlights from Rework by Jason Fried and David Heinemeier Hansson on a better way to succeed in business.",[774,1015],"2021-04-14",{"path":1063,"title":1064,"description":1065,"categories":1066,"draft":744,"year":1068,"series":6},"\u002Fblog\u002Fone-on-one-meetings","Guide to Effective 1:1 Meetings","One on One meetings are important for your personal & professional growth. Learn how to master 1:1s with your manager and peers.",[1067,761],"Career","2023-03-05",{"path":1070,"title":1071,"description":1072,"categories":1073,"draft":744,"year":1074,"series":6},"\u002Fblog\u002Fpersonal-okrs","Personal OKRs for Success","Why one should set personal OKRs and how to achieve success with them",[761,775],"2020-06-27",{"path":1076,"title":1077,"description":1078,"categories":1079,"draft":744,"year":1081,"series":6},"\u002Fblog\u002Fpoker-tips","Poker Tips: Johns Hopkins Poker Class","Notes from Johns Hopkins poker course. This guide will help you improve in Poker and win some large pots.",[775,1080],"Poker","2020-06-13",{"path":1083,"title":1084,"description":1085,"categories":1086,"draft":744,"year":1087,"series":6},"\u002Fblog\u002Fpomodoro","Get work done: The Pomo Way","Learn to focus and get productive by following the Pomodoro Technique",[761],"2020-10-24",{"path":1089,"title":1090,"description":1091,"categories":1092,"draft":744,"year":1093,"series":6},"\u002Fblog\u002Fpostgres-constraints","Postgres Constraints","Constraints are line of defense for database. Explore various types of constrainsts in postgres",[741,740],"2020-11-07",{"path":1095,"title":1096,"description":1097,"categories":1098,"draft":744,"year":1099,"series":6},"\u002Fblog\u002Fppf-explained","PPF Explained","Learn basics about Public Provident Fund and why you should invest",[775,1041],"2020-12-24",{"path":1101,"title":1102,"description":1103,"categories":1104,"draft":744,"year":1105,"series":6},"\u002Fblog\u002Fproductivity-chrome-extensions","Boost Productivity with Chrome Extensions","Utitizing chrome extensions to boost your productivity!",[761,784,783],"2020-04-24",{"path":1107,"title":1108,"description":1109,"categories":1110,"draft":744,"year":1111,"series":6},"\u002Fblog\u002Fproductivity-in-vscode","Improve your productivity with VS Code","Key VS Code features like the integrated terminal, shortcuts, and extensions that improved my everyday productivity.",[761,740],"2020-03-12",{"path":1113,"title":1114,"description":1115,"categories":1116,"draft":744,"year":1117,"series":6},"\u002Fblog\u002Freading-101","Improving Reading 101","Why reading matters, how to build a reading habit, and what to read next - from my own journey into books.",[774,775],"2020-04-04",{"path":1119,"title":1120,"description":1121,"categories":1122,"draft":744,"year":1123,"series":6},"\u002Fblog\u002Freverse-proxy","Understanding Reverse Proxy","Learn about reverse proxy, how it is different from forward proxy and explore advantages of using it in system design.",[791,740],"2021-10-03",{"path":1125,"title":1126,"description":1127,"categories":1128,"draft":744,"year":1129,"series":6},"\u002Fblog\u002Frunning-periodic-background-task-golang","Running periodic background tasks in Golang","How to run periodic background tasks in Golang by combining cron-style scheduling with background execution.",[742,740],"2019-11-21",{"path":1131,"title":1132,"description":1133,"categories":1134,"draft":744,"year":1135,"series":6},"\u002Fblog\u002Fsessions-in-golang","Sessions using Golang and Redis","How cookies and sessions work, and how to implement persistent login sessions in Golang using Redis.",[742,741,740],"2020-02-25",{"path":1137,"title":1138,"description":1139,"categories":1140,"draft":744,"year":1141,"series":6},"\u002Fblog\u002Fsolid-dry-kiss-yagni","Solid Dry Kiss Yagni","An introduction to the SOLID, DRY, KISS, and YAGNI principles and how they help you write cleaner, robust code.",[798],"2020-07-17",{"path":1143,"title":1144,"description":1145,"categories":1146,"draft":744,"year":1147,"series":6},"\u002Fblog\u002Fstack-in-golang","Implement Stack in Golang","Learn how to implement stack data structure in Golang (Full code)",[742,740],"2020-09-14",{"path":1149,"title":1150,"description":1151,"categories":1152,"draft":744,"year":1153,"series":6},"\u002Fblog\u002Fstart-oss-today","Start your Open Source journey today","Start your OSS journey with intro to GIT. Participate in Hacktoberfest!",[848,740],"2020-09-19",{"path":1155,"title":1156,"description":1157,"categories":1158,"draft":744,"year":1160,"series":6},"\u002Fblog\u002Fsticky-social-bar","Sticky social share component in HTML","Learn how to build a social media sharing component in HTML and add it to your website.",[740,1159],"Frontend","2021-02-05",{"path":1162,"title":1163,"description":1164,"categories":1165,"draft":744,"year":1166,"series":6},"\u002Fblog\u002Fterm-insurance","Term insurance Simplified","Everything you need to know before you buy a term insurance.",[775,1041],"2020-11-29",{"path":1168,"title":1169,"description":1170,"categories":1171,"draft":744,"year":1173,"series":6},"\u002Fblog\u002Fterminal-output-with-redirection","Handling terminal outputs with Redirection","Learn how to handle terminal outputs with Redirection and saving it to files",[990,1172,740],"Terminal","2020-09-06",{"path":1175,"title":1176,"description":1177,"categories":1178,"draft":744,"year":1179,"series":6},"\u002Fblog\u002Fthink-and-grow-rich","Book Notes: Think and Grow Rich","My notes and highlights from Think and Grow Rich by Napoleon Hill, covering its process for building wealth.",[774,775],"2020-05-19",{"path":1181,"title":1182,"description":1183,"categories":1184,"draft":744,"year":1185,"series":6},"\u002Fblog\u002Ftransactions-postgres-golang","Transactions on Postgres with Golang","Performing Postgres database operations in Golang with GORM, from basic queries to full transaction support.",[742,741,740],"2020-03-18",{"path":1187,"title":1188,"description":1189,"categories":1190,"draft":744,"year":1191,"series":6},"\u002Fblog\u002Fwaitgroups-in-golang","WaitGroups in Golang","Learn about WaitGroups in golang and how to use them to perform concurrent operations without blocking the main thread.",[742,740],"2022-05-31",{"path":1193,"title":1194,"description":1195,"categories":1196,"draft":744,"year":1198,"series":6},"\u002Fblog\u002Fwhat-i-use","What I Use: Products and Softwares","List of what I use in my day to day life ranging from terminal, editors, softwares, devices to accessories",[775,1197],"Tech","2024-06-01",{"path":1200,"title":1201,"description":1202,"categories":1203,"draft":744,"year":1204,"series":6},"\u002Fblog\u002Fyear-in-review-2020","Year in Review: 2020","It's a wrap! 2020 was a crazy year, See how my year went!",[775],"2020-12-31",{"path":1206,"title":1207,"description":1208,"categories":1209,"draft":744,"year":1210,"series":6},"\u002Fblog\u002Fyear-in-review-2021","Year in Review: 2021","It's a wrap! 2021 was a mixed bag, full of ups and downs. Key Goal for 2022: Start now!",[775],"2021-12-31",1787743428119]