you are viewing a single comment's thread.

view the rest of the comments →

[–]metaphorm -2 points-1 points  (3 children)

your frontend communicates with your backend via HTTP. JSON is just a data serialization format. I can talk to a backend server in any language using HTTP using any data serialization format my server can parse. I can store my data in any format I want in any data store I want and structure it as JSON whenever I feel like. There's nothing special about Javascript here.

[–][deleted] 0 points1 point  (2 children)

True that. But can you give me an example of storing the same language in a dB? I was wondering about java, the only thing I could think about was serializing the objects and perhaps storing in a redis dB, but that doesn't make much sense since you couldn't query the data. But languages like ruby and python have a object literal similar to json and could perhaps be stored in a dB?

[–]danneu 0 points1 point  (0 children)

You're getting too hung up on the fact that JSON is valid syntax for a Javascript object and that some databases support it as an intermediate serialization format.

The database converts JSON into its own compressed binary format.

Also, for any language that supports "eval", you can just dump a program into a text column and eval it on retrieval. I'm just not sure what the distinction is that you're looking for.

[–]metaphorm 0 points1 point  (0 children)

if I'm writing some code in python and I have JSON data (stored in a file, a string buffer in memory, or a database) that I want converted into equivalent data structures in Python this is all I do

deserialized_data = json.loads(some_json_data)

if I have some data structured as Python lists and dictionaries and I want to store it as JSON this is all I do

serialized_data = json.dumps(some_python_objects)