Code Monkey home page Code Monkey logo

Comments (4)

tcrowe avatar tcrowe commented on July 30, 2024 5

Good question. I wont speculate either. (well only a little)

One idea I can think of is that you can index all the assets and get access to it for use synchronously. With that it can support most template engines that people like to use. It just passes them this context:

https://hexo.io/docs/templates.html
https://hexo.io/docs/variables.html

For example a recent posts query:

site.posts.sort('date', -1).limit(10).toArray()

It's possible to do a lot more elaborate querying than that!

It's a big advantage not to have to install and manage a database server. Another advantage is being able to open a json file and search all the data in the raw form.

Scaling up is difficult. There are people using it with over 10,000 posts. It would be interesting to hear how that works for them. If we check hexo issues we might be able to find out.

Another json database is https://github.com/louischatriot/nedb which you may have seen. It doesn't have schemas though. The querying is like MongoDB which many libraries like to emulate.

When hexo was made some years ago was there anything that could even provide this functionality? Warehouse might be the best one!

What do you think the most common use case is for hexo blogs? 100 posts or less?

from warehouse.

kosirm avatar kosirm commented on July 30, 2024 4

I was also thinking about this, but from another perspective. Maybe it is even more naive, but I'm thinkig how much would it take, to upgrade datastore with in-memory database (for example LokiJS) for most heavy operations? How much speed improvement woud that give to hexo?

from warehouse.

tomap avatar tomap commented on July 30, 2024

Indeed, I looked at it, and Loki seem to be doing the job: fast, with persistence,...
If we were to do the transition, we would probably need to expose a wrapper over Loki

from warehouse.

tcrowe avatar tcrowe commented on July 30, 2024

I tried LokiJS, nedb, lowdb, and some others. Warehouse has a nicer API. We just need to document it better and support with examples.

from warehouse.

Related Issues (18)

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.