How to save the main data of the application on the server?

I am trying to create an API that can be used to update some basic data in my APP. For example, my application contains various drop-down lists for a city, country, etc. Whenever I add new data to these drop-down lists, I need applications to get into this API once a day and get the latest drop-down list data. In addition, if the API requires an older drop-down menu (from older applications), it should be able to return it based on some date request parameter.

What is the best way to create such an AP?

In addition, the API must be RESTful and will be displayed in the Android / iOS environment.

+7
rest api
source share
3 answers

The API should be able to return based on some date request parameter.

Two columns created_at and updated_at can be used in the table schema. So how can this be useful for your situation:

  • Whenever someone enters the api without the date parameter, you return all data created before current time .
  • Whenever someone enters the api with the date parameter, you can return the data created before the value of date parameter.

Obviously, you need to write complete logic for this server-side end.

+3
source share

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

Here are some players:

  • BaasBox: an open source backend
  • Inaction: allows developers to have an instant backend without writing server code.
  • Apigee App Services: Provides many free repositories, push alerts, analytics, etc.
  • Appcelerator: BaaS targets an Enterprise audience.

In the short term, you can try https://www.webscript.io/ to insert fast javascript code to return a JSON response for you.

0
source share

I would suggest @Santanu to use BaaS. I would recommend using BaaS during the development phase of your project.

When the iPhone and Android apps were developed and tested, replace the Baas-based server components with the built-in RESTful server.

This approach has several advantages. It allows you to divide the effort into two separate parts: the client changes your product and creates a server component.

I assume that your current expertise of your company lies in the development of applications, so it’s easier for you to update your applications to use the BaaS API.

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

In applications that use data queries to populate BaaS RESTful API drop-down lists and stable working data models and datasets hosted on BaaS servers, it will be much faster to start creating your own RESTful service.

When you encounter problems, you will be sure that they are in the server-side code. You can run A / B tests with the same Applications against two versions of the server and ensure that the client is the same.

You can continue to use the BaaS server for rapid prototyping and development of API extensions.

0
source share

All Articles