如果它大于10m并将其分为多个流,则在Nodejs中流json对象的最佳实践是什么?
我有一个JSON对象,它是一个大对象。我需要将(写)作为卡夫卡消息发送(写),这需要大量时间。
我需要一种机制来流式json对象,如果它大于10m,请将其分为多个流消息,然后发送。
请帮助我找到最佳练习。
谢谢。
I have a JSON object, it is a big object. I need to send (write) it as a Kafka message and it takes a lot of time.
I need a mechanism to stream the JSON object and if it is bigger than 10M, split it into multiple stream messages and then send it.
Please help me to find a best practice.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果可以在客户端中进行解压缩。我会这样做:
160KB的大小比10MB小得多,应该易于流式传输。
这与Netflix所做的(压缩)相似,这就是为什么他们的电影流在我们电视上如此快的原因
If it is possible to do decompress in the client. I would do :
160KB is a lot smaller than 10MB and should be easy to streamed.
It's similar with what netflix does ( compression ) that's why their movie stream so fast in our TV