Сообщения

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

AimTask, or how we did the task scheduler

Изображение
Hello world! In this article I will tell you about how my friends were doing their version of the software implementation of GTD and in the end we did it. How did what we did and what we wanted to in the end? How it all began and than ended? So are you still interested? Then, as they say, Welcome under kat. It all started about a year ago my acquaintance with the customer and the ideologist of the project. After a brief telephone conversation with him in my head was postponed only what you need to do what the program, such as for internal needs of the institution where the customer, in which you can create and store your notes in General, a piece of cake of the same month. Therefore, the meeting with the customer I was with a clear certainty that will give me a small TK I will do it fast and you get a modest fee. However, at the meeting it became clear that need to do some more, namely a task management system that will work on all possible platforms, with the abili

The creation of a world map based on OpenStreetMap data

the Backstory When developing a project for online navigation (and offline in the future) there was a need to develop their own online maps. Services from Google, Bing, etc. have limited use of their maps for commercial purposes. Free, like OpenStreetMap, did not satisfy the requirements of the customer. There was a question about creating online maps (tile maps) for the whole world. Style close to Google and Skobbler. Data based on OpenStreetMap. Limitations Known file systems have limitations in number of files and directories. Therefore, the storage of each tile (tile maps) separately depends on these restrictions. For instance, the 14th Zuma need 267 583 488 tiles (~4 14 ). View the maximum number of files in Linux: df-i The solution is to store the tiles in the database. Iron and axis Server generation and load data: Supermicro server. 24 cores at 2GHz, 64Gb RAM, HDD 2.7 Tb. With Ubuntu 13.04 on the Board. A server which is using the results of generation

Creating extensions in PostgreSQL

Изображение
Hello, habrachelovek! The theme of this article is to create extensions for PostgreSQL . As an example, we implement a small library for working with 3D vectors. In parallel will be considered user-defined types, operators, and casts. Will not be superfluous oznakomitsya with this material, since the implementation of stored functions would in C. I Hope the elephants will help to brighten up the grey text. Description Extension in the PostgreSQL is a collection of multiple SQL objects (data types, functions, operators), combined in a script, dynamically loadable library (if necessary) and the control file, which specifies the name of the script, the library path, the default version and other options. Using extensions allows you to easily deploy additional logic in the DB, do the migration to a newer version and, if you remove the extension properly delete the dependent objects. We need to create a new data type vector3 and determine the following operations: the

A sample of updatable materialized views in PostgreSQL 9.3

Изображение
Hello, habrachelovek! You probably already felt materialized views , appeared in PostgreSQL 9.3. One of the drawbacks is that in the process of updating the representation uses exclusive (ACCESS EXCLUSIVE) lock, making it impossible to query performance. In PostgreSQL 9.4 planiruetsya add ability to read from the view during updates. So, in this post, I want to show one of the ways out of this situation. Will help us in this matter double buffering . The gist of it is that creates two materialized views, while one is updated (the entity on which it depends the submission locked in ACCESS SHARE mode that allows you to make requests to them), the second can work. Once the update is complete, rearrange them. Helper functions to create and delete views: the CREATE OR REPLACE FUNCTION public.create_materialized_view ( p_viewname text, text p_basename ) RETURNS void AS $BODY$ BEGIN EXECUTE 'CREATE MATERIALIZED VIEW' || p_viewname || 'AS SELECT * FROM' |

Example of savings on a license when implementation of the server 1C enterprise

Изображение
Good day, the article was written as a continuation of this opus. 1C is quite often criticized, often objective, but I will try to show by example that 1C provides the freedom of choice that at the present time at least deserves respect. Also a little count money. prologue. The main activity of our company is IT outsourcing. Rather marketing-enthusiastsi purposes, we create templates of solutions that allow us to standardize the IT infrastructure players, and the client to obtain and most importantly to realize the savings (if he praises the report, no one will notice). Customers — small companies of 20 to 200 people. One such solution is the implementation of 1C server to free enterprise Linux + Postgres SQL. The article is not yet another technical implementation as all have been chewed and chewed . Will only compare our standard offer of 1C franchisees and our economical option may 2014. Problem # 1. To make the transition database with a file operation on a

Introduction to PostgreSQL BDR

Изображение
Introduction to PostgreSQL BDR PostgreSQL is not only stable and reliable DBMS but plus to all this is a dynamic product, in which from release to release appear to be a variety of breakthrough ideas. At the time one of such technologies was streaming replication. This high-performance replication which allows for very easy and cheap to scale the database to read. Using it you can create a reliable configuration distributing load to read between nodes. However, as I wrote above, the product developed, and today we will focus on new technologies BDR (Bi-Directional Replication). Some terms for those who are not in the subject: WAL (Write Ahead Log) — the transaction log, it is based on built-in streaming replication Postgres, the DBMS writes back all what happens to the data in the database. SR (Streaming Replication) — the common name of the built-in streaming replication which is based on WAL, all that is written to WAL, and then sent to the slave and played. Sometim

Postgres. Sample N random records

When working on the same project had the need to write some semblance of a test system. The task was formulated like this: the the of the N records in the database it is necessary to choose m (3-5) random strings in a series of k samples (mainly k=2). And now the same human language: from the table need to choose 3-5 random records. This should not be duplicate and sample should occur at random. The first thing that comes to mind: the SELECT * FROM data_set WHERE id NOT IN (1,2,3,4, 5) ORDER BY random() LIMIT 5; And it will even work. But the price of such a decision. So I had to use "higher intelligence" , which gave hint for the solution . the WITH RECURSIVE r AS ( WITH b AS (SELECT min(id), max(id) FROM table1) ( SELECT id, min, max, array[]::integer[] AS a, 0 AS n FROM table1, b WHERE id > min + (max - min) * random() LIMIT 1 ) UNION ALL ( SELECT t.id, min, max, a || t.id, r.n + 1 AS n FROM table1 AS t, r WHERE t.id > min

Yes, from Oracle to Postgres

Изображение
it just So happens that our Oracle organization works long and tight. I myself met with Oracle Database, in the days of the 6th version and, since then, any discomfort experienced. Messed up market relations. Recently, we began to notice that the Customer is looking much more favourably on our projects if they use the free SBD . About porting one of these projects and my story... Selection of free DBMS was, for me, a matter of long and difficult but, ultimately, boiled down to two all known alternatives. PostgreSQL attracted a rich (and still growing) functionality, while the MySQL lured by the performance and the "zero" administration. Because Oracle is we are spoiled and SQL we all knew and loved, numerous and fashionable NoSQL options have disappeared in the semi-finals. It is difficult to say which DBMS I would have stopped eventually, if not one can give me a "live" feel and PostgreSQL and MySQL, do not hurry to compare them and to take, in my opi