Spectory Blog

Concurrency control in web development

By Dan Y, Feb 26 2017

One of the foundations, when talking about applications related to ecommerce, finance etc. is Consistency. Consistency is one of the transaction database properties called ACID (Atomicity, Consistency, Isolation, Durability). It means that a transaction either creates a new and valid state of data, or, if any failure occurs, returns all data to its state before the transaction was started. Sometimes we tend to think that the database takes care of concurrency issues automatically but unfortunately we are wrong… It’s true that most of the relational databases do support ACID foundations but if we don’t handle it properly in the application server side, we may encounter concurrency problems when more than one user is working on the system.

Read More

Factory girl the Story of Goldilocks and the Three Bears

By Tomer S, Sep 29 2016

Just like in the story of Goldilocks and the Three Bears, in our code- guests are welcome, mystery guests aren't.   While we are testing our application , we need to challenge the logic and design of our code. In order to do so efficiently we will increase the power of our unitests by making it faster and by testing all parts of the code. Testing is an integral part of code writing. Unitests of Web applications need to test both the server side and the client side. The challenge of testing the server side is the decrease in performance speed due to the writing to database. As a Full Stack developer it is very important to conduct the tests in a convenient way, without compromising on quality. This is the main goal of FactoryGirl.      

Read More

Materialize Your PostgreSQL Views

By Amitai B, Mar 26 2016

I value performance a great deal. I believe a web application today should be as responsive as possible. The user's patience for latency is close to none. It is easier when the application renders static pages, but what should we do when the application has to present the results of complex calculations or analysis? In order to display the data fast we cannot run the calculation on demand. It just wouldn't be fast enough.

Read More

Postgres with JSON, works for me :)

By Amitai B, Mar 20 2016

When designing a web application, one of the first decisions is where and how to store the data. There are many alternatives, and the most popular ones these days are PostgreSQL, MySQL and MongoDB. PostgreSQL and MySQL belong to the SQL camp or storing data in a structured manner that is easily queried while MongoDB belongs to the NoSQL camp that promotes storing data in a semi-structured manner that scales very well but is more difficult to query. In this blog post I will focus on PostgreSQL and on its feature of JSON support that aims to provide some of the benefits of both worlds. This post is not meant to be a SQL vs. NoSQL debate, we have plenty of those :)

Read More