← Back to list

JSON Destructuring— handling data with efficiency

Hi everyone,

Tayyebbutt · 2025-08-30 11:51 · 0 claps · 2.8 min read
#data #computer-science #effeciency #software-engineering
Open on Medium ↗
Wiki topics: 🔬 · Science · General

JSON Destructuring— handling data with efficiency

Hi everyone,

So I’m a huge advocate of data efficiency while developing software's for scale.

People often don’t focus on small stuff that cause alot of trouble at scale even when 1k users arrive on the Product for consumption.

Just to clarify one thing which is it’s always been a fight between what to trade : Memory/space or more compute which means time(crazy CPU cycle/spikes)

Photo by Claudio Schwarz on Unsplash

Photo by Claudio Schwarz on Unsplash

JSON Destructuring — what is it ?

JSON(Javascript object Notation) is a data structure in form of which we mostly save data and perform operations on it.

Now my point is at large scale applications — we often work with huge complex business data and we need to handle it with efficiency.

Example :

Imagine, you get a small data related to book from server and you need to show it on UI/App

// JSON destructuring

// Normally we get data in the form of string
// we need to first Parse it to convert it into Data structure

const book = {
    title: "SaaS Sales Mastery",
    author: "Alex harmonzi",
    publishyear: "2019",
    color: "Black",
    total_selling: "20000",
    rating : "5"
}

let {title, author} = book;
console.log(title, author)
// Answer will be SaaS Sales Mastery  Alex harmonzi

now it’s seem easy and simple but knowing it’s utility, working and importance matters alot because it gives you a conscious ability while dealing at scale.

Now imagine you getting this long complex nested Data :

  1. Iterating/Mapping over it will cost you millions of dollars of compute at scale.
  2. Destructuring it while creating new array based on requirement will take memory but reduce compute cost.

Choice === Business requirement


// const restaurant = {
//   "restaurantId": "r_10293",
//   "name": "The Spice House",
//   "location": {
//     "address": "123 Main Street",
//     "city": "Karachi",
//     "geo": {
//       "lat": 24.8607,
//       "lng": 67.0011
//     }
//   },
//   "menu": [
//     {
//       "category": "Starters",
//       "items": [
//         {
//           "id": "i_1",
//           "name": "Spring Rolls",
//           "price": 250,
//           "currency": "PKR",
//           "nutrition": {
//             "calories": 180,
//             "protein": "4g",
//             "fat": "8g"
//           },
//           "availability": {
//             "inStock": true,
//             "deliveryTime": "15-20 mins"
//           }
//         },
//         {
//           "id": "i_2",
//           "name": "Chicken Soup",
//           "price": 300,
//           "currency": "PKR",
//           "nutrition": {
//             "calories": 150,
//             "protein": "10g",
//             "fat": "5g"
//           },
//           "availability": {
//             "inStock": false,
//             "deliveryTime": null
//           }
//         }
//       ]
//     },
//     {
//       "category": "Main Course",
//       "items": [
//         {
//           "id": "i_3",
//           "name": "Biryani",
//           "price": 600,
//           "currency": "PKR",
//           "nutrition": {
//             "calories": 700,
//             "protein": "25g",
//             "fat": "20g"
//           },
//           "availability": {
//             "inStock": true,
//             "deliveryTime": "30-40 mins"
//           },
//           "customizations": [
//             { "option": "Extra Chicken", "price": 150 },
//             { "option": "Double Rice", "price": 100 }
//           ]
//         }
//       ]
//     }
//   ],
//   "ratings": {
//     "average": 4.3,
//     "totalReviews": 1200,
//     "breakdown": {
//       "5": 800,
//       "4": 250,
//       "3": 100,
//       "2": 30,
//       "1": 20
//     }
//   },
//   "offers": [
//     {
//       "code": "WELCOME50",
//       "discount": "50%",
//       "validTill": "2025-12-31",
//       "conditions": ["New users only", "Max discount 300 PKR"]
//     }
//   ]
// }

Handling it with efficiency will create impact in such ways & handling it in worse manner will does opposite of it :

  • Lower churn rate → users stay longer because the UI is smooth and reliable.
  • Higher user satisfaction & trust → fewer bugs, no “undefined” errors, relevant data only.
  • Reduced infrastructure/compute cost → less CPU, memory, and bandwidth wasted.
  • Faster UI performance → lightweight data structures mean quicker rendering.
  • Better network reliability → smaller payloads transfer faster, fewer timeouts.
  • Optimized database usage → storing only what’s needed speeds up queries and saves storage.
  • Easier scaling → clean data handling means adding more users doesn’t overload systems.
  • Improved conversion & revenue → smoother experience drives more engagement and purchases.
  • Lower engineering overhead → fewer production bugs to fix, more focus on features.

메타데이터
post_id
c1b6c1ca41ee
slug
json-destructuring-handling-data-with-efficiency-c1b6c1ca41ee
url
https://medium.com/@tayyebbutt966/json-destructuring-handling-data-with-efficiency-c1b6c1ca41ee
canonical_url
https://medium.com/@tayyebbutt966/json-destructuring-handling-data-with-efficiency-c1b6c1ca41ee
author_url
https://medium.com/@tayyebbutt966
status
ok
fetched_at
2026-08-18 19:56:02