Otreva http://www.otreva.com Where Remarkable Web Products Are Made Sat, 16 Aug 2014 15:33:07 +0000 en-US hourly 1 Solutions to Common MySQL Problemshttp://www.otreva.com/web-development/solutions-common-mysql-problems/ http://www.otreva.com/web-development/solutions-common-mysql-problems/#comments Wed, 09 Jul 2014 13:06:21 +0000 http://www.otreva.com/?p=4553 MySQL is one of the most popular database engines, and with good reason. Once configured properly, it can help connect thousands of databases to servers and do so at relatively low cost. Plus, since it’s such a common tool, you’re unlikely to run into issues where servers don’t recognize it or you can’t get help […]

The post Solutions to Common MySQL Problems appeared first on Otreva.

]]>
MySQL is one of the most popular database engines, and with good reason. Once configured properly, it can help connect thousands of databases to servers and do so at relatively low cost. Plus, since it’s such a common tool, you’re unlikely to run into issues where servers don’t recognize it or you can’t get help configuring it to do what you want it to do. Sometimes, though, you will run into errors–especially configuration errors–that can be frustrating or confusing. If you’re having a hard time with MySQL, you may be running into one of these common problems.

 

Problem #1: High disk usage. Some MySQL users find that as they expand their operations, using MySQL for a large number of databases, it begins to take up too much disk space. Servers begin looking for data on different parts of the disk at the same time, which can slow or completely halt disk operation.

Solution: Configure MySQL to work mainly with memory, not disks. MySQL takes up far less memory than it does disk space, so the more you can get it to use your computers’ RAM instead of looking for data on disks, the more smoothly it will run. In particular, MySQL can be configured to use available RAM whenever possible and to put temporary tables in memory instead of on hard disks. If you have RAM available on your servers, this solution should speed things up. Just remember that the more databases you have, the more memory MySQL will need.

 

Problem #2: Losing connection to the server. If MySQL loses its connection to the server in the middle of data transfers, it will generate error messages instead of transferring the data as needed. This can be the result of a network problem, so your first step is always to check your network connections. If this problem occurs frequently, however, you may need to reconfigure MySQL.

Solution: Lost connections often happen because MySQL is configured to time out after only 30 seconds, which may not be enough time for large data transfers. Try configuring net_read_timeout to 60 seconds or longer. If you are timing out on initial connect, reconfigure connect_timeout to at least 10 seconds. This often happens if your connection is slow, so consider upgrading your network to connect faster as well.

 

Problem #3: Getting a “too many connections” error. As you expand your operations, you may need more computers to be able to connect to MySQL. If you don’t reconfigure MySQL, it will refuse some of these connections and generate a “too many connections” error message.

Solution: Reconfigure MySQL to accept more connections. To do this, change your max_connections variable. The default is 151; you can set it to whatever number accommodates the number of connections you need. You may also need to increase your open_files_limit to accommodate the number of connections open on your server at the same time.

The post Solutions to Common MySQL Problems appeared first on Otreva.

]]>
http://www.otreva.com/web-development/solutions-common-mysql-problems/feed/ 0
Responsive Web Design Performance tweaks for e-commerce and applicationshttp://www.otreva.com/blog/responsive-web-design-performance-tweaks-e-commerce-applications/ http://www.otreva.com/blog/responsive-web-design-performance-tweaks-e-commerce-applications/#comments Mon, 16 Jun 2014 16:30:22 +0000 http://www.otreva.com/?p=4510 Responsive web design has come a long way in just a few short years since being introduced. It has allowed development shops like ours the ability to help out clients reach their end user regardless of what screen size the device they are using is. Responsive design takes an interesting approach to the problem mobile […]

The post Responsive Web Design Performance tweaks for e-commerce and applications appeared first on Otreva.

]]>
Responsive web design has come a long way in just a few short years since being introduced. It has allowed development shops like ours the ability to help out clients reach their end user regardless of what screen size the device they are using is. Responsive design takes an interesting approach to the problem mobile has caused for many sites in the past. Up until recently it was considered that having a desktop site codebase and a separate mobile site codebase was the way to handle this situation. While it still is the best approach for a few scenarios, the majority of of use cases can benefit from responsive design. However the biggest problem with responsive design is when it is created by the wrong hands. Many web developers have moved into the responsive space after being used to the fixed width sites of the past. However responsive design requires an entirely different mindset when prototyping sites and creating an amazing experience. While many have figured out how to make responsive work while changing the width of their browser window, fewer have understood the impact or performance on a real mobile device. While today’s smartphones are amazing, they still are slower in terms of hardware performance as well as mobile network performance. Things are getting better with each new phone released but we should always consider that performance plays a huge role in our end user’s experience. According to Internet Retailer, a 1-second delay in web site page load time translates into a 7% loss in conversions, according to research firm Aberdeen Group Inc. So if an e-commerce store owner makes $100,000 a day from its mobile site, a 1-second page delay could mean around $2.5 million in lost sales every year. Here are some of the tips and tricks we’ve learned over the last few years to ensure we have a great performing website regardless of which device or the speed of the user’s connection.

Mobile First

Mobile first has drawn a ton of attention over the last few years. It is the best method to take when designing responsive applications because it allows you to focus on the smallest screen and work your way up. Typically working the other way around yields “mobile” experiences that feel clunky and are hard to navigate as well as sometimes impossible to use on a mobile device. Using Foundation we’ll typically create our sites 100% in code first to get an idea of the prototype.

Media & Content Conditional Loading

We use Foundation’s interchange component to help us deal with the appropriate content for a variety of screen sizes. The number one error we see in other responsive sites is that many don’t take into account that users on mobile connections can’t support the same huge media that desktop users have taken for granted. Interchange allows us to easily handle that for a variety of screen sizes from smartphones on up. With just a small change to your HTML markup, you can conditionally load not only images of different sizes but any HTML content including something like Google Maps.

Reduce Bloat

While this may a bit more generic of a tweak, it is something I always like to keep in the back of my mind. A great user experience starts with giving the user exactly what they came for. While this may be obvious, I can’t tell you how many times I use sites that have all types of animated effects, color, and media yet have no clearly defined (of functioning) mobile navigation or it is hard to find given all the other features they’ve spent their time on. From when I start with a prototype up until final testing and even launch, this is a moto I like to kepe in the back of my mind. I’m not trying to avoid using new features and/or well placed animations, but just head over to themeforest and try some of those themes on a mobile phone and I think you’ll understand why reducing bloat is so important. Our goal is to try and keep sites under 500kb regardless of screen size and even smaller for devices that are likely to be using mobile broadband. I personally try to reduce size wherever possible.

Reduce Unnecessary DOM JavaScript – KISS

This is probably the worst type of bloat. While JavaScript is the programming language of the web and most all modern HTML pages are using it, overuse can negatively affect a user’s opinion of your site. I like to use the KISS ( Keep It Simple Stupid ) approach and minimize DOM access. DOM is one of the most complex APIs that slows down the code execution process. We’ve all experienced websites that overly manipulate the DOM. They are jumpy, slow, and feel buggy. Try to reduce it unless it provides a direct and measurable improvement to UX.

Use Grunt

We’ve recently converted all of our boring, annoying redundant tasks over to Grunt tasks. What and why use grunt? Automation. Every project we start begins with setting up a Gruntfile and specifically the compressed obfuscated JS and SASS / CSS components but we’ve found we can automate almost any redundant task at all. We’re even using grunt to run shell commands to do a variety of tasks for us every day. For those of you who have not heard of grunt, stop now and go check it out. Also check out the livereload feature of grunt-contrib-sass. With livereload you can connect multiple devices to your same development site and easily watch every device with each page refresh, scroll and update.

Minimizing HTTP Requests

Whether responsive or not, I think this is one of the most overlooked tweaks that has significantly reduced our total load times. By using Grunt coupled with grunt-contrib-concat you can move all your JavaScript into one file and all your CSS into one file. That single file will take longer to download but as a whole will reduce the overall load time of your page. Combining scripts into as few files as possible cuts down on RTTs and delays in downloading other resources. The same practice can be used for CSS as well as the use of CSS sprites. The overall fewer number of total requests, the better. Start using Google Chrome’s Developer tools and Network tab to begin diagnosing and cutting back. There are always exceptions so having only 1 JS or 1 CSS file may not be feasible but it is a great goal.

Compression

By using gzip or deflate you can reduce the number of bytes sent of the network. While the specifics to enabling compression on your site and server are undoubtedly different for each case, compression in general is one of the easiest ways to boost performance.

Use a CDN version of jQuery and other libraries

Definitely make use of Google’s hosted libraries for jQuery and other popular platforms. While this MAY goes against the above rule for minimizing HTTP requests, typically it will only help. When you use the Google hosted version of jQuery you are not only helping users on your site but other webmasters and users. Let’s say it is the first time a user visits your site in a newly installed browser or they just cleared their cache and cookies. If you have the hosted version setup, this means that yes, they will have to download the jQuery version from the Google Hosted library. But from then on, it’ll be cached for not only your site, but any other website using that same version. Chances are (for jQuery at least) a user already has a cache version when they come to your site.

I hope these tips, tweaks and best practices help some of you. Use the tools available to you and make sure you aren’t overlook the performance of your site.   Test your site at http://www.webpagetest.org today.

 

The post Responsive Web Design Performance tweaks for e-commerce and applications appeared first on Otreva.

]]>
http://www.otreva.com/blog/responsive-web-design-performance-tweaks-e-commerce-applications/feed/ 0
Responsive Web Design: The Sharpest Tool in the Boxhttp://www.otreva.com/web-portfolio/responsive-web-design-sharpest-tool-box/ http://www.otreva.com/web-portfolio/responsive-web-design-sharpest-tool-box/#comments Fri, 13 Jun 2014 18:13:50 +0000 http://www.otreva.com/?p=4506 The Internet increasingly keeps people company in their purses and pockets, so it’s imperative that every website perform well on a phone or tablet. In the early days of smartphones, the only way web designers could customize their websites to work on small screens was to design a separate mobile site from the ground up. […]

The post Responsive Web Design: The Sharpest Tool in the Box appeared first on Otreva.

]]>
The Internet increasingly keeps people company in their purses and pockets, so it’s imperative that every website perform well on a phone or tablet. In the early days of smartphones, the only way web designers could customize their websites to work on small screens was to design a separate mobile site from the ground up. These mobile-specific sites had their own URLs and played by entirely separate rules. It wasn’t always easy to carry branding and SEO through two different web addresses, but users were generally pleased to have manageable internet access on their phones.

Increasing sophistication brought responsive web design

As technology across devices started to integrate, responsive web design came into being. This represented a leap forward, since responsive design meant that every website only had to be built once, and the magic of coding could take the place of labor-intensive site duplication. Fluid methods of rendering grids and dynamic style sheets have made it possible to develop basic designs that adjust themselves to the visual environment of every type of device. Mashable called 2013 “The Year of Responsive Web Design,” and Forbes chimed in with a compelling article entitled “Why You Need to Prioritize Responsive Design Right Now.”

New devices raise questions about dedicated mobile sites

No technology fades out overnight, so you can still find advocates of dedicated mobile sites. They sometimes point out that building a whole second website for smartphones is a way for businesses to respond to the separate needs of their mobile users. It’s becoming increasingly obvious, however, that Internet access portals exist across an entire spectrum of sizes. If you have separate websites for smartphone users and desktops, then where do the growing number of tablet users belong? Some tablets have screens as large as small notebook computers, with such good resolution that many people use these devices as their primary online access point. The old-fashioned division between “computers” and “phones” is clearly losing applicability — and that’s not even mentioning the fact that your refrigerator can go online and tell you that you’re running out of milk!

SEO superiority of responsive design

Whenever we talk about SEO, our first stop is obviously going to be Google. What does Google say about mobile sites? Google’s recommended configuration  for mobile sites is responsive design, with the same HTML and URL used for every type of device while the styling is governed by a different CSS. There are technical reasons for this recommendation, but one big non-technical reason is that SEO is all about connecting with your social network. If you’re out with your phone and you come across a special online tidbit you want to share, you need to be able to send one reliable link. Otherwise, your friend who’s online from her desktop will just open your link and get the same minimal website version that you’re looking at on your phone. As locations and social media and online communication continue to weave a personal technological web, your business needs to have one single address. Unified URLs make Google happy, and if Google is happy, we’re all happy.

As we look to the future, it’s thrilling to envision the kinds of connectivity we’ll be seeing. New forms of wearable technology and multiplying numbers of smart devices — “the Internet of things” — all point us in the direction of having one single URL that communicates across every digital portal. While we can’t predict the exact course that technological innovation will take, it’s clear that responsive web design is a solid building block for the interconnected future that lies ahead.

The post Responsive Web Design: The Sharpest Tool in the Box appeared first on Otreva.

]]>
http://www.otreva.com/web-portfolio/responsive-web-design-sharpest-tool-box/feed/ 0
MySQL Fabric Web Database Utilityhttp://www.otreva.com/web-development/mysql-fabric-web-database-utility/ http://www.otreva.com/web-development/mysql-fabric-web-database-utility/#comments Wed, 11 Jun 2014 19:13:19 +0000 http://www.otreva.com/?p=4501 An enterprise web application refers to the apps or software that businesses use to help the organization solve enterprise level problems. This software is usually very large and complex and used only in huge organizations as opposed to small business or individual use. MySQL is an open-source relational database management system that’s widely used for […]

The post MySQL Fabric Web Database Utility appeared first on Otreva.

]]>
An enterprise web application refers to the apps or software that businesses use to help the organization solve enterprise level problems. This software is usually very large and complex and used only in huge organizations as opposed to small business or individual use. MySQL is an open-source relational database management system that’s widely used for managing enterprise level content in databases. The purpose is to help make organizing and accessing these giant amounts of content easier and more efficient.

Managing databases is becoming more of a concern for big businesses as big data and the cloud continue to grow in enterprise computing. Developers and administrators are being asked to make sure that availability and scalability are handed out liberally to make sure that enterprise web apps are supported, even in very large and complex infrastructures. Oracle is hoping to address this problem by adding their recently released MySQL Fabric to their MySQL utilities package. MySQL Fabric is part of Oracle’s MySQL Utilities 1.4.3 package released in late May 2014, as reported by Computerworld. The software allows multiple copies of the MySQL database to work together, which can help enterprise customers manage databases much more efficiently. Businesses will be able to run live backup databases and increase scalability across different servers.

Businesses that have one or more servers acting as a replicated backup to the main server have assurances that in the event of an outage, there will be no downtime in transferring requests to one of the hot backups. The software will also allow data to be spread across multiple servers which share information too large for a single server to handle. This is a process called “sharding,” which involves separating database tables into different parts and routing specific information into the individual sections. This info is organized in a way that makes it easy to access specific information. Before the release of Fabric, customers using MySQL had to write the code themselves or purchase third-party software to handle these tricky aspects of database management. MySQL Fabric offers a solution that will help improve availability and scalability of giant MySQL databases.

The post MySQL Fabric Web Database Utility appeared first on Otreva.

]]>
http://www.otreva.com/web-development/mysql-fabric-web-database-utility/feed/ 0
Three Design Rules for Creating High-Performing Mobile User Experienceshttp://www.otreva.com/blog/three-design-rules-creating-high-performing-mobile-user-experiences/ http://www.otreva.com/blog/three-design-rules-creating-high-performing-mobile-user-experiences/#comments Fri, 06 Jun 2014 11:01:44 +0000 http://www.otreva.com/?p=4498 Some time ago, companies could get away with showing little personalization and concern for the customer as an individual –but not anymore. Nowadays, brands are required to show integrity, build trust and sustain positive relationships. In keeping with this, the mobile experience is expected to be both of high quality and intuitive. Performance is a […]

The post Three Design Rules for Creating High-Performing Mobile User Experiences appeared first on Otreva.

]]>
Some time ago, companies could get away with showing little personalization and concern for the customer as an individual –but not anymore. Nowadays, brands are required to show integrity, build trust and sustain positive relationships. In keeping with this, the mobile experience is expected to be both of high quality and intuitive.

Performance is a key aspect of user experience. Thus, the onus is on the designer to keep things streamlined and highly functional while striving for excellence in customer experience.

The following are three performance-related design considerations to help designers get the best results from their design decisions

Mobile Performance

Mobile platforms are no longer an option for brands that wish to represent themselves adequately online; they are now a prerequisite. Statistics indicate that a large number of consumers are now spending the bulk of their online time on mobile devices. The natural expectation is that the websites they visit and the businesses they buy from will take the time to develop mobile apps and responsive web platforms.

Designers should know that no matter how pretty a mobile site or app is, if it keeps crashing or loading slowly, they’ll rack up poor reviews and low ratings, ultimately resulting in lost users and poor adoption.

Brand Representation

Every point of contact a consumer has with a brand creates an impression, and as such your brand perception is tied very tightly to the user experience you’re providing on your mobile platforms. The most effective way to stand out in the myriad apps and mobile platforms on the market today is to define your brand in some unique and distinct way, making your brand stand out in the consumer’s mind.

Though designing and building a truly unique feature is a required step, the most important part of the process is effectively integrating it with your existing technology and branding and making certain that the process flows smoothly.

Do this and your mobile design will gain all the loyal users it can handle; fail to differentiate yourself through your design and you’ll find your business lost in a sea of ventures just like yours.

User Needs

One of the most vital elements of web design is focusing every aspect of your platform on meeting your users’ needs and addressing them in the best possible way.

By creating a design priority matrix that focuses on both current and future users, as well as the level of competition, you should be able to easily define the most important needs of your users.

While many designers and developers today fail to realize the importance of the connection between design and a satisfying user experience, it’s a miscalculation that few businesses can afford.

The post Three Design Rules for Creating High-Performing Mobile User Experiences appeared first on Otreva.

]]>
http://www.otreva.com/blog/three-design-rules-creating-high-performing-mobile-user-experiences/feed/ 0
PHP MVC Best Practices: Zend 2http://www.otreva.com/blog/php-mvc-best-practices-zend-2/ http://www.otreva.com/blog/php-mvc-best-practices-zend-2/#comments Thu, 05 Jun 2014 11:40:06 +0000 http://www.otreva.com/?p=4494 Zend Framework 2 is used for developing Web applications (especially enterprise application development) using PHP 5.3+. It uses complete object-oriented code and uses most of the newly developed features of PHP 5.3, including namespaces, lambda functions and closures, and late static binding. This framework is the latest stable version of the original Zend Framework, which can […]

The post PHP MVC Best Practices: Zend 2 appeared first on Otreva.

]]>
Zend Framework 2 is used for developing Web applications (especially enterprise application development) using PHP 5.3+. It uses complete object-oriented code and uses most of the newly developed features of PHP 5.3, including namespaces, lambda functions and closures, and late static binding. This framework is the latest stable version of the original Zend Framework, which can be called one of the strongest PHP MVC frameworks available. While the names are similar, this second version of the framework is inherently different than its predecessor since Zend 2 has been completely rewritten.

The structure of the framework is one of a kind since each component is made with little reliance on other components. This structure and object-oriented design allow developers to use whatever components they’d like to, something that’s known as a “use at will” design. This can let developers create complex Web applications easily. It’s been well received by the developer community with well-known companies having embraced the framework for their important applications.

Some Zend 2 Features

Zend 2 can be used in a variety of ways including with Amazon Web Services (AWS). Developers are able to get information from Amazon.com directly through the AWS API. Developers can store product information like images, pricing, and descriptions, and they can also retrieve reviews, offers, and ListMania lists. Zend 2 applications can also be set up with LAMP (Linux, Apache, MySQL, and PHP) and can also support load balancing if necessary. The framework can also work with elastic applications like Amazon’s Elastic Beanstalk.

Using Zend 2

Zend Framework 2 was released in August of 2010, with the first fully stable version coming out a month later. Based on the nature of the framework, there is a rather substantial learning curve, which may prove to be a problem for PHP MVC beginners. This mainly has to do with Zend’s rules, naming conventions, and guidelines. If these issues can be resolved, developers will see how much easier applications are to understand within the framework.

If unsure about Zend 2 and whether or not it’ll be good for a given project, developers can test the framework through the Zend Developer Cloud. Developers can set up a sample app using Zend 2 and start fiddling with it through this system. This can be done through phpcloud.com.

To sum It up, while there are a number of PHP MVC platforms for developers to work with, Zend framework 2 has a lot to offer in the way of features and general development. The best practices regarding PHP MVC platforms are dependent on an individual developer’s skill set and the individual project’s specifications. But in terms of Zend 2, it seems to be the best fit for important enterprise software.

The post PHP MVC Best Practices: Zend 2 appeared first on Otreva.

]]>
http://www.otreva.com/blog/php-mvc-best-practices-zend-2/feed/ 0
The Future of Responsive Web Designhttp://www.otreva.com/blog/future-responsive-web-design/ http://www.otreva.com/blog/future-responsive-web-design/#comments Wed, 04 Jun 2014 15:38:30 +0000 http://www.otreva.com/?p=4492 Responsive web design has been on the move since 2012 and all trends point towards the website tool being a permanent fixture in web design. As more devices hit the market with Internet capability, the more responsive web design will need to be across multiple channels. So what are the current trends in responsive design […]

The post The Future of Responsive Web Design appeared first on Otreva.

]]>
Responsive web design has been on the move since 2012 and all trends point towards the website tool being a permanent fixture in web design. As more devices hit the market with Internet capability, the more responsive web design will need to be across multiple channels.

So what are the current trends in responsive design and where will it be headed? Only time will tell, but here are some foreseeable responsive web design trends for the future:

More Availability

With a few years of advancement, responsive web design has made itself more readily available to the general consumer. Not only are leading responsive design agencies attracting big-name clients, but self-publishing sites like WordPress also are adopting responsive design into their own design templates.

This makes it easy for bloggers and companies who use WordPress for their sites to easily integrate responsive design and shows that just about everyone is thinking about ux / ui experience. This is a trend that should continue and be more available to a wide variety of users.

Adapts to Future Technology

Having your frontend web development responsive for a variety of mobile screen sizes will be an upward trend in the future of web design. Televisions that run apps and have web-browsing capabilities are already available, and it will only be a matter of time before those technologies are advance to the point of becoming a fluid online user experience.

Apple has been making an impact in the automobile industry, and should have a full website experience built into the system in a few years. Website will need to adapt to these new formats while remaining vivid on a traditional mobile devices. Responsive design is a big part of that future.

Google Likes It

Responsive web design long ago captured the eyes of the giants of Silicon Valley. Now, the leader of search engines even recommends using responsive design on mobile devices for the greatest SEO performance. Not only does it matter for SEO performance, but also Google keeps making advances in location-based services. Agreeing with them can help your business in page ranks and exactly where to locate a brick-and-mortar store.

These are just a few of the advances that occurring in mobile design. Responsive web design not only helps consumers use their current mobile devices now, it also will reshape the user experience of the future. From browsing the web in a car to a television, responsive design helps make that futuristic product a possibility.

The post The Future of Responsive Web Design appeared first on Otreva.

]]>
http://www.otreva.com/blog/future-responsive-web-design/feed/ 0
Web Application Developerhttp://www.otreva.com/blog/web-application-developer/ http://www.otreva.com/blog/web-application-developer/#comments Fri, 30 May 2014 11:30:53 +0000 http://www.otreva.com/?p=4483 Otreva is looking for a rockstar web engineer who can work front end and back end in an MVC framework. That means you live and breathe database driven websites. We are looking for someone who understands that creating strong platforms that can connect with multiple social networks and is device agnostic is part of the […]

The post Web Application Developer appeared first on Otreva.

]]>
Otreva is looking for a rockstar web engineer who can work front end and back end in an MVC framework. That means you live and breathe database driven websites. We are looking for someone who understands that creating strong platforms that can connect with multiple social networks and is device agnostic is part of the every day life of a developer now.

Position open only to individuals willing to work in Northeast PA ONLY!

Must Haves

  • 1-3 years of experience working in a popular PHP Web Framework (Zend, CakePHP, CodeIgniter, Symfony, etc.) & Object-Oriented PHP
  • HTML5 and CSS3 (SASS Experience a +)
  • Grunt / Node.js Experience
  • Javascript, jQuery, AJAX
  • Basic Linux command line familiarity
  • Git versioning experience
  • Creating and maintaining technical documentation
  • Comfortable integrating any RESTful API
  • Must be able to competently code front-end (HTML, CSS, Javascript) {Will have mock-ups to code from}
  • Must feel comfortable in a team-based, entrepreneurial, and hard-working culture
  • Must have a self-starting personality who is unafraid to display initiative and innovation

Job Responsibilities:

  • Develop and maintain Public APIs and applications for reliability, security, manageability, scalability, and performance; provide technical expertise in the areas of architecture, design, and implementation.
  • Addition of features to existing products.
  • Assist in the testing and debugging of software.
  • Optimize existing code and database queries.
  • Assist in the project planning, code and database design.
  • Keep abreast of emerging technologies and trends

Nice to have:

  • Experience building emails with cross-client fluidity
  • Experience with Ruby on Rails, Python & Java
  • Experience with Amazon Web Services (AWS)

Please include the following:

  • A link to your online portfolio or attach your portfolio after following the link below.
  • Why you are interested in this position and what makes you unique?

Show us what you’ve got!

  • Have a resume or portfolio you want to upload? (docx, doc, pdf, indd, ai, eps, jpg only)

The post Web Application Developer appeared first on Otreva.

]]>
http://www.otreva.com/blog/web-application-developer/feed/ 0
MySQL Sort Randomly and Efficiently with Stored Procedurehttp://www.otreva.com/web-development/mysql-sort-randomly-efficiently/ http://www.otreva.com/web-development/mysql-sort-randomly-efficiently/#comments Fri, 16 May 2014 16:42:20 +0000 http://www.otreva.com/?p=4446 Sort Randomly and Efficiently Purpose There are many things on websites that developers need to display randomly and efficiently. Examples include classifieds, news feed items, and pictures. As a human, it makes sense to see a random list of the newest content posted to a website. If the website is getting thousands of images an […]

The post MySQL Sort Randomly and Efficiently with Stored Procedure appeared first on Otreva.

]]>
Sort Randomly and Efficiently Purpose

There are many things on websites that developers need to display randomly and efficiently. Examples include classifieds, news feed items, and pictures. As a human, it makes sense to see a random list of the newest content posted to a website. If the website is getting thousands of images an hour, could someone really keep up with all of them? Probably not, so it is better to display the user a random list. If the website has many levels of categories, it would be difficult to know everything that is on the site. Using random sorting when displaying content to the user will increase their coverage of the website.

Problem

To get this random data, you will need to get content from your data source randomly. Let’s use the example of storing image names in a database table called pictures.

At first, this may seem challenging, because what’s random about rows of images in a table? Assuming you’re using an RDMS, especially MySQL, this can be accomplished very easily with the following code:

SELECT pic FROM pictures ORDER BY RAND() LIMIT 10;

The way this works is MySQL reads every row in that table and generates a random number between 0 and 1 for each row. It then sorts by that number and returns 10 rows with the lowest number. This is not efficient at all though. The problem comes with an increase in number of rows. Even if the query returns 10 rows, MySQL needs to hit every row in the table and generate a random number. This can become unusable when the size of the table gets larger (100′s of millions)

Solution

As a human, we can look at any number of things and efficiently pick things randomly. For example, pick 3 random cards from a deck after it falls on the floor. Computers can only see one thing at a time though. That would be equivalent to the deck being brand new and not fallen on the floor. You can only see one card at a time and every card needs to be pulled out of the deck before deciding if it will be part of the random group.

How can we tell MySQL to throw all the rows on the ground and just pick up 10? Maybe instead of telling it to randomly select 10 from 100, we could generate 10 random numbers first, and then have the query fetch rows with matching ids? Imagine if each card in a deck had a number from 1 to 52 on it. Intead of MySQL generating 52 random numbers, ordering them, and then pulling the top 10, lets generate 10 numbers between 1 and 52 and then have MySQL go get the cards with those numbers on them. Below is the code to generate a random number between a range in MySQL.

FLOOR(low + (RAND() * (high - low)));

With this code we can generate numbers that can match the numbers on our cards by setting low = 1 and high = 52. We can get 52 by getting the largest number on the deck. If we do this ten times, we can tell MySQL exactly which cards to get so it can use an index and not a table scan.

* If a card is removed from the deck, we need to make sure we don’t try to search for it.
* Searching for the same card more than once still only means one card

Stored Procedure Implementation

CREATE PROCEDURE getPictures(
_numPics INT UNSIGNED
)
MODIFIES SQL DATA
SQL SECURITY DEFINER
BEGIN

DECLARE minId BIGINT UNSIGNED;
DECLARE maxId BIGINT UNSIGNED;
DECLARE _id BIGINT UNSIGNED;

SELECT MIN(picId), MAX(picId) INTO minId, maxId FROM pictures;
DROP TABLE IF EXISTS randIds;CREATE TEMPORARY TABLE randIds(id BIGINT UNSIGNED NOT NULL PRIMARY KEY);

WHILE (SELECT COUNT(*) < _numPics FROM randIds) DO
  SET _id = FLOOR(minId + (RAND() * (maxId - minId)));

  INSERT IGNORE INTO randIds (id)
    SELECT picId FROM pictures
      WHERE picId = _id
  ;
END WHILE;

SELECT p.picId, pic
  FROM randIds AS r
  JOIN pictures AS p ON p.picId = r.id
;

END~

This MySQL Stored Procedure takes a number of random results as an input and outputs that many results very efficiently.

  1. The first select statement gets the smallest and largest ids from the pictures table. This is 1 and 52 in the deck of cards.
  2. The next line creates a temporary table to hold these random ids. It has a constraint of uniqueness so we don’t attempt to search for the same id twice
  3. The loop will continue to execute until there are _numPics ids in the temp table. Within the loop we generate a random id within the range and put that into random ids table if it exists in pictures. This will help if we generate an id that does not exist.
  4. Finally we join the random ids on the pictures table and return those results.

This is a very efficient way to get a random data set from a table and will scale with your application. Instead of using a computer to sort randomly but not efficiently, we are using human logic to sort randomly and efficiently.

The post MySQL Sort Randomly and Efficiently with Stored Procedure appeared first on Otreva.

]]>
http://www.otreva.com/web-development/mysql-sort-randomly-efficiently/feed/ 0
SQL versus NoSQL Databaseshttp://www.otreva.com/blog/sql-versus-nosql-databases/ http://www.otreva.com/blog/sql-versus-nosql-databases/#comments Tue, 22 Apr 2014 13:36:52 +0000 http://www.otreva.com/?p=4440 LAMP is a great software stack to get started with in building a reliable and efficient web application, but there are many instances when a program’s complexity requires a different database technology than MySQL—or RDBMS in general, to handle information storage and retrieval. This is increasingly the case as firms find new ways to leverage […]

The post SQL versus NoSQL Databases appeared first on Otreva.

]]>
LAMP is a great software stack to get started with in building a reliable and efficient web application, but there are many instances when a program’s complexity requires a different database technology than MySQL—or RDBMS in general, to handle information storage and retrieval. This is increasingly the case as firms find new ways to leverage the Internet and associated technologies in building novel applications that solve industry and domain-specific problems and challenges. For example, mapping and GIS-related applications require complex information storage, processing, and retrieval for geospacial analysis, using data models that are multi-level and more complicated in nature. Additionally, more sophisticated technologies are required to process the massive data explosion that has occurred within the last 5-10 years due to mobile devices, social media, and the exponential growth of the Internet —all of these contributing to the rise of Big Data, or data sets so massive that traditional RDBMS tools have difficulty processing them.

RDBMS technology is over four decades old, with the first commercial RDBMS released by RSI (later to become Oracle Corporation) back in 1979. The original developers of the RDBMS did not anticipate Big Data, and designed it to store all information into a neatly structured, tabular data model that made for streamlined storage and retrieval. This worked for a time, but in this day and age, the nature of data requires the scaling out of data, as opposed to scaling up. For example, instead of increasing the processing power, memory, and storage capacity of one database server, it makes more sense to purchase several inexpensive servers and distribute the load across them as required. This may sound familiar, as this is one of the main tenets of Cloud Computing. NoSQL fits into the cloud schema perfectly, as these two are both contemporary technologies: designed in the same era and solving the same problems with horizontal scaling.

Comparing RDBMSs and NoSQL Databases

It’s worth noting that NoSQL stands for “Not Only SQL,” not “No SQL.” That is to say, SQL—or Structured Query Language, is not entirely absent from NoSQL databases. SQL’s presence varies from vendor to vendor. Indeed, some NoSQL solutions allow the use of SQL-like query languages to manipulate data, with MongoDB as the prime example of this. Rather, the main differences between the two database technologies are related to how NoSQL solves scaling issues inherent with a RDBMS.

We mentioned before that RDBMSs require a fixed, predetermined, tabular data model to perform optimally. NoSQL databases are the opposite of this—they are schema-less, and thus more flexible. Data can be inserted without conforming to a specific structure; the format can thus be changed without modifying or rewriting the application. NoSQL databases store data as key-value pairs, columnar data, or documents—rather than a relational set of tables (and constituent rows/columns).

Different Database Chemistry: ACID vs. BASE

When comparing a RDBMS and a NoSQL database, one may encounter the terms ACID and BASE, and the relative benefits of each. ACID stands for “atomicity, consistency, isolation and durability,” and refers to the standard attributes of a RDBMS, whereas BASE stands for “basic availability, soft-state, eventual consistency.” The attributes detailed in ACID were initially stated as being imperative to optimal database operations, but as systems become larger and more distributed, this is less of a reality—especially with the immense volumes of data and simultaneous transactions that are typical of today’s large systems (think Amazon or Google search). BASE, therefore, describes the attributes of NoSQL databases: data eventually will be in sync, and this is good enough—it may be approximate and not exactly up-to-date, but at least the system is highly-available, performing and responding to requests.

In short, due to their simpler data models and distributed nature, NoSQL databases are generally faster and more scalable than RDBMSs. That being said—NoSQL is still a developing technology, while RDBMSs are mature, stable, and reliable under most circumstances. Realistically, most organizations and firms will not scale out of the realm of a standard RDBMS’ performance threshold. It is therefore not a question of which database technology is superior to the other, but rather, which is appropriate for the scenario at hand. RDBSs such as MySQL, PostgreSQL, Oracle, and SQL Server are still the most widely supported and understood, and will hold up in the vast majority of use cases. NoSQL databases such as MongoDB, CouchDB, BigTable and Apache Cassandra should be used when highly-available, distributed database systems are necessary to handle massive volumes of requests and data processing.

The post SQL versus NoSQL Databases appeared first on Otreva.

]]>
http://www.otreva.com/blog/sql-versus-nosql-databases/feed/ 0