[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
RESTFul API based server
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 49
Thread images: 2
File: RESTful-API-design-1014x457.jpg (94 KB, 1014x457) Image search: [Google]
RESTful-API-design-1014x457.jpg
94 KB, 1014x457
Hello /g/,
need advices from experienced people here.

I'm developing a mobile app, which should connect to a webserver using RESTful APIs.
So, basically, I have to start writing the goddamn server.
I saw hundreds of frameworks for REST web service, but I don't know which one to pick.
Also, I haven't figured out which language I should use, yet.
I would go for Python, but I'm concerned about performances...

Help me out, /g/, pls
>>
>>51651195
Are you going to be doing this yourself or collaborating with others? What languages do you know? Are you willing to learn things?

Either way, I can offer a few recommendations. If you care about speed and realtime features, and are willing to learn things, look into Elixir and Phoenix. PHP, Ruby on Rails and Django will all have fairly similar performance(same order of magnitude), but there are ways to scale them up depending on how much you need. RoR is by far the slowest though, and if you do go with PHP make sure you use a proper framework(Laravel, Symfony, etc.) or your code will be a mess. Really you should just do some research and evaluate your options to determine the best framework to use.
>>
>>51651288
Server and android client will be my responsabilities.
I know many languages, and willing to learn more if it's necessary.
Right now I'm reading Fielding's thesis, just to make sure how to stick properly with the model.

I would like to keep things as simple and clear as possible, that's why I dropped Django on this.

Elixir seems a good choice, btw
>>
>>51651195
Not OP but Elixir looks really cool and boasts a lot of performance pluses. Is it worth it? Is it being used in production?

I've not used Erlang, should I learn Erlang first?
>>
Golang is pretty based, if you know CSP.
>>
>>51651383
What's wrong with Django? Imo it is well structured.
>>
Holy shit, you're me from 2 years ago, hi me

You want Golang you fucking faggot now fuck off and stop being a 55-year-old virgin
>>
>>51651383
Theories are rarely going to pan out perfectly in real life. As long you know how to properly structure your app you should be fine. I do think that as far as keeping things "simple and clear", Django isn't necessarily a bad choice, is there any specific reason why you decided against it?

>>51651437
I learned Erlang first, then Elixir. I don't think it'll make a big difference, but the LYSE book is free and a great resource for learning Erlang. You'll find that it's just minor syntax differences between the two, and a few nice additional things from Elixir, but really under the hood they're quite similar. It's still a relatively obscure language, as is Erlang, but it's gaining a bit of popularity as people fed up with Ruby on Rails migrate to it. I can't say i know of any big Elixir success stories though, though Erlang definitely has more than a few. I'd say it's definitely worth it if you are just building something yourself or can convince others to learn it.
>>
>>51651727
I'm just looking to get into realtime and concurrency as my limit with Flask/Python has been reached.

Ideally, like OP, I want to be able to run servers which can serve APIs for some future app/game that I may be tasked with.

Any tips for getting into Erlang mindset? Coming from Python (Intermediate) here.
>>
PHP is obviously

the worst, by far.

Typescript with node, C# with ASP.net MVC (which merged with web API now, afaik) or Python with... pretty much any framework work rather well.
>>
Use Spring, Node + Express, or Rails.

Spring is Java, might be easy to learn since I'm assuming you're making the app in Java.
>>
A single server would be a huge bottleneck and a single point of failure, better distribute that shit
>>
>>51651704
You think?
I don't know, man, seriously... Is Golang really worth it?

>>51651679
>>51651727
I tried to use Django few times.
I can't say I know it quite good (no, I would say I don't know it at all), but the whole migration/MVC pattern thing gives me the idea of something too much complicated for what I want to achieve.

Just to make things clear: Java, C, C++, OCaml, F#, C#, Python, PHP, these are the langueges I'm most fluent
>>
>>51651195
Google flask.
>>
>>51651820
No tiengo dineeeero, uououo!
No tiengo dinero, nononono!

>>51651855
Saw it, seems pretty fucking good.
What do you think?
>>
>>51651195
Use websockets. REST is for the weak.

Also any framework works. Shit is easy.
Use NodeJS or Flask or PHP for quick up and running.
>>
>>51651845
Golang isn't a framework per se, but it has everything you will need to do this, so yes it is very worth it

The rest of the shit being recommended here other than Elixir and Erlang is rendered obsolete. Especially Python or Ruby based shit, do not even go near that crap.
>>
>>51651869
We had to build restful service for one subject, I used Flask and it's very easy to start working with it. Try it.
>>
>>51651891
I know what Golang is, kek
In fact, which framework should I use in case of Go or Elixir?

Otherwise, I'm seriously thinking to Flask
>>
>>51651195

Laravel is your answer.
>>
>>51651921
https://golang.org/pkg/net/http/
or just sockets
>>
>>51651928
>Laravel
>PHP
I'm not even going near to that shit, ever again
>>
>>51651944

you are missing out
>>
>>51651195

Literally wrote a RESTful software module last month that's already in production

Java + Gson + Apache HTTP components worked for me with testNG + Jenkins for agile updates and regression.

It's fast as fuck and all of the Java stuff has a huge active base. If you're going to bitch about the syntax use fucking scala or clojure.
>>
>>51652037
>It's fast as fuck
>>
Flask is easy
Django is easier when it comes to the database
Avoid node
Avoid php
C# or Java will work too
>>
>>51651443
>>51651704
Golang is good; listen to these nerds.
>>
>>51652070

Java's pretty quick.
>>
>>51652037
Gson is not fast, anon. Use Boon or Jackson.
>>
Node.js with Sails and put your database in Apache Cassandra.

Sails comes with very useful generators that can have CRUD up in minutes.
>>
>>51652109

The Json object I was de/serializing was an enterprise edition monstrosity . I found some of the smaller Json libraries had problems understanding it.
>>
File: lol_java.jpg (77 KB, 852x615) Image search: [Google]
lol_java.jpg
77 KB, 852x615
>>51652108
> implying
>>
>>51651845
do it in PHP
pick a sinatra-inspired microframework, like fat-free framework or slim framework... they are nice for REST apis
>>
>>51652259

> implying

https://benchmarksgame.alioth.debian.org/u64q/python.html
>>
>>51652341
SISD, and into the thrash it goes
>>
>>51651775
You really just need to wrap your head around two things. One is the functional programming paradigm, which is really quite different from imperative, and will weird you out a bit at first. The other is the concurrent paradigm. Ordinarily we like to think of code being mostly linear in execution, and sometimes running in parallel with multiple cores, but languages like Erlang and more recently Go challenges this by forcing you to think in terms of many concurrent processes all interacting with eachother and exposing their own internal interfaces(esp. in the case of Erlang). Once you've wrapped your head around those two things then you'll have a good understanding of how to write Erlang/Elixir code.
>>
>>51653106
OP here
No problem with imperative/functional paradigms, am skilled as fuck, but when it comes to concurrency, I have some problems too.
I suppose there's some mutual exclusion/parallel computation feature built in Elixir runtime support, am I right?
If so, can you provide some references, pls?
>>
Krystian go home
>>
>>51653422
shameless self bump da fuck out of this thread
>>
Write your own Rest API its good experience and not hard at all. Unlike popular belief any language will work unless you plan to get like millions of users. At that point however you have issues like load balancing to deal with. Multiple servers and etc, which really still let's you choose which language you want to use...... Stay away from node.js or ruby tho.
>>
>>51651195
>>51651845
>>51651383

If you're good with Java and making Android app. Spark Java is what you're looking for.

http://sparkjava.com/

Simple, neat, fast, clear.
>>
>>51654241
I made my choice, which is Go.
But Elixir is fucking gorgeous, I'll try to write something with it, sooner or later

>>51654355
I fucking hate Java, literally
As the prophet once said, "once you go functional, you'll never come back"
>>
>>51654384
Good choice as you're alone on this project (?) and Go is fairly common now, but you should consider the project's maintenance in the long term when you're looking to choose a stack.
Functional programming should stay in the meme house.
>>
>>51654384
>I fucking hate Java, literally

It's an API bruh. No more than 2000 lines of code. The language literally does not matter. Stop bitching.
>>
Pretty simple with Flask and something like Flask-RESTful, Flask-Restless, or Flask-Potion. There's also Sandman which takes an existing database and makes an API from it, completely customizable.
>>
>>51651679
Django includes way too much for small things. Building a little API web server? Django is a bit overkill, flask or one of the other smaller web frameworks are much more apt for the situation.
>>
I was diving through Go language references, probably it'll take me one week to be comfortable with the language, and structuring the project using the concurrency approach.
Dunno if it's a good thing to do, 'cause basically I would go straight to app development rather than put too much effort in server side development.

>>51655900
this is exactly what I meant to say, but it's useful for database management (in which I suck, yeah)
>>
When in doubt, always got for ASP.NET
Prototype up within seconds, template the fuck out of your code with Entity Framework.
Host it for free on Azure

Fucking perfect m80
>>
>>51656197
Here lies the problem with asking for advice in these sorts of situations.
While it's good to look around to see if there's a best or better way to do something, it will be time consuming.
If you already know Java, start there and move to a more performant Go-based system later when the needs are there. Otherwise >>51656256 offers some of the best advice in the thread.
Thread replies: 49
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.