简体   繁体   English

PouchDB和CouchDB和Node Web Api服务器层?

[英]PouchDB with CouchDB with Node Web Api Server Layer?

Just trying to spec out a new system. 只是尝试确定一个新系统。 We want to build a mobile app with offline storage using react-native. 我们希望使用react-native来构建具有离线存储的移动应用程序。

We were originally going to use node and create a web api layer that worked with a MongoDB. 我们最初将使用node并创建一个与MongoDB一起使用的Web api层。 However after looking into offline storage we found PouchDB. 但是,在研究了离线存储之后,我们发现了PouchDB。 But pouch has to use CouchDB. 但是邮袋必须使用CouchDB。 So we are considering using CouchDb and having a flat db layer with all our business and data logic modelled in the apps. 因此,我们正在考虑使用CouchDb并在应用程序中建模所有业务和数据逻辑的平面db层。

However there may be some server side things that we need to do (for example pulling other records from somewhere else in the organisation). 但是,我们可能需要做一些服务器方面的事情(例如,从组织中的其他地方提取其他记录)。

So can we deploy a web api using node alongside CouchDb? 那么我们可以使用节点与CouchDb一起部署Web API吗? How would this work? 这将如何运作? Totally separate or in the same node process? 完全分开还是在同一节点上?

So can we deploy a web api using node alongside CouchDb? 那么我们可以使用节点与CouchDb一起部署Web API吗?

Yes, of course. 当然是。

How would this work? 这将如何运作?

I'm not sure about what solution suites your needs, but one solution is to develop a web app with this tech-stack: NodeJS/Express, CouchDB/PouchDB and ReactJS/MobX. 我不确定哪种解决方案适合您的需求,但是一个解决方案是使用此技术堆栈开发一个Web应用程序:NodeJS / Express,CouchDB / PouchDB和ReactJS / MobX。 One important point about CouchDB is that, you shouldn't think about it like any other database . 关于CouchDB的重要一点是,您不应该像其他任何数据库一样考虑它 Basically, you don't need any server-side code to talk to CouchDB, it can all be done on the client-side with PouchDB. 基本上,您不需要任何服务器端代码即可与CouchDB对话,所有这些都可以在客户端使用PouchDB完成。 The live sync of PouchDB is extremely convenient at handling offline/online storage. PouchDB的实时同步在处理离线/在线存储时非常方便。 If you're considering ReactJS, take a look at MobX . 如果您正在考虑ReactJS,请查看MobX

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM