How to maintain app master data at server end?

I'm trying to build an API which can be used to update some master data in my APP. For eg. my app contains various dropdowns for city, country etc. Whenever I add new data in these dropdowns, I need the apps to hit this API once a day and get the latest dropdowns data. Also, if the API is requested an older dropdown (from older apps), it should be able to return so based on some date query parameter.

Whats the best way on going about creating such an AP?

Also, the API needs to be RESTful and will be exposed to Android/iOS environments.


API should be able to return so based on some date query parameter.

You can use two columns created_at and updated_at in you tables schema. So how can this will useful for your situation:

  • Whenever some one hitting api without date parameter, you are return all data which are created before current time .
  • Whenever some one hitting api with date parameter then you can return data which are created before value of date parameter.
  • Obviously you have to write complete logic for this at server side end.


    Please explore one of the Mobile Backend as a Service (mBaaS) products for your long term needs.

    Here are some players:

  • BaasBox: Open source backend
  • Backendless: Allows developers to have an instant backend without writing server-side code.
  • Apigee App Services: provides a lot of free storage, push notification, analytics etc.
  • Appcelerator: An BaaS targeted at the Enterprise audience.
  • For the short run you may want to try https://www.webscript.io/ to embed some quick javascript code to return the JSON response for you.


    I would put a spin on @Santanu's suggestion of using BaaS. I would recommend using a BaaS during the development phase of your project.

    When the iPhone and Android Apps have been developed and tested, replace the Baas-based server components with a in-house built RESTful server.

    This approach has a couple of benefits. It lets you divide the effort into two distinct parts: the client changes to your product, and the building of your server component.

    I assume your company's current expertise lies in App development, so it should be easier for you all to upgrade your applications to use the BaaS-based APIs.

    It will also be much easier to reiterate and refine your data components and models using a mature BaaS server.

    With Apps using data requests to populate the drop-downs from a BaaS-based RESTful API, and stable working data models and data sets hosted in the BaaS servers, it will be much faster to start building your own RESTful service.

    When you run into issues, you will be confident they are in the server side code. You can run A/B tests with the same Apps against two versions of the server and ensure the client experience is the same.

    You could continue to use the BaaS Server for rapid prototyping and developing API extensions.

    链接地址: http://www.djcxy.com/p/25532.html

    上一篇: 从JSON moxy输出中重命名“type”

    下一篇: 如何在服务器端维护应用程序主数据?