Can a js object be serialized?

  node.js, question

In fact, the original question is:

How many attributes can a js object have to guarantee good performance?

According to the discussion, the actual problem has become the current one.

The code is as follows

var People = function(){
 this.a, this.b, this.c;
 this.say = function(){console.log(a)}
 this.setA = function(a){this.a = a;  bracket
 this.otherFunc = function(){
 xxxx this.b xxxx
 this.anotherFunction = function(){xxxxxxxxxxx} = function(){..........}
 var p = new People();
 How to serialize p can ensure that the property value in p remains the same as before when p is deserialized and taken out?
 Pickle in Python can persist storage objects, like and in  node?

Original question dividing line-

The problem scenario is as follows: I need to do a message queue to store the callback function containing response. Now I use object object as Hash data structure to save the message, as follows:

var obj = {};
 var Message = function(){
 this.push = function(uuid, callback){
 obj[uuid] = cb;
 this.pop = function(uuid){
 var callback = obj[uuid]
 delete obj[uuid]
 return callback;
 module.exports = new Message()

message = require './message'
 uuid = require xxxx
 http = require xxx
 socket_io = require xxxx
 server = http.createServer((req, resp)->
 mid = uuid.v1()
 message.push(mid, (data)-> resp.send(data))
 socket_io.emit("xxx", {xxxx:xx})
 io.on("connection", (socket)->
 socket.on("xxxx", (mid, data)->
 cb = message.pop(mid)

I want to know.obj = {}Is there an upper limit on the number of attributes? Under the condition that the program can run correctly, is there a theoretical value and an actual value to determine the upper limit of the number of this attribute? Is this actual and theoretical value related to memory size? In addition, is there a better implementation?

If redis or mongo is recommended for persistent storage, the existence of memory inside is not safe after all, in case of crash. . .