Will many client-side calculations harm performance of Ionic app? - performance

I am planning to build a location-aware app with the Ionic framework. It basically comes down to showing a Google map with the location of the user and markers in his neighbourhood. I will only show markers on the visible part of the map.
This excellent tutorial of Josh Morony uses a PHP script on the database. It limits the number of markers returned to the app based on a distance calculation between the user location and all markers stored in a mysql database.
However, I would like to use a Firebase database for my app. This question already points out that server-side calculations are not possible with Firebase.
Would it harm the performance of my app if I would return all markers stored in Firebase and calculate the distance on the client side? I would then limit the markers shown based on those calculations.
Or is it better to limit the number of markers returned after server-side calculations and then load the Google Map Markers?

Related

What design pattern/s best to use when retrieving data series for chart

I have backend API that have group of methods that retrieves some data series for charts in web/mobile apps from database by different sql-queries.
Some data series uses as-is, another - calculated from reteved data series.
At this time I have Controller that call Repository. And if I need to calculate data then I pass data to math function and get another series.
And I am stuck in how to clearly organize my code. What design-patterns to use? How to separate code?
pls, help :)

Create static content with images and videos and show it in my spring-boot application

I wrote some basic blog system, which based on spring boot.
I'm trying to figure out, how can I create posts with videos and images, without the need to editing everything using HTML.
Right now, I am saving my blog posts in DB as plain text.
Is it possible to create content combined with text, images and videos , and saving this "content" as one row in my DB-Table, without creating connections between different tables?
Many thanks in advance.
Images and Videos are heavy content and storing them in database could be a costly affair, until you are developing application for research purpose. Also querying it from database and serving it over the network can impact your application performance.
If you want to store it in a single row that can be done as well using database BLOB object. But i would suggest to have 2 different tables. One containing the BLOB object of Image and Videos and other is your usual table containing blog as text and primary key of of BLOB table.
If you want to take your solution to go live, better use image-videos hosting servers because of following factors
Saves your database cost
Ensures 24x7 availability
Application performance is faster as these are hosted independent of application
Videos can directly be iframed i.e. you do not need to query complete MBs of record and serve over network
A strict answer to your question, yes, you can use BLOBs to store the video/images in the database. Think about them as a column that contains bytes of video or image.
For school/cases where you have a very small amount of videos/images its probably OK. However if you're building a real application, then don't do it :)
Every DBA will raise a bunch of concerns "why do not use Blobs".
So more realistic approach would be to find some "file-system" like storage (but distributed) style S3 in AWS, hardrive on server if you're not on cloud, etc.
Then store that big image / video there and get an identifier (like path to it if we're talking about the harddrive) and store that identifier in the database along with the metadata that you're already store probably (like blogPostId, type of file, etc.)
Once the application become more "mature" - you can switch the "provider" - Grow as you go. There are even cloud storages designed especially for images (like Cloudinary).

Accessing star ratings from reviews, for multiple businesses

Is it possible to fetch the Google star rating for any business using the Google Places API?
I have a comparison website and want to display the Google star ratings for each business on my site.
Many thanks
Yes. The responses from the Place Search and Place Details APIs include a rating field.
However, two important warnings:
These APIs are both billed, and are quite expensive ($17 and $32 per 1000 requests, respectively). Making a Place Details request for each business displayed in a comparison will probably be economically infeasible.
The Places API policies place a number of requirements on your use of Google's data. In particular, you cannot cache most data returned by the API (including ratings), and you cannot use the data alongside a non-Google map.

Extracting data from bing maps to insert into custom data structures

I'm currently using the Bing Maps API to display a map of a city along with traffic data (such as incident report and traffic flow).
I need to be able to pass a complete list of street segments and intersections of a given area to an AI application to work with. However, all this data, along with the corresponding traffic data I need seems to be bound to the actual map of the API (ie. It can only be displayed and not worked with). Is there any way to extract this information and insert it into a custom made data structure? If not, is there some other map API that is capable of doing this? (although I would prefer work with Bing Maps if possible)
The traffic data can only be used within the Bing Maps controls. This data cannot be extracted from Bing Maps and stored elsewhere. Try taking a look at the HERE Traffic API's: https://developer.here.com/rest-apis/documentation/traffic

Should I use SQL or Core Data?

I'm creating an iPhone app that will have a preloaded set of locations with Lat/Long, currently sqlite DB. I will be calculating the distance of those locations from the users current location and display that in a TableView sorted by distance.
Should I just use the sqlite DB or should I use Core Data?
If I use Core Data, how do I get my initial DB loaded?
Are there any good Core Data tutorials that show how to preload a DB vs all user entry from the app, as my app will have no user entry?
It's philosophy.
If you think in terms of a database, and you design from a data-oriented point of view, then straight sqlite is probably your best choice. There's extra complexity in Core Data but its big benefit is that it accommodates people who think of a program in terms of objects and want some of those objects to stay around between runs of the code.

Resources