TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Learning about building stateless servers

3 点作者 hhimanshu将近 12 年前
One of the things that I am working on in my project is to build the stateless server, so that scaling becomes easy as more requests come in.<p>- One of the key things is how to handle user authentication in such scenarios<p>- One of the methods that I have used in past is, server sending the immutable token(os username, md5(password)) and client sends that token with each request<p>- Problem? It turns out to be expensive because with each call I need do validate username, password against database and surely it will become performance bottleneck<p>- I heard today another approach where servers signs the token(with some data and timestamp(is needed)) and sends it to client. The client(read Backbone, Angular, etc) will intercept HTTP calls and send this token to server on each subsequent request<p>- Advantage? You no longer need to persist cookies on the disk(better security) and server on receiving token decrypts data and validates that it can read the information(no database lookup, voila!)<p>- What I need? I would like to learn more about second approach, where is it being used, how servers signs the data and validates it<p>Please share your experiences, I am listening

暂无评论

暂无评论