How to populate couchdb at first start with static data?

Hello, my team and I are wondering what solution to implement concerning a injection of doctypes during the initialization of our application.

We could store those in json files and do POST queries when the app launches for the first time, but is there another way you would adivse us to do ?


Hello, no I would say what you describe is the recommended way to do it. If you control the server it could be done when the instance is created, or the app could do it asynchronously through a service… but if you don’t have any specific constraints letting the app do POST requests the first time it runs is probably the best way to do it.

1 Like

Please take care that the user may start the application in two tabs, the second one being opened before the first having finished to do its initialization work. The user may also abort an execution at any step.

If you have a lot of work at initialization that shouldn’t be interrupted, you can also trigger a service job and send your POST queries there.

1 Like