All posts by Lev Gimelfarb

RESTful API Tester

For those of us who develop or work with backends with RESTful APIs, I wrote a little tool at http://x2node.com/api-tester/ that allows using a browser to make calls to the backends, mostly for testing. It’s useful when the application’s UI part is not yet ready but you already need to start making calls to the web-service you’re working on. The tool is part of the X2 Framework for Node.js ecosystem, but it’s generic and will work with any RESTful web-service. Enjoy!

SQL Databases in Node.js

Node.js is one of the best current platforms available for creating back-end applications that expose REST APIs. Often such applications are backed with a database. Nowadays, many NoSQL databases are available that integrate easily with the platform and operate using JSON data format and associated principles – so they’re natural to both a JavaScript platform such as Node.js and the modern REST APIs. These databases usually offer speed, conceptual simplicity, as well as massive horizontal scalability and parallelism – all great when the application, like many modern social media platforms and other services exposed to the end users on the Internet, works with large numbers of users. At the same time, the structural complexity of the data in the context of a single user is usually relatively simple and therefore can be handled perfectly by a NoSQL database.

Continue reading

Yet Another Result Set Parser

Database graph, distortedEfficiently parsing SQL query result sets into the hierarchical data structures with which applications normally operate has been a problem for quite a long time. Numerous attempts have been made over what feels like the ages to solve the problem, the essence of which is that the strictly two-dimensional grid nature of what’s returned by a SQL SELECT query – those rows and columns – map very poorly to the tree. More generally speaking,  they don’t suit the graph-like data structures utilized by modern applications to model the world. Continue reading

ORM must go!

No ORM!Object Relational Mapping, or ORM, has enjoyed a long run of being accepted as a standard paradigm for middle-tier, server-side software work with a back-end database. It’s wide spread and “no-brainer” status originated, probably, with the popularity of a single, exceptionally successful Java framework called Hibernate. The idea behind ORM is blending the line that separates the middle-tier and the persistence layer and making them practically one piece. So-called persistent objects become something that simultaneously belongs to the persistence layer and the rest of the application that works with them – often even in the presentation layer.

Continue reading

Stacy: S3-served dynamic websites

Stacy - partial diagramServing a website from Amazon S3 is great: it’s fast, it’s inexpensive, and it doesn’t require maintaining a web server. But this simplicity can be limiting, coming at a price: you can only serve absolutely static files; there is no server-side logic whatsoever.

On the other hand, we are now seeing the rise of so called “API-first content management systems.” These systems, in true cloud spirit, are usually provided as a hosted service, give you  a standardized user interface for structuring and managing your content, but do not deal with any aspects of your content presentation. They don’t deal with themes, templates, pages, etc. Instead, you have a fast and simple RESTful API that gives you access to your content and you are free to render it with whatever presentation you want outside of the CMS.

Continue reading

Angular Tip: Using the XMLHttpRequest object

AngularJS logoNormally, an AngularJS application uses the $http service to make calls to back-end services. Sometimes, however, we would like to have access to the underlying XMLHttpRequest object. I can come up with a few use-cases, but the most prominent one is probably being able to track progress of a long request, such as a file upload. To do that, we need to register an event listener on the XMLHttpRequest object for the event that is “in progress.” Surprisingly enough, Angular’s $http service does not in any way expose the underlying XMLHttpRequest object. So, we have to get creative. Here is one way to do it…

Continue reading

What does “don’t be evil” mean?

The European Commission – the executive body of the European Union – does not seem to have any intention to let Google go. After several years of antitrust investigations, charges and settlements it recently formally charged Google again (http://europa.eu/rapid/press-release_IP-15-4780_en.htm). The part that made me remember Google’s motto in the title of this post is the accusation that Google “systematically favors its own comparison shopping product (so called Google Shopping, L.G.) in its general search results pages”. The EC considers it an abuse of Google’s dominant position (in Europe Google serves 90% of search traffic, which is significantly higher than in the US), which stifles the competition and harms the consumer.

Continue reading