-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove need for restart of server when creating content. #1256
Comments
Hello @blaasvaer , please follow the issue template so we can get a better understanding about the origin of your bug. |
Added bug templating ... |
@blaasvaer the server needs to restart because the content structure is not stored in the database but in files itself, which in order for those files to be loaded the application needs to restart. They have moved many of the older options (specifically with permissions) over to the database so it doesn't need to restart. Generally when in development like this, the application shouldn't be used in production thus the restarting doesn't affect the progress. Your welcome to generate the APIs over the command line instead and start the server after that. |
I also think that if Strapi use an approach like Meteor framework it's better. @lauriejim , @soupette , @Aurelsicoko Guys please see Meteor CLI and framework approach. |
Our current architecture forces us to restart the server because of new files which are created when you're creating a new content-type. It's important for us to not move the models in the database. We could add an hot-reload feature though. We won't be able to guarantee it works 100% of the time but it could be a great approach to remove the server restart. |
Well, no true dynamic system should ever need a restart when only »content« is manipulated in any way. That would be a faulty architecture. And Content Types in a Headless CMS should also just be considered »content«, as that's what it's all about. Content Types is what an administrator should be able to »administrate« … |
We're not a Headless-CMS. You can use Strapi like that but the product is based on a framework with a similar architecture like Sails, Rails, etc. Creating a Content-Type means create a model at the framework level. It also means setting the new model in Mongoose or Bookshelf, make sure the relationships are correct, etc. We have this architecture to keep Strapi flexible and customisable in any way. If you already have used others frameworks like Laravel, Rails or Symfony, the models are defined into files, not in the database. In Node.js (Koa) to update the route available and to be able to make CRUD actions on a Content-Type, we have to reload the middleware stack because it can't be updated on the fly. In other words, it means to restart the entire server. We're talking about 30s (max) when you create a new Content-Type, it's not so much but I can also understand this is frustrating. We can find a workaround to this technical limitation but I'm not sure it's a good idea. |
Well, in that case you know best. ; ) |
As I said, we could certainly add the hot-reload feature, if the restart is too long for the major part of the community 👍 |
And your intro video on the site gives exactly the impression of a Headless CMS ... and if it's to also be used as that, then a restart of the server for creating a Content Type is not really that cool ; ). |
Well, have to see what the community wants then. |
We're a "new kind" of software, we aim to define us as an "API-first backend solution". We have Headless-CMS capabilities and you can use the product like that, but some people are using us to develop the backend of their marketplaces, mobile apps, etc. |
Kewl. |
I am one of those who is not using this as a Headless-CMS, as a matter of fact I likely won't even have a frontend for the API, we are using Strapi like you would use similar software like Loopback. Hence the reason why I don't view the restarting as a big issue. All of your content-types should be defined in the Not everyone is happy-go-lucky in their development process. That being said the start time with Strapi and using a SQL database like MySQL is quite long at the moment (anywhere from 20s to 60s), but @lauriejim is aware of the issue and knows that bookshelf needs some re-work. @blaasvaer I suggest that if you have issues with how Strapi works, your welcome to fork the project and build it as you see fit, or you could be helpful and submit Pull Requests to help build on the framework. I feel as though your side comments are quite rude personally, and not -at all- helping anyone here, or the project as a whole. |
@derrickmehaffy Excuse me, rude, how!? Have I stepped on some curling kids toes here or what's the case!? |
@blaasvaer the issues section is not the place to discuss this, your welcome to PM me on the slack, and I would be more than willing to talk to you about it. |
Oh, there comes the adult card. Nevermind, I'm not into it. |
Informations
9.0.0
6.0.1
3.0.0-alpha.12.2
MongoDB v3.6.5
Mac OS X Sierra
What is the current behavior?
The server restarts when I create a content type.
Steps to reproduce the problem
Create a content type.
What is the expected behavior?
I would expect the server to just keep running after creating a content type and an entry with a couple of fields.
Why would a whole server need to be restarted when only 'content' is created? Something seems wrong, from an architectural point of view …
Suggested solutions
Well, make is possible to dynamically create content types without requiring a server restart.
The text was updated successfully, but these errors were encountered: