Comments (4)
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.
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.
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.
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)
- Could this be moved to Hexojs org? HOT 2
- Potential mistake prevents model data modification in pre-save hooks HOT 1
- API link broken HOT 2
- pre-save hooks doesn't make sense when use db.load() HOT 2
- Add .travis/ folder to npmignore HOT 1
- Why use stream for warehouse#save()? HOT 4
- package.json engine "6 || 8 || >=10" HOT 3
- How to save changes to the disk immediately after they happen? HOT 1
- the basics HOT 1
- [WIP] Replace typescript HOT 1
- Categories as a tree HOT 2
- API link is broken in readme HOT 4
- Release a new version 3.0.2
- 关于文件重复加载的问题
- Release warehouse@4 HOT 6
- Is there any way to convert it to a plain JavaScript Object? HOT 1
- setting custom path is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warehouse.