Сообщения

Сообщения за ноябрь, 2017

Failover cluster with Master-Slave on PostgreSQL

Изображение
Welcome, hebraically! In this article I want to share the experience of deploying the cluster Master-slave on PostgreSQL. Fault tolerance is achieved by using pgpool-II (failover, online recovery). pgpool is a great tool for scaling and load balancing between servers and I think few know about the possibilities of automatic creation of failover on the slave server when the master and how to add new capacity to an already running cluster without shutting the entire cluster. Schema cluster and machine requirements The figure shows a typical diagram of the cluster Master-slave. The cluster should contain 1 master server (Master), at least 1 slave (Slave), 1 unit of scaling (Balancer). When each server needs to be installed Linux distribution (I have put Red Hat 6.1) on the site scale have installed the gcc compiler. PostgreSQL — 9.0.1, pgpool-II 3.0.5. You can use other versions of the DBMS and pgpool. In this case, refer to the documentation. set up a dial-up co

The easy way or 0 Step Checkout in Magento

3 years ago I was faced with the making the purchase through the online store created on Magento platform. After choosing my items, I went to the checkout page (checkout), but not everything was so simple! Checkout almost repulsed the desire to buy something in this store! Still — 5 steps and a whole bunch of fields in forms. And we all know that the fewer clicks will make the customer placing the order, the more you sell, online store. Solution MagentoConnect there are various OnePageCheckout decisions. For example, OneStepCheckout . View demo . Add product to cart and go to checkout. The first thing that catches the eye is the updated section of "REVIEW YOUR ORDER". What's the matter? I don't even have time to pull the mouse! As a programmer, I am concerned that when you open the page sends an ajax request. If the user fills in First Name , Last Name , Email , Telephone , Address and in that moment realizes that he wants to buy, for example, not one, b

Google will pay Apple $ 1 billion in 2014 for the right to be the default search engine in iOS

Изображение
In the corporate world sometimes it's hard to tell who is who enemy, friend or partner. Most often, it is combined. Everything said is also true for Google and Apple. The company simultaneously partners and opponents each other in a number of trials. Nevertheless, business relations between the companies remained and even strengthened, with mutual benefit. So, Google will pay in 2014, about 1 billion of Apple to a search service of "Corporation of good" has remained the default search engine in iOS. It is worth noting that in 2009 Google paid for the same right only 82 million dollars. of every dollar of income that Google gets through the work of the search service in iOS (advertising, plus useful to the company data users), Apple gets 75 cents from Google. And allocable share of profits will only increase due to more active promotion of iOS. In addition, Google continues to pay the Mozilla Foundation to be the search engine No. 1 in the Firefox brows

Whose morphology better? Yandex vs Google

Изображение
There is an opinion that Russian morphology at Yandex are better implemented than Google. In this article, I will show that the situation is absolutely contrary. This article is an adaptation of my article on SeoNews Habra Russian morphology In the Russian language several hundred thousand words, and each of them can be in many forms. For example, the adjective can be in 100 word forms: In the end, if you save a morphological dictionary "in a forehead" we need about 500 MB. 500.000(number of words) * 75(i.e., the number of word-forms) * (10 (Ms. word length) + 4 bytes (to store the number of words + 2 bytes to store the number of word forms)) . To accelerate you need to keep all these data in memory, and the speed is critical in the case of search engines. There is a "compressed" view. Many words have the same endings in the same form. For example, "great" and "mighty." We need to keep only the beginning of a word (&q

Optimizing queries. The basics of EXPLAIN in PostgreSQL (part 3)

Изображение
Podolzhayut to publish the author's processing Understanding EXPLAIN from Guillaume Lelarge. Again note that some information has been omitted for brevity, so I strongly recommend to read the original. Previous part: Part 1 Part 2 ORDER BY the DROP INDEX foo_c1_idx; EXPLAIN (ANALYZE) SELECT * FROM foo ORDER BY c1; QUERY PLAN — Sort (cost=117993.01 120493.04..rows=1000010 width=37) (actual time=..571.591 651.524 rows=1000010 loops=1) Sort Key: c1 Sort Method: external merge Disk: 45952kB -> Seq Scan on foo (cost=0.00..18334.10 rows=1000010 width=37) (actual time=0.007..62.041 rows=1000010 loops=1) Total runtime: 690.984 ms (5 rows) First is Seq Scan of table foo . Then sorting Sort . The EXPLAIN command sign -> indicates a hierarchy of action ( node ). The sooner action is executed, the b o more indented it is displayed. the Sort Key — the sort term. the Sort Method: external merge Disk — sorting uses a temporary file on the disk 4

Use search engines to check the correctness of phrases

Изображение
At work I often have to correspond in English, and because of undertreated makeovers, to use this offline/online translation/the dictionary. In General, they cope with their work until the case comes to checking the correct phrases or whole sentences. Want to screw anything up from the category of advanced proficiency, but not sure that I remember correctly (a big Hello to prepositions and phrasal verbs). There are a couple of resources for search phrases, but they are sharpened mainly by common phrases, Proverbs and idioms in a particular language. Besides, it is not known whether the people desired phrase or using it you will baffle even a native speaker. To solve the problem I used to use Google. The method is simple to indecency: searching for the whole phrase (for those who don't know – the phrase you need to enclose it in double quotes), we get, as always a set of links + a great bonus in the form of heap advertising the number of pages found. That's the figure

the vmd — console application for downloading music from vk.com

you Have vk.com have a favorite musical group or friends that your musical tastes coincide? I have, Yes. And I wanted to have a current local copy of the music of these groups and friends to listen to it, for example in the car, the phone, player or anywhere else. Thus was born the idea of creating a console open source applications vmd (vkontakte music downloader), which I promised to lay out on github that this post . The program is multiplatform, works on linux, windows and mac os x. Download binary builds for these operating systems can be downloaded at home page project. Under jabracada learn how vmd to use and some technical details. How to use vmd? To use the program need to get api_id, clicking on the link: http://vk.com/apps.php?act=add . If you have api_id of the existing application can use it. After this we need to create a file with the session. Use the following command to generate it: the $ vmd --login <your email or phone number> --password

As I was writing my "Bicycle" to dotirovanie tables in Oracle and Postgre

Изображение
Greetings, Habr! In this article I will tell about how we struggled with the problem of rapid growth the size of the tables in the database on busy EMS system. The highlight adds that the problem has been solved for two databases: Oracle and Postgre. Interested please under cat. Initial conditions So, there is a certain EMS system that receives and processes messages from network elements. A record of each message is logged in the database table. According to customer requirements the number of incoming messages (and therefore number of records in the table) is an average of 100 per second, while the peak load may increase to 1500. It is easy to calculate that a day on average, more than 8 million records in the table. The problem appeared when it turned out that when the data volumes of more than 20 million rows some queries of the system begin to slow down and to go beyond the work time requested by the customer. Task Thus, I had to figure out what to do with

Google has to remove eight 'pirate' links per second

Изображение
For a long time, Google receives requests from copyright holders to remove pirate links from the search results. Captain Obvious tells us that pirate here should be considered as links that lead to resources that illegally distribute copyrighted content. So, it all started small, and now Microsoft have to remove a week for around 5 million such links. Anyway, that's the number of links removed from the SERPs for the last week of September this year (5.8 million links, and that is a record). this means that removed about eight pirate links per second. Unfortunately, it is difficult to understand how the mechanism of consideration of applications of the right holders, and how the consideration with the subsequent removal. What is clear is that people with this volume of tasks would not have made it so that it runs a special algorithm, which we probably can "steer" manually. But the algorithm of examination of applications we are not very interesting, mu

Convenience or paranoia-what is more important? The story of one app

Good day dear harcane. I want to share with you a little story of a single application. Just wanted to warn you that there are no codes, nothing associated with them, only their own experience of productive paranoia and history of the same application. where everything began The first year I regularly fed financial freelance. Many of you are probably familiar with the situation when comes the time of vacations, and on a freelance appears a crisis situation with a number of projects, and you have to sweat to snatch a project. And of course at such times the work is Murphy's law. For example, you went to the store, and at this moment has published a draft just on your profile, and while you walk, the project is already gone. Certainly not the one I would be upset at such moments. looking for a way out About a year ago I became the proud owner of Android device. And how can I be surprised when in the Google Market have not found applications for monitoring freelanc

I retrain people to Java programmers

Изображение
When I see friends who are injected twice more, and earn less than four times, each time starting a conversation: — You wouldn't want to work as a programmer? You're really smart. Maybe you're just not in place? I retrain their friends and acquaintances for programmers. The whole process takes two to three months. 25 lessons 4 hours. Then all were able to get a programmer. This article is not about how to teach, rather just a description of the process that works. about me: ten years of programming. Half of which was programmed in Java. I just retrained into programmers eight people. Three more are taught right now. Retrain only if I see that man a job at all. disciples 3 guys and 8 girls. Half technical education. Also a lawyer, economist, accountant, and historian. Some already worked, some have just finished University. Programming no one did at school. Common story: I graduated from (a) the University, and whom and where to work — Hz. Why prog

Comparing Windows Azure Blob Storage and Amazon Simple Storage Service (S3)–Part I

Good afternoon, ladies and gentlemen. I suggest you read the translation of the next part of the comparison of the services of the storage of two well-known cloud platforms. Other translations will be posted as registration. the First part of a cycle — Comparing of Windows Azure Table Storage and Amazon DynamoDB In this series I want to compare the basic functionality of Windows Azure Blob Storage Service and Amazon Simple Storage Service (S3) . In this part we will look at basic concepts, pricing and compare the functionality of BLOB containers and baskets. In part II we will compare the blobs and objects. In part III I will give the conclusions in part IV — comparing of Windows Azure Blob Storage and Google Cloud Storage. Abbreviations: Windows Azure Blob Storage — WABS, Amazon Simple Storage Service – AS 3. Conceptually WABS and AS3 are similar in the functionality of the system. In short, both systems can be viewed as a file system in the cloud, in which the user sto