Giter Club home page Giter Club logo

Comments (3)

h2atecnologia avatar h2atecnologia commented on May 25, 2024 1

I got it. Your explanation is deeper than this faq. Cache is always a smart solution.
tks again. 👍

from hyper-express.

kartikk221 avatar kartikk221 commented on May 25, 2024

There is no minimal infrastructure special to uWebsocket. You can use both Express/HyperExpress on any hardware and HyperExpress/uWebsocket will beat Express in every way when it comes to pure throughput performance.

What that statement is stating is this: let's say you had a route called /users/:id that made a SELECT query to your SQL database and returned results, you will actually notice that HyperExpress/Express wil have very similar performance. This is simply an illusion because since each request makes an SQL query to your database, you are essentially stressing your database not the webserver. When he says to cache requests as much as possible, he means to implement intermittent caches. So for example, let's say you had an endpoint called /currency/consume which made a third-party API request to retrieve fresh currency data. What you would do to maximize performance is use a package like https://github.com/kartikk221/cached-lookup and put the third-party API behind a 5 second cache. This way if your server got let's say 50k requests/second, your server server will continue to serve the latest cached data from memory while fetching fresh data every 5 seconds as needed. This would make full use of the available throughput without stressing the third-party API.

from hyper-express.

h2atecnologia avatar h2atecnologia commented on May 25, 2024

cached-lookup => Of course, I will include in my PoC.

from hyper-express.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.