How to handle images in meteor? - mongodb

I'm looking for advice how to handle images in meteor. After some research, I noticed that developers usually prefer to use third party API to deal with images such as cloudinary or Amazon S3 but why? What are the pros and cons of using third party API? Isn't it better to save images locally using techniques that were described here: Meteor: uploading file from client to Mongo collection vs file system vs GridFS ?

It mostly boils down to whether or not to store images in Mongo. Generally, it's not a good idea, though sometimes I do it for quick prototyping, because it's so easy.
Here are the arguments against it:
https://forums.meteor.com/t/any-reason-not-to-store-images-in-mongo/11021

Why Cloudinary?
Cloudinary provides an end-to-end solution and wraps up all of your image needs in one simple and practical solution. From uploading, to string and managing your media assets and to manipulating and delivering your images via world-wide CDN.
While Meteor is not yet officially integrated to Cloudinary, a great library has been contributed by a community member and well serves a lot of Cloudinary's users around the world.
Cloudinary introduces a RESTful API to support every developing environment and to allow integrating to every programming language. All of our SDKs are open-source and therefore can be inspected and imitated as required.
For more information: http://cloudinary.com/documentation/
If you have any further questions, please don't hesitate to ask :)

Related

data persistence on remote server

I'm trying to understand some basic things. I'm a php programmer and I'm interested in flutter. If anyone can answer, I would really appreciate it...
I use mysql in my projects, which are on hostgator. I heard that sqlite is only for local storage and in my case the entire web project will be hosted on the remote server. Can I use sqlite to save my customers' data? Or is there something native better? A big concern of mine!
Is flutter mature enough for robust commercial applications?
Does the documentation indicate when something applies to an earlier version? Or is the information all mixed up and it's up to the programmer to identify when something is only valid for versions prior to flutter 3?
thank you for any guidance
You can use Sqlite, but I would recommend Firestore/Firebase for stuff like that. It's very easy to implement it and they have great solutions for many thigs.
Yes it is! Many commercial applications are running on flutter now. For example the Google Ads app is built with flutter.
I don't really know for sure, but I know that the one time I had a problem with it, it was declared.
I'd prefer saving user's data on the cloud. I personally like Google's firebase which helps with authentication and storage using RealTime Database. It's pretty easy to sync your user's data into the DB and even stores data using cache in case the user is offline and syncs to DB once device is online. You can find more about firebase and their products here.
Flutter is a really great framework to get your apps done for multiple platforms at once, thanks to its cross platform compatibility! If you don't want to spend time creating app for multiple devices, flutter's the way to go. I personally think flutter web is yet to grow, but it will overtime, afterall, it's opensource framework by Google. I'd suggest this idea 8.5/10
Flutter docs are pretty well written and an beginner could get through it with some video examples (included in documentation) as well. In case something you want to use isn't supported in newer version of flutter, the text editor will show a line over the code meaning that it is deprecated and wouldn't be supported. There's always an alternative, which you could find using flutter docs or YouTube. Flutter docs are optimised for beginners 9/10
Ad 1. There is pub.dev- the official package repository for Dart and Flutter. You can find many interesting packages there. They give you possibilities that the native Flutter doesn't give.
For example mysql1- driver for MySQL and MariaDB.

Advices on server implementation for server/client structure iOS App development?

There are must be a lot of apps that are designed to communicate with server. My question is only about App installed on iOS device + Server side service interaction. Web app is not what I am talking about, and there should be no webpage involved in this discussion at all. Typical examples are Apps like Instagram and Twitter, in which most of the information exchanged between the App and the server is just data like String, Image and Integers(wrapped in JSON or XML), no webpage presentation needed.
My question will be: if you are an independent app developer, and you are designing such an app from scratch without any existing website API, database structure or application(so you are not limited by any existing API or database structure or application protocol), What will be the most efficient approach?
What the sever side need to do are:
receive data send by the App;
process the data with designed logic;
interact with database(like MySQL);
do necessary data mining and analysis---this could be a constantly running service or one time task requested by the App client;
send the data back to the App upon request or spontaneously;
exchange or broadcast the data between/among different App clients (i.e.: group chatroom and peer to peer message);
As far I as know there are 3 obvious options to implement the server side:
PHP
Python
Ruby on Rails
(please feel free to add more options)
My questions are:
which one is the most appropriate choice to implement the server side?
If the App is focusing intensively on natural human language/text searching, analyzing and data mining, which one is the best choice? I heard Python is doing pretty good in this area.
Any advice on the database choices? I am using MySQL for now, and I found it's quite powerful for my purposes, I heard Twitter is switching to Cassandra. Will that be too difficult to start with?
For the server end, if you need to build a Server management interface, for you as an admin to manage and monitor the community, membership, data and such, is there any existing solution, or framework or tool for that? what will be the most efficient approach?
If a new programmer has no experience in non of them, which one you suggest he/she to start with?
Is there any good reference material or sample code on the server side in such context we can learn from?
I know there are a lot of very experienced experts on these areas on Stackoverflow, but I saw more newbies who just entered the iOS developing area without much knowledge in server/database programming experience. And I hope this thread can help these who are thinking to design an App with server/client structure but have no idea where to start with.
ps: I will keep updating this question thread and adding my findings on this topic, to help all other users at stackoverflow. :-) Please try to make your answer informative, easy to understand, and constructive. I guess most of readers for this thread will be new members of this great community.
Are you sure you want to spend time & money to develop your own Server & develop your own API?
There are lots of mBaaS (mobile Backend as a Service) providers today such QuickBlox, Parse,StackMob, which are ready to use and they have great Custom Objects API and some of predefined modules. They have great free plans with big quota. Some of them such QuickBlox has Enterprise plan - so you can buy license and they server team update server for you purpose.
So, i recommend not develop your server and think about mBaaS market.
Just about your issue - I can recommend look at QuickBlox Custom Objects code sample and also Custom Objects API. Custom Objects module provides flexibility to define any data structure(schema) you need. Schema is defined in Administration Panel. The schema is called Class and contains field names and their type. I think it's what you need.
which one is the most appropriate choice to implement the server
side?
Well that depends on what you know, there is reason to choice one of the other
If the App is focusing intensively on natural human language/text
searching, analyzing and data mining, which one is the best choice? I
heard Python is doing pretty good in this area.
This would reflect on your first question, you pick the language on you needs. Thus if python makes it easier then pick that one.
Any advice on the database choices? I am using MySQL for now, and I
found it's quite powerful for my purposes, I heard Twitter is
switching to Cassandra. Will that be too difficult to start with?
Again not one that is easy to answer, since it all has to do with requirements. But any SQL server will do. Cassandra is meant for "scalability and high availability without compromising performance" accourding to there website. Do you think you webservice will get many request then it might be a choice to consider.
For the server end, if you need to build a Server management
interface, for you as an admin to manage and monitor the community,
membership, data and such, is there any existing solution, or
framework or tool for that? what will be the most efficient approach?
This again is only going to be answered when you pick the a SQL server and server language.
If a new programmer has no experience in non of them, which one you
suggest he/she to start with?
Start with something simpler, you are really going out on a limb here.
Is there any good reference material or sample code on the server
side in such context we can learn from?
Propably there is some, but you should really start small and work from there.
Twitter started out as a Rub on Rails app and is working on scalability and availability which ruby is not really good ar (that is my person opinion). or Look at facebook they have written a php to c compiler to make php run faster.
The only thing I can say to start code, when you app does take off then tackle the some of the performance issues.
And since you state that you are new to programming do not bite of more then you can chew.
This is a huge question and I don't think there is a best answer. It most depends on what you care about, such as how quickly the development process, how easily the implementation, etc.
And which one is popular, which one is cool, I don't think it make really sense.
In my personal opinion, I'm good at ASP.NET and I can get Windows server easily, so I'll start with an ASP.NET service to provides data.
And, to be continued.

Building a service for my website that has some foursquare features

I am interested in extending my website to provide a service which involves users "check in" in my university's campus. Since Location Based Services (LBS) is pretty new, and there are not much literature around that could provide relevant interests to this matter, I have the following questions to ask:
First, I know that I have to design an Android App and possibly an phone app application. For all I am guessing, foursquare is simply using the client to send data to their webserver back and forth.
What are the standard protocols for the client to communicate with the webserver? (or is it simply just json or xml?)
What kind of special web service do they use on their backend? (Like some research would reveal they are using LIFT, written in Scala which is something that I am not familiar with.).
I know python pretty well. Are there webservers, i.e. django or pylons, that provide similar service to 2) above?
How difficult is this really?
Also, any literature on this subject matter is greatly appreciated.
Use the foursquare API.
They have pre-made libraries for both Django and Python here, those should make it easier to integrate foursquare into your website.
Well, I do think a good first step would be to look at Foursquare's API, both to see if you can simply integrate with their service (i.e. look for check-ins that are to campus buildings or whatever) or just to get a picture of what they're using. Their API seems like a pretty standard web service using XML or JSON, which seems like a good practice for you as well.
There are some challenges in building a scalable web service that will handle geographic data: you'd want a database that can handle geospatial indexing for you (otherwise the algorithms can get a little complex). If you're familiar with Django, GeoDjango might be a good fit for you. I hear that Foursquare is actually switching to use MongoDB, which has some geospatial indexing features: they're likely using a NoSQL database because of their unique scaling issues which you probably don't need to worry about.
Mimicking foursquare isn't a good approach. A solution to your specific functionality needs and load levels will always be custom, not copied. Even the biggest university campus in the world, with every single person using the service, you'd be totally dwarfed by foursquare's user base. So whatever they're doing is WAY higher-end than what you need.
For your purposes, a simple web service is probably more than adequate. I'm building apps that are location-sensitive (arts/cultural events and consumer offers local to the user's current position) right now that hit PHP scripts with query string or posted-data arguments, and consume JSON. Nothing fancy, but I can handle the load on the server side with lightweight technologies I already know, and I know it'll scale to meet my actual load.
Don't be beholden to the way somebody else does it, even if they are the industry leader. Their needs aren't your needs.

Any good client-server data sync frameworks available for iPhone?

I'm just getting into the client-server data sync stage of my iPhone app project, and have managed to get my CoreData data model loading on both the iPhone client and my TurboGears server (which is good). I'm now beginning to tackle the problem of sync'ing data between the server and multiple clients, and while I could roll my own, this seems like one of those problems that is quite general and therefore there should be frameworks or libraries out there that provide a good deal of the functionality.
Does anyone know of one that might be applicable to this environment (e.g. Objective-C on iPhone, pyobjc / Python on the server)? If not, does anyone know of a design pattern or generally-agreed upon approach for this stuff that would be a good road to take for a self-implementation? I couldn't find a generally accepted term for this problem beyond "data synchronization" or "remote object persistence", neither of which hit much useful on Google.
I did come across the Funambol framework which looks like it provides this exact type of functionality, however, it is C++ / Java based and therefore seems like it might not be a good fit for the specific languages in my project.
Any help much appreciated.
Since you are using TurboGears already, take a look at the RestController documentation. Using RESTful services has become a widely adopted architecture with many implementations for both clients and servers. Matt Gemmell's MGTwitterEngine is a good example of the client implementation of a specific API, Twitter.

AJAX or a server side framework?

I am working with a friend on building a web site, in general this web site will be a custom web app along with a very custom social network type of thing..
Currently I have a mock-up site that uses simple PHP with AJAX and JSON and JQUERY and I love how it works, I love the way it all fits together.
But for a mock-up I did not implement any of the Social Network design patterns such as a login, rating, groups etc..
This brought me to a higher level of decision making requirement, I need to decide if I want to develop all this functionality by hand or use some kind of a framework.
I spent this entire day researching, and it would seem that using Drupal and such frameworks will make the Social Network part easy (overlooking the customization requirement for now..) but will make client side Web App development less so.
I found some other frameworks that are more developer friendly (customizable) such as Zend and Symfony etc.. but these seem to take allot of the power from the client and implement it in the server side, to me this seems a waste (and an unjustified performance bottleneck) ..
Finally I found Aptana Jaxer framework that seems to think the same way I feel.
That said it seems a bit under-developed, I didn't find modules for a social network and the community around it seems thin.. (searching Jaxer in StackOverflow returns few results)
So other then making server side DB comm a bit simpler it does not help me greatly..
My requirements are a good facility to develop web apps on while containing all the user centric logic usually used for social networks in advance.
What would you recommend?
EDIT:
OK, lats fine tune this question, after considering this abit further, is there a good down loadable source of a social network site in PHP that I can work around in building my web app? (I really like using JQUERY AJAX JSON etc..)
if you want to develop a social networking site from scratch, i recommend using zend-framework as a server side framework and jquery as a client side framework.
they have a lot of library which you can use such as zend_auth,zend_acl for user authentication system and Zend_Search_Lucene for search facilities and zend_gdata for youtube videos and so on.
but you can also use one of the several social networking engines available out there.
here is a link:
http://www.best-php-scripts.com/social_networking.htm
I think it depends on the goal your trying to achieve.
Personally, I tend to like to keep things simple and to decouple complex
things in smaller components, so it's easy to stay in control when you'll
incrementally add new features.
Ajax or a server-side framework ? I'd say that they're not necessary overlapping
each others. However some (server-side) frameworks tends to wrap everything in a
single zipped package to make things easier for beginners. I personally don't
like this avenue because it will make your web app dependable on this framework.
Thus, nothing prevents you to use one client-side framework for the presentation
logic and another one for server-side/business logic.
Hth,
Etienne