Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am building a rails 3.2.14 web app and API. I want the API part to respond even faster than it does.
My question is this:
I am currently using Rabl gem. Is it better (performance wise) to use Model serializers?
Is there something I can do to speed up requests (perhaps with middleware)?
How can I measure the performance of my API? Is there a tool or a service for that?
Thankful for all input!
Regarding 1) and 2)
Personal preference and prior experience favors RABL. It helps segment JSON views from my code logic. You can get a lot of reuse with partials and other logic within RABL template and this is why I favor it over serlializers. You can take full advantage of Rails.cache in either, and again for me, RABL makes this easier to manage in complex caching approaches ( like russian-doll ).
This is a good write up on caching with serlializers ( http://robots.thoughtbot.com/fast-json-apis-in-rails-with-key-based-caches-and).
Take a further look at ( https://github.com/nesquena/rabl/wiki/Caching-in-RABL ) for caching techniques. I've greatly increased performance on heavy APIs by simply using caching.
For Item 3). I use NewRelic specifically for API performance improvements. You can load test an API, and review the performance to a great lelve of detail in their Dashboard.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
After hours of searching on google on the above mentioned topic. I am unable to contrast the difference between model based testing and model driven testing. Tons of definitions are there,. But there is no clear definition with real world example.
Can anyone please help me understand the difference between these two with the help of real world example.
I'm afraid there is no clear-cut difference between the two. First, because everybody uses a different terminology (there is no "standard" definition for these terms). Secondly, because IMO, both terms refer to the same concept (using models as part of the process of writing the tests for your system) and only differ regarding the importance of the role of models in the testing process.
To me, model-driven implies a stronger role of the models (i.e. models are used to derive the tests) than model-based (where models are used but maybe as an additional input in the test generation process).
At least, this is how I explain other "model-based" vs "model-driven" concepts as I tried to explain in more detail here: http://modeling-languages.com/clarifying-concepts-mbe-vs-mde-vs-mdd-vs-mda/
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
There is a lot of articles on the web supporting the trend to move to a graph database like Neo4j... but I can't find much against them.
When would a graph database not be the best solution?
Any links to articles that compare graphs, nosql, and relational databases would be great.
Currently I would not use Neo4j in a high volume write situation. The writes are still limited to a single machine, so you're restricted to a single machine's throughput, until they figure out some way of sharding (which is, by the way, in the works). In high volume write situations, you would probably look at some other store like Cassandra or MongoDB, and sacrifice other benefits a graph database gives you.
Another thing I would not currently use Neo4j for is full-text search, although it does have some built-in facility (as it uses Lucene for indexing under the hood), it is limited in scope and difficult to use from the latest Cypher. I understand that this is going to be improving rapidly in the next couple of releases, and look forward to that. Something like ElasticSearch or Solr would do a better job for FTS-related things.
Contrary to popular belief, tabular data is often well-fitted to the graph, unless you really have very denormalized data, like log records.
The good news is you can take advantage of many of these things together, picking the best tool for the job, and implement a polyglot persistence solution to answer your questions the best way possible.
Also, I would not use neo4j for serving and storing binary data. There are much better options for images, videos and large text documents out there - use them either as indexes with Neo4j, or just reference them.
When would a graph database not be the best solution?
When you work in a conservative company.
Insert some well thought-out technical reason here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm running some test on those three networking framework: ResKit, NSURLConnection and AFNetworking. And I am seeing that it is not easy to see the differences between the third party libs. What are the major differences between the those? and why? which one is best among these
NSURLConnection is the standard Cocoa class for managing network connection.
That is the base to all these third party libs
The difference is that they are richer,They are written to improve usage of network call in the most easier way and all the basic network call is made possible by custom methods by these libraries
As a dev, Using these will give more Readability ,Performance and icing on the cake is..less code.
Restkit uses AFNetworking for the network communication ,Other than that restkit is a parser for the data coming through the network and is most suitable for RESTful webservices
MKNetworking is one of the other favorites which will have the second place in this list.Got performance and can reduce tons of code
For me,The winner is AFNetworking.It is one of the coolest framework in iOS making my programmig life much easier in network communication.Got great performance also.And uses the latest [or recent] block programming implementation which make the code super easy to read and understand
one more is there ASIHttpRequst : It was a good one but now sadly discontinued
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Hoping someone can help clear things up for me.
I've been reading a ton about the new javascript app frameworks out there, backbone.js, batman.js, ember.js etc...
And I see a lot of instances of them using the frameworks on top of Rails.
Can someone explain to me. Doesn't this require a ton of duplication in order to use them? ie. do I need to completely duplicate each model and controller? And if so, do I need to make changes to both each time?
I see a great benefit for rendering templates on the browser, but I feel like I'm missing something important when it comes to using these on top of an already well organized MVC structure.
What is the benefit and is there really as much duplication as it seems?
I've read the question here
But it doesn't seem to address the duplication.
Thanks in advance.
The benefits are described in the question you linked to. They provide structure which is hard to achieve when you're client side does more than simply displaying data and reloading parts of the view with AJAX.
Andrew Dupont gave a presentation at MIX 11 about writing maintainable JavaScript. He describes his journey from a stinking pile of JS to a more maintainable code base. It is worth watching.
The duplication depends on how much you do on the server side. If your server is only serving data, e.g. Rails controllers providing a JSON API to access the models, you have to duplicate the models on the client side.
I am using Rails only for JSON access to persist the entities of my application, except some JSON views. The whole user interaction and CRUD happens on the client with Backbone & jQuery.
So far, I had only to duplicate the models in Javascript and create some controllers for accessing and saving the models on the server.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need to help a human rights organisation to setup a donation page at their website. They have tried PayPal and GlobalGiving and they found some glitches with these services like ceiling, transaction fees, etc. They want to setup their own mechanism. So what are the possible options and how much programming is needed? Is there any free-open source e-commerce or charity modules available?
Sounds like you are looking for something very customizable here, what I would recommend you is to do some custom coding or leverage solution like wufoo. You can build as simple as a form that whole bunch of fields and sends all these result to paypal or other payment gateways. Leveraging pre-built solution like wufoo is often recommended for non-technical people and/or simple, quick tasks like this.
(Alternatively) Most well-known applications like drupal, Joomal, wordpress (you name the rest) have fairly good support/module on this area, however, most of them require some degree of customizations and often become an overkill solution (mainly because of the learning curve).
You might look into Google Checkout. It's not free, but they do have an option tailored to non-profits (link).
The main benefit of going with them is that you won't need to set up a direct relationship with a CC merchant gateway, which can be a good sized hassle, especially for a smaller nonprofit. To me, the other benefit is that it keeps you far away from Raiser's Edge / Blackbaud, purveyors of some of the most awful donation pages I've ever had the misfortune to see or use.