0

I'm building a pretty straightforward Node/Express web app that pulls in data from the Reddit API, does some manipulation on it, and then plan to visualizes said data through Charts.js client side. However, being relatively new to fullstack dev work, I'm wondering how to best approach the data manipulation aspect.

Currently, I have 100 comments being pulled at a time and am doing manipulation on those posts server side and then pushing that JSON to the client side for the data viz. Since there is no data persistence between searches and the data itself isn't confidential, is it more efficient to just send the original JSON for data manipulation to be done client side as well?

cn1993
  • 59
  • 2
  • 9

1 Answers1

0

There is no best approach, just different tradeoffs depending on what you choose.

Parsing on the server:

Some Pros:

You are able to reduce the amount of front-end code needed.
You can hide any code from the client that you don't want users seeing You have better control/understanding of what resources the parsing computer will have

Some Cons:

You need to Parse all the data for every request!

Parsing in a client:

Lets keep this DRY:

Some Pros:

Opposite of servier side parsing con

Some Cons:

Opposite of server side parsing pros

Recommended Approach:

Weigh the pros/cons of each method, think about the required resources needed for the maximum scale you would ever expect, multiply those resources by 10, and then make a decision.

user2263572
  • 5,435
  • 5
  • 35
  • 57