<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arikshtein on Medium]]></title>
        <description><![CDATA[Stories by Arikshtein on Medium]]></description>
        <link>https://medium.com/@arikshtein2?source=rss-1c08677dfe2f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*UxenCFMAnFoc9CGfA8XQqg.jpeg</url>
            <title>Stories by Arikshtein on Medium</title>
            <link>https://medium.com/@arikshtein2?source=rss-1c08677dfe2f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 20:06:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arikshtein2/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Let’s build a data streaming system (without AI)]]></title>
            <link>https://medium.com/@arikshtein2/lets-build-a-data-streaming-system-without-ai-d8a0ced47a3c?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8a0ced47a3c</guid>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 10:08:27 GMT</pubDate>
            <atom:updated>2026-03-29T10:16:42.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I94z5puuJRAwwHSPe4qRJg.png" /></figure><h3>Introduction</h3><p>If you’re reading this, chances are, you already know how to work with data in large data lakes and distributed data warehouses. In the last 20 years, this process has evolved from writing 300 lines of MapReduce Java code to get a simple “word count” to 15 lines of standard SQL query to calculate MRR ... FROM Payments</p><blockquote><em>But how does all that data get there?</em></blockquote><p>Many people aggregate through terabytes of data without ever asking that question. I don’t judge: if the division of responsibilities works that well inside your company — good for you. This article is for people who either what to go beyond SELECTing FROM Payments and for those, who want to be able to at least try something if the data flow stops and the person responsible for it is on sick leave.</p><p>Of course, a lot of data comes into analyst’s possession from a two-step Cron job scheduled somewhere at 2AM that performs a CSV Export of a SELECT * FROM table/view and then another CSV Import command in the target big data system. And that’s probably your most reliable, most accurate, precise and hopefully best-structured data. It is unlikely to fail and if that happens, just run the Cron job again.</p><p>But that’s not all of your data. Most of it comes from user actions or sensors signals — the never ending stream of information that flows in 24/7. It doesn’t rest, doesn’t sleep, doesn’t go on maintenance mode, doesn’t take vacations, no bank holidays or sick leave. It can’t be cron-scheduled, can’t be held off till later or you’re risking loosing it. And that we can’t allow.</p><p>There are many applications/frameworks that were made for dealing with that kind of data — open source (Apache Beam, Apache Flink, Apache Storm) or proprietary (usually baked into the tool/platform like Databricks, BigQuery, Snowflake. They all support streaming inserts now). They are all different, but they operate under the same set of principles. And we’re going to focus on the latter, instead of narrowing down on one tool.</p><p>I’d like to suggest we build one. Or at least conceptualize a data streaming tool. Primarily because when you know how it’s built, it already means you know what is more likely to break, or cause bottlenecks. You’re not likely to use what we’ll be building in a production environment because, at least for my use-case, the reason why I started it in the first place, as of today, is completely irrelevant and solved. But I still consider it as a great exercise for (data) system design. I’ll leave details on my journey in the bottom of the article.</p><p>Let’s start then. I’ll start with creating the most basic core requirement then implement it. After that I’ll introduce another requirement then adapt my code.</p><h3>Before we dive in: Queueing</h3><p>In all the use-cases I’ve worked with, the stream is usually gathered into a queue. Usually it’s either Apache Kafka or some cloud solution like PubSub, Firehose, Azure Event Hub. Think of it as a hotel hallway for guests before they are accommodated into their respective floors/rooms. They form a line at the reception while the receptionist (the stream consumer) greets them and decides where accommodate them (the processing of the stream) according to their needs (maybe it’s a family of 4, maybe they want 2 rooms, or 1 or 3. Or maybe it’s a tour group who need to stay in the same floor…).</p><p>I won’t go in detail about this part of the infrastructure. It, too, has to be set up accordingly, but we’ll assume that it’s already done. If you’d like to learn more about Kafka (or messaging systems), I strongly suggest <a href="https://www.gentlydownthe.stream/">this</a> resource.</p><h3>Stage 1: Naive and simple</h3><p>So the first requirement is to</p><ul><li>(Read from or) consume the stream (greet your guests)</li><li>Process and save the data (distribute them across hotel rooms)</li></ul><p>For starter’s let’s assume 1 machine (receptionist) doing both jobs by themselves. For the moment we’ll not process anything, we’ll just save the data. Although we can probably save the data directly to our warehouse, my go to choice is to save it as Parquet, because</p><ul><li>It’s already supported (as an “external data source” or whatever they call it) by most data warehouse systems</li><li>If you keep your data in the native format of the data warehouse provider, that locks you with them and migrating will be painful and costly.</li><li>I can use Parquet files with several different tools at the same time. It’s very universal.</li><li>Basic Parquet is performant and simple enough to write into and read from.</li><li>General Cloud Storage (GCS / S3 / ADLSgen2) will usually be cheaper than proprietary data storage (tailored to specific tool’s needs).</li><li>You can store Parquet on-premises and not use any cloud provider.</li></ul><p><em>Yes, I know about Iceberg and Delta Tables. But, even though they have additional features and advantages over simple Parquet, there’s additional effort to set those up (like Iceberg Catalog Service) and those additional features I didn’t really need. So regular Parquet it was. Read more in the last section.</em></p><p>The <em>receptionist </em>will speak to each individual person and assign a room to them. The pseudo-python equivalent for this would be</p><pre>from kafka import KafkaConsumer<br>import json, os<br><br>import pandas as pd<br>import pyarrow as pa<br>import pyarrow.parquet as pq<br>reception = KafkaConsumer(&#39;hotel&#39;)<br><br># every time a &quot;guest&quot; enters the &quot;hotel&quot;, the content<br>#   of the for loop will be executed. Otherwise it waits.<br># this is how the kafka python library works and it&#39;s beautiful.<br>for guest in reception:<br>    # greet the guest<br>    guest_dict= json.reads(guest)<br><br>    # accommodate into room (parquet)<br>    guest_df = pd.DataFrame([guest_df])<br>    guest_table = pa.Table.from_pandas(guest_df)<br>    pq.write_table(guest_table, &#39;/data_lake/guest_&#39; + guest[&#39;ID&#39;] &#39;.parquet&#39;)<br><br>    # upload to cloud and remove local file<br>    move_file_to_s3(&#39;/data_lake/guest_&#39; + guest[&#39;ID&#39;] &#39;.parquet&#39;, ...)<br>    os.remove(&#39;/data_lake/guest_&#39; + guest[&#39;ID&#39;] &#39;.parquet&#39;)</pre><p>The biggest problem with this approach is that each message (guest) will have their own parquet (room). On one hand if you have millions of messages coming every day, that’s at least 30 millions of individual files and nothing will be able to swiftly traverse them for any analytical task. Second, parquet file format is designed for having large amount of data in one file and 1 line per file is not taking advantage of any of those.</p><h3>Stage 2: Mini-batching</h3><p>Ok, instead of creating 1 parquet per event, let’s batch them in groups of, say, 10&#39;000. This way we’ll benefit from parquet optimizations and cut the number of files by a factor of 10&#39;000. I’ll also add in some basic partitioning for the files to be a bit more organized and we don’t store files from 15 years ago in the same place as today’s arrivals.</p><pre>from kafka import KafkaConsumer<br>from datetime import date<br>import json, os<br><br>import pandas as pd<br>import pyarrow as pa<br>import pyarrow.parquet as pq<br><br>reception = KafkaConsumer(&#39;hotel&#39;)<br>minibatch = []<br><br>for guest in reception:<br><br>    # greet the guest<br>    guest_dict= json.reads(guest)<br><br>    # reset the batch if necessary then add to the batch<br>    if len(minibatch) &gt; 10 000:<br>        minibatch = []<br>    minibatch.append(guest_dict)<br><br>    # continue accumulating the minibatch if not yet reached 10&#39;000<br>    if len(minibatch) &lt; 10 000:<br>        continue<br><br>    # accommodate batch into room (parquet) if 10&#39;000 have been batched<br>    batch_id = random_string()<br>    guests_df = pd.DataFrame(minibatch)<br>    guests_table = pa.Table.from_pandas(guest_df)<br>    pq.write_table(guests_table, &#39;/data_lake/batch_&#39; + batch_id +&#39;.parquet&#39;)<br><br>    # upload to cloud, **hive-partitioned** and remove local file<br>    move_file_to_s3(&#39;/data_lake/date=&#39; + str(date.today()) + &#39;/batch_&#39; + batch_id &#39;.parquet&#39;, ...)<br>    os.remove(&#39;/data_lake/batch_&#39; + batch_id &#39;.parquet&#39;)</pre><p>For anyone wondering, yes, we are accommodating 10&#39;000 guests per room. It’s okay, the rooms are very spacious and the guests don’t mind.</p><p>Notice the date=str(date.today()) statement. It is the expected path format for <strong>hive partitioning</strong> and most engines will pick that up (with some setups) and not even attempt to check the files in other folders if you filter your query to WHERE date = ‘2026–03–01’. This will greatly reduce the amount of data processed, therefore the query time and the cost (for those paying per cpu/hr, not a fixed per month bill).</p><p>There is still problem with our approach. First of all, yes, there’s just one receptionist doing both jobs (but we’ll get to that later), but if the receptionist suddenly leaves (the machine shuts down unexpectedly), the 9&#39;999 events accumulated in the reception will simply disappear. (For people with more advanced knowledge of Kafka, yes, we can decide to not acknowledge reading the messages until we successfully write them, but that I will address later, in the end).</p><p>An easy fix would be to, instead of keeping the “guests” in memory, write the events into text files locally. This way, if shutdown happens, they won’t be lost.</p><h3>Stage 3: Writing to local files</h3><p>I won’t re-write the entire code, just where there was a change</p><pre>...<br>batch_counter = 0<br>batch_id = random_string()<br><br>for guest in reception:<br>    # reset the batch counter + generate a new batch_id if necessary<br>    if batch_counter &gt; 10 000:<br>        batch_counter = 0<br>        batch_id = random_string()<br>    <br>    # append to batch file and increment the counter<br>    append_line_to_file(&#39;/data_lake/batch_&#39;+batch_id+&#39;.txt&#39;, guest)<br>    batch_counter += 1<br><br>    # continue accumulating the minibatch if not yet reached 10&#39;000<br>    if batch_counter &lt; 10 000:<br>        continue<br><br>    # accommodate batch into room (parquet) if 10&#39;000 have been batched<br>    minibatch = read_as_json(&#39;/data_lake/batch_&#39;+batch_id+&#39;.txt&#39;, guest)<br>    guests_df = pd.DataFrame(minibatch)<br>    ...<br>   <br>...</pre><p>Ok, now the data won’t be completely lost if the script shuts down unexpectedly. It will remain in a file… forever and ever… Because we only process the batch_id-s that were generated in the current session.</p><p>Instead of relying on variables, we want to have a more persistent place where we’d write down the batch_ids. This will ensure that if our app restarts, neither the actual data, nor thebatch_id is lost. We can pick off where we were interrupted and operate as it didn’t happen in the first place.</p><h3>Stage 4: Persistent batch_id storage</h3><p>The logic is simple: on app startup, we check if current_batch_id.txt exists. If it does, we need to know how many rows are inside the batch file, then set the corresponding variables to corresponding values and move on as usual. Every time we generate a new batch_id , we (over)write that ID into current_batch_id.txt . This way, if the service restarts, we will continue writing into the same batch_id until it’s time to “accommodate” it.</p><pre>...<br>batch_counter = 0<br>batch_id = random_string()<br><br>if os.path.exists(&#39;current_batch_id.txt&#39;):<br>   batch_id = read_file_as_string(&#39;current_batch_id.txt&#39;)<br>   batch_counter = number_of_lines_in_file(<br>      &#39;/data_lake/batch_&#39; + batch_id + &#39;.txt&#39;)<br><br>for guest in reception:<br>    ...<br>    # append to batch file and increment the counter<br>    append_line_to_file(&#39;/data_lake/batch_&#39;+batch_id+&#39;.txt&#39;, guest)<br>    batch_counter += 1<br><br>    # continue accumulating the minibatch if not yet reached 10&#39;000<br>    if batch_counter &lt; 10 000:<br>        continue<br><br>    # accommodate batch into room (parquet) if 10&#39;000 have been batched<br>    minibatch = read_as_json(&#39;/data_lake/batch_&#39;+batch_id+&#39;.txt&#39;, guest)<br>    guests_df = pd.DataFrame(minibatch)<br>    guests_table = pa.Table.from_pandas(guest_df)<br>    ...<br><br>    # reset the batch counter <br>    # + generate a new batch_id if necessary<br>    # + persist the batch_id into a file<br>    batch_counter = 0<br>    batch_id = random_string()<br>    overwrite_file_content(&#39;current_batch_id.txt&#39;, batch_id)</pre><p>I have moved around the blocks a bit to avoid a bug where the batch_id will be reset after two consecutive restarts. Yes, there is one more bug that 100 consecutive restarts will potentially result in a batch with 10&#39;100 rows, but that I can live with.</p><p>Writing the count of rows into the file sounds like a good idea, but it absolutely isn’t: messages arrive in thousands by second. Every millisecond of CPU counts, every operation that’s not absolutely necessary will slow us down immencely. Considering we only want to know the count of rows in a case of crash, it’s best to count it when it’s needed, not every millisecond.</p><p>This approach would work. However…</p><p>The reality of the “hotel” industry is that the flow of “guests” is not constant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OCx8vjBiJLcTBaU2.jpg" /></figure><p>And you probably don’t prefer the frequency of your dashboard updates to be “whenever users perform 10&#39;000 actions”. Stakeholders expect clarity and predictability. Of course, you can set it to be a number so low, that the fluctuations seem barely noticeable. But then again, creating 1 file per second is going to result in too many files.</p><p>Therefore let’s replace the concept of “count-based mini-batching” with “time-based mini-batching” or as they call them in traditional streaming systems “time-based <strong>windows</strong>”.</p><h3>Stage 6: Time-based mini-batching</h3><p>Instead of relying on number of lines, we’ll now decide a time window (say, batch creation time till +15 minutes) for each batch and while the <em>current time</em> falls under that time frame, we’ll continue writing into it. When the time expires, we create a new mini-batch and the previous is up for moving to main storage.</p><pre>import ...<br><br>BATCH_DURATION = 15<br><br>reception = KafkaConsumer(&#39;hotel&#39;)<br>minibatch = []<br>batch_id = random_string()<br>minibatch_start_date = datetime.now()<br>minibatch_end_date = minibatch_start_date + timedelta(minute=BATCH_DURATION)<br><br>for guest in reception:<br>    # read guest data, append to batch file<br>    ...<br><br>    # continue accumulating the minibatch if not yet expired<br>    if datetime.now() &lt; minibatch_end_date:<br>        continue<br><br>    # accommodate batch into room (parquet) if time window has passed<br>    minibatch = read_as_json(...<br>    guests_df = pd.DataFrame(minibatch)<br>    ...<br><br>    # generate new minibatch<br>    minibatch = []<br>    batch_id = random_string()<br>    minibatch_start_date = datetime.now()<br>    minibatch_end_date = minibatch_start_date + \<br>      timedelta(minute=BATCH_DURATION)</pre><p>Unfortunately we’ve lost our ability to recover batches after restarts. Writing down only the batch_id into a file will no longer work, because 2 additional values are attached to the concept of it: the start time and the end time.</p><p>Yes, it’s completely possible to write that information into a file too, but maybe, just maybe… let’s use a proper database, eh?</p><h3>Stage 5: Database as batch_id storage</h3><p>I’m going to suggest we use MySQL / PostgreSQL instead of SQLite, because we need the database service to be highly available (which SQLite cannot be). Otherwise the DB becomes a <strong><em>single point of failure</em></strong> and we don’t want that.</p><p>Let’s create a simple table with basic batch info ( id, start_date and end_date). Let’s call it checkpoints and in general, start calling batches <strong>checkpoints </strong>instead</p><pre>| checkpoint_id |       start_date       |        end_date        |<br>|---------------|------------------------|------------------------|<br>|   2dbv65fx    | 2026-03-20 13:53:42.1  | 2026-03-20 14:08:42.1  |<br>|   pb3ksz5k    | 2026-03-20 14:08:42.1  | 2026-03-20 14:13:42.1  |</pre><p>Every time a new checkpoint is generated, we’ll INSERT it into this list (alongside with the accompanying information) and every time a checkpoint_id is processed and moved to cloud successfully, we’ll remove it from this list.</p><p>In this example, the second row in the table, being the latest one, is most probably still being written into so we shouldn’t touch that. Anything before that, however, should go.</p><pre>import ...<br><br>CHECKPOINT_DURATION = 15<br><br>reception = KafkaConsumer(&#39;hotel&#39;)<br><br># Neat trick to reduce the number of individual variables<br>@dataclass<br>class Checkpoint():<br>  id: str<br>  start_date: datetime<br>  end_date: datetime<br><br># For simplicity, let&#39;s wrap new checkpoint_id generation and DB writing<br>#   into a function. It will return a new instance of Checkpoint with<br>#   all corresponding data.<br>current_checkpoint = \<br>  db.generate_new_checkpoint(datetime.now(), CHECKPOINT_DURATION)<br><br>for guest in reception:<br>    # read guest data, append to batch file<br>    ...<br><br>    # search for expired checkpoints in the db.<br>    # as agreed, a checkpoint is expired, if the end_date is <br>    #   before datetime.now()<br>    expired_checkpoints: list[Checkpoint] = \<br>      db.query_as_checkpoint(<br>        &quot;SELECT * FROM checkpoints WHERE end_date &lt; &quot; + str(datetime.now()))<br><br>    # accommodate expired checkpoint(s) into room (parquet)<br>    for chechkpoint in expired_checkpoints:<br>      chechkpoint_file = read_as_json(...<br>      ...<br>      # after checkpoint is accommodated into the room, <br>      #   remove the row from the DB<br>      db.remove_checkpoint(checkpoint .id)<br><br>       # generate new minibatch<br>       current_checkpoint= \<br>         db.generate_new_checkpoint(<br>          current_checkpoint.end_date, CHECKPOINT_DURATION)</pre><p>I don’t know about you but to me this looks cleaner. Not because I’ve hidden most of the code, but because the logic is now more straightforward.</p><p>Notice that we’re also covering the edge case where there might be multiple expired checkpoints per turn.</p><p>We will not be trying to “continue” filling in incomplete checkpoints because it’s easier to start over and <em>accommodate</em> the failed ID as if it was a normal one.</p><p>The only thing left here is that, theoretically, if the worker restarts 5 minutes into starting a checkpoint, we will of course not loose any data and eventually write it into the target destination, but it will be sitting there for 10 minutes doing nothing. Truth is if there is more than 1 checkpoint in the table, the earliest one can be safely processed, regardless if it’s expired or not. There’s no instance where we write into 2 checkpoints at the same time.</p><p>So</p><pre>...<br>expired_checkpoints: list[Checkpoint] = \<br>      db.query_as_checkpoint(<br>        &quot;SELECT * FROM checkpoints WHERE end_date &lt; &quot; + str(datetime.now()))<br>...</pre><p>becomes</p><pre>...<br>expired_checkpoints: list[Checkpoint] = \<br>      db.query_as_checkpoint(<br>        &quot;SELECT * FROM checkpoints ORDER BY start_date DESC OFFSET 1&quot;)<br>...</pre><p>This query will get all checkpoints (from newest to oldest) but skipping the first one (which is most probably being written into right now).</p><p>Now let’s address the elephant in the room: if <em>guests </em>are arriving hundreds every millisecond, do we need to poll the DB every time? Even if the DB took 0ms to respond, that is still additional CPU resources spent on fetching the data, converting the data types, etc. We want to <em>greet</em> the guests as soon as they arrive, but we’re okay if they stay in the <em>reception</em> for 5 more seconds. What I’m saying is that if we polled the db every 5 seconds, instead of every millisecond, it would save us a ton of effort and would barely affect the end result.</p><h3>Stage 6: Division of responsibilities</h3><p>We <em>could</em>, of course, put a timer and invoke the inner for loop only once in 5 seconds, but consider this: if processing a checkpoint takes, say, 5 minutes (spoiler — it usually won’t but it just might), the entire code will be blocked until that loop is completed and we won’t be reading any events from Kafka in the meantime. Number of unprocessed messages will jump unexpectedly every 15 minutes or whatnot which, by itself isn’t bad, but is a bad practice.</p><p>What I’d suggest instead is for <strong>processing </strong>a batch to be separate from <strong>collecting</strong> a batch. After all, we’ve implemented a DB layer, so there’s absolutely no reason for those 2 very distinct functionalities to stay in the same for loop. I’d go even further and suggest, that they don’t even have to stay in the same python process. They are completely able to operate independently from one another and communicate when needed through DB. The alternative, after all, is subprocesses and anyone who has worked with those, knows very well how they are a pain to manage.</p><p>So I’ll go ahead and separate our code into 2 parts</p><pre># mapper.py<br><br>import ...<br><br>CHECKPOINT_DURATION = 15<br><br>reception = KafkaConsumer(&#39;hotel&#39;)<br><br>@dataclass<br>class Checkpoint():<br>...<br><br>current_checkpoint = \<br>  db.generate_new_checkpoint(datetime.now(), CHECKPOINT_DURATION)<br><br>for guest in reception:<br>    # read guest data, append to batch file<br>    append_line_to_file(&#39;/data_lake/batch_&#39;+batch_id+&#39;.txt&#39;, guest)<br><br>    # generate new checkpoint upon expiration<br>    if datetime.now() &gt; current_checkpoint.end_date:<br>       current_checkpoint= \<br>         db.generate_new_checkpoint(<br>          current_checkpoint.end_date, CHECKPOINT_DURATION)</pre><p>And the py file for processing checkpoints</p><pre># reducer.py<br>import ...<br><br>DB_POLL_INTERVAL = 5*60<br><br>while True:<br>    # check for expired checkpoints<br>    expired_checkpoints: list[Checkpoint] = \<br>      db.query_as_checkpoint(<br>        &quot;SELECT * FROM checkpoints ORDER BY start_date OFFSET 1&quot;)<br><br>    # accommodate expired checkpoint(s) into room (parquet)<br>    # moved to dedicated method<br>    for chechkpoint in expired_checkpoints:<br>      process_and_remove_checkpoint(cheeckpoint.id)<br><br>    # wait for 5 seconds to query the DB again<br>    time.sleep(DB_POLL_INTERVAL)</pre><p>Now we have <strong>clear division of responsibilities</strong> and not only the logic is simpler now, also an advantage of this approach is that failure of one of the processes will not lead to full shutdown of the entire system. Of course, this doesn’t mean we can disregard errors, but the part of the pipeline that is not affected by the failure can and will continue to operate. Even better, once the failed part is back up again, it will gracefully return to normal operations.</p><ul><li>If the <strong>reducer </strong>fails and stays down for a 24hrs, the <strong>mapper </strong>will accumulate 24x15 checkpoints in local disk silently (bear in mind, there will be no cpu/memory overload, all files are kept on disk and storage is cheap + extendible). Once the reducer is back up, it will immediately start processing those checkpoints (because they will all be expired) and will eventually catch up.</li><li>If the <strong>mapper </strong>fails and stays down for 24hrs, the <strong>reducer </strong>will consume the latest checkpoint and will silently wait for new checkpoints to appear (minimal CPU, no memory used)</li></ul><p>I didn’t add any monitoring / alerting principles to the code because I’m hoping that <strong>kubernetes</strong> will take care of those once we go live. Ask your local DevOps for more info if you’re new to k8s :)</p><h3>Stage 7: Scaling up</h3><p>We did a great job so far, our system is working, it’s consuming messages from Kafka and parquet files are appearing in S3.</p><p>Unfortunately upon monitoring Kafka closer, we notice that a single <strong>mapper </strong>is not keeping up with the sheer volume of messages and they start piling up. Adding more CPU to the VM doesn’t help because our code is not parallel. Therefore we can only scale <strong>horizontally</strong>: add more <strong>receptionists</strong> (more <strong>mappers</strong>). This is the equivalent of adding new entrances to our hotel building — each with their own reception desk.</p><p>This will almost work out of the box, except the assumption of “if there’s more than 1 row in checkpoints , all except the newest one can be processed” no longer stands, because there will normally be 2 active checkpoints. We can’t replace OFFSET 1 with OFFSET 2either, because difference scenarios of crash recoveries might result in uncertain outcomes on which checkpoint to pick. Yes, we can go back to explicitly processing only expired checkpoints but that’s a workaround.</p><p>Besides, what if we want to scale the <strong>reducers</strong> too? Out of the box it won’t work — there will be a <strong>race condition</strong> on which reducer should consume which checkpoint. Best case scenario — one fails constantly, worst case scenario — they both succeed and we get duplicated data.</p><p>We need another level of <em>division of responsibilities</em> here, but this time across workers of the <strong>same type</strong>. If there are 2 reducers, the first one’s work should not affect the second one’s and vice versa. Same for <strong>mappers </strong>(although that one is already in place).</p><p>Let’s start by introducing a concept of <strong>workgroup</strong>s — assign a number to each mapper-reducer pair. If we have launched 2 pairs, the first mapper+reducer will have a group_id=0 and the second will have group_id=1 and so on. This will be managed by kubernetes and injected into the container through an <strong>environment variable</strong> so that everyone knows the team they’re on.</p><p>Next we go back to the DB and add the group_id as a column to our checkpoints table</p><pre>| group_id | checkpoint_id |       start_date       |        end_date        |<br>|----------|---------------|------------------------|------------------------|<br>|    0     |   2dbv65fx    | 2026-03-20 13:53:42.1  | 2026-03-20 14:08:42.1  |<br>|    0     |   pb3ksz5k    | 2026-03-20 14:08:42.1  | 2026-03-20 14:13:42.1  |<br>|    1     |   3jmxcql8    | 2026-03-20 13:57:12.8  | 2026-03-20 14:12:12.8  |</pre><p>Now the <strong>Reducer</strong> with group_id=0 will only take interest in checkpoints created by <strong>Mapper </strong>0 and Reducer 1 will only look at checkpoints with group_id=1</p><p>What’s great about this change is that it’s enabling a very important property to our system (horizontal scaling) and doesn’t really introduce a lot of new code. See for yourself:</p><pre># mapper.py<br><br>...<br>GROUP_ID = os.env(&quot;GROUP_ID&quot;)<br>...<br><br>current_checkpoint = \<br>  db.generate_new_checkpoint(datetime.now(), CHECKPOINT_DURATION, GROUP_ID)<br><br>for guest in reception:<br>    # read guest data, append to batch file<br>    ...<br><br>    # generate new checkpoint upon expiration<br>    if datetime.now() &gt; current_checkpoint.end_date:<br>       current_checkpoint= \<br>         db.generate_new_checkpoint(<br>          current_checkpoint.end_date, CHECKPOINT_DURATION, GROUP_ID)</pre><pre># reducer.py<br>...<br>GROUP_ID = os.env(&quot;GROUP_ID&quot;)<br><br>while True:<br>    # check for expired checkpoints<br>    expired_checkpoints: list[Checkpoint] = \<br>      db.query_as_checkpoint(&quot;&quot;&quot;<br>         SELECT * FROM checkpoints <br>         WHERE group_id = %<br>         ORDER BY start_date OFFSET 1&quot;&quot;&quot;, GROUP_ID)<br><br>    # accommodate expired checkpoint(s) into room (parquet)<br>    for ...</pre><p>We’re at the finish line now. Let’s see what properties does our distributed system possesses:</p><ul><li>Horizontal scaling — yes. We can scale the number of mappers and reducers as high as we can. It will result in linear performance increase without compromising on stability</li><li>Durability — yes. If the system crashes and is restored some time after, no data will be lost and we will catch up eventually</li><li>Load balancing — partial. <br>If a <strong>pair</strong> of mapper-reducer fails, the load will be evenly rebalanced between the rest. <br>If only a <strong>mapper </strong>(or several) fails, we’ll have a dangling reducer left doing nothing, occupying resources, but the system will work and the load will still be distributed fairly among others.</li></ul><p>However we have some gaps:</p><ul><li>Scaling up works fine now, but <strong>scaling down</strong> would be a bit pain to manage. If we shut down the entire group randomly, we ran into a high chance of a checkpoint staying unfinished… forever. We’ll need to shut down the <strong>mapper</strong> first, wait for CHECKPOINT_INTERVAL minutes, see through the checkpoint being fully processed, and only then shut down the <strong>reducer</strong>.</li><li>What if only a reducer (or several) fails? Yes, we could wait until it’s back up, but imagine a setup where we have 10 pairs. Couldn’t one of them step in and lend a hand? And, in case of, mapper failing, how to do we tell the reducer that it doesn’t have to check for new checkpoints.</li></ul><h3>Stage 8: Heartbeats</h3><p>These might sound a pain to manage but it’s not that difficult actually: we need a way for workers to be aware of each others’ health. Most distributed systems use the concept of <strong>heartbeat</strong>s for that. It only assumes, that every once in a while each worker publicly declares “hey, I’m well and working”. If the signals stop, we know something is wrong.</p><p>We already have a place where all workers have access to — the DB. So let’s add a table heartbeats</p><pre>| group_id | worker_type |      heartbeat_ts     |<br>|----------|-------------|-----------------------|<br>|    0     |      M      | 2026-03-20 14:12:42.5 |<br>|    0     |      R      | 2026-03-20 14:12:42.9 |<br>|    1     |      M      | 2026-03-20 14:12:44.1 |<br>|    1     |      R      | 2026-03-20 14:12:44.8 |<br>|    2     |      M      | 2026-03-20 14:12:43.5 |<br>|    2     |      R      | 2026-03-20 14:12:43.6 |</pre><p>Every second or so, each worker will insert/update their ID and type ( M for Mapper and R for Reducer ).</p><p>This will be done through a <strong>subprocess</strong>. It’s important to implement it in a way that if the subprocess is dead (we aren’t producing heartbeats), the main process should also exit. Otherwise we’ll end up with a ghost worker which appears dead but it’s not.</p><p>I won’t include heartbeat production in the example code because it’s fairly boilerplate and the snippets are growing bigger on every turn. You can ask AI to generate the function for you.</p><p>Let’s solve the <strong>dangling reducer</strong> problem first. The solution is the following: if we know that there’s been a <strong>long time</strong> (not just a simple restart) since the mapper hasn’t produced a heartbeat, it’s useless to wait till the current checkpoint expires or wait for new checkpoints, it should process whatever is left and simply shut down (to free up resources for something else). After the maintenance team solves the issue with the <strong>mapper</strong>, it can also restart the <strong>reducer</strong>.</p><pre># mapper.py<br>...<br>start_heartbeat_subprocess(GROUP_ID, &#39;M&#39;)<br><br>for guest in reception:<br>   ...</pre><pre># reducer.py<br>...<br>WORKER_TIMEOUT_INTERVAL = 15<br>...<br>start_heartbeat_subprocess(GROUP_ID, &#39;R&#39;)<br>...<br>while True:<br>    # check if &quot;my&quot; mapper is alive<br>    is_my_mapper_alive = db.get_heartbeat_time(GROUP_ID, &#39;M&#39;) &gt; \<br>      datetime.now() - timedelta(minute=WORKER_TIMEOUT_INTERVAL)<br><br>    # check for expired checkpoints<br>    expired_checkpoints: list[Checkpoint] = \<br>      # if &quot;my&quot; mapper is dead, all our checkpoints<br>      #   are also expired, no need to exclude the<br>      #   most recent checkpoint, it is not &quot;active&quot; in any way<br>      db.query_as_checkpoint(&quot;&quot;&quot;<br>         SELECT * FROM checkpoints <br>         WHERE group_id = %<br>         ORDER BY start_date<br>         OFFSET %&quot;&quot;&quot;<br>        , GROUP_ID, 1 if is_my_maper_alive else 0)<br><br>    # accommodate expired checkpoint(s) into room (parquet)<br>    for ...<br><br>    # if &quot;my&quot; mapper is dead, I&#39;ll just <br>    #   remove my own heartbeat row and shut down<br>    if not(is_my_mapper_alive):<br>        db.execute_query(<br>          &quot;DELETE FROM heartbeat WHERE worker_type = &#39;R&#39; and group_id = %&quot;,<br>          GROUP_ID<br>        )<br>        # ↑ let&#39;s call this statement `db.remove_heartbeat`<br>        break</pre><p>The query to get expired checkpoints grew a bit long but it’s a small price to pay for such an significant change.</p><h3>Stage 9: Complete load balancing</h3><p>The only thing left to call our system fully load balanced, is to ensure, that if there is at least 1 worker available to perform a particular workload, it should at least try, instead of waiting for the responsible parties, to come online.</p><p>Say we have 10 pair mapper-reducer setup. One reducer goes offline (for whatever reason). The assumption is that since there’re still 9 active and healthy reducers in the system, one of them can take over their checkpoint. But which one of them? We <em>could</em> dedicate a special Reducer to be a “backup”, but what if 7 out of 10 reducers fail ? Does the backup now do the work of 7 failed reducers, while the 3 healthy ones just pretend nothing is happening?</p><p>Wouldn’t it be better if the work of 7 failed reducers falls (approximately) evenly on the 3 healthy ones? This way we won’t have to keep a “backup” reducer and the chances for one machine failing because of too much work is lower. We’ll use the <strong>round robin</strong> approach to make that happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*7V3jenBkgrJjctwRfgeCRA.png" /><figcaption>Round robin failover</figcaption></figure><p>In the diagram you can see how it works: if <strong>Reducer 3</strong> is down (for a long time), <strong>Reducer 2</strong> will take care of the checkpoints generated (or left) by <strong>Mapper 3</strong>. If both <strong>Reducers 6 and 7 </strong>are down, <strong>Reducer</strong> 5 will carry the load of those 2. And if <strong>Reducer 0</strong> dies, <strong>Reducer 9 </strong>comes to help. So everything locks in a circle and in case of any failure, until there’s at least 1 healthy worker, we’ll get some work done. On the other hand, a failure (or two) of 2 random workers will most likely be split across 2 different healthy workers, which is a much better outcome.</p><p>To implement this in the code, we first have to introduce a concept of <strong>takeover</strong>. In theory it happens when Reducer X decides it needs to take the responsibility for checkpoints of Reducer X+1/X+2/X+3… (assumption being the latter is/are not responding, or better put, <strong>not sending heartbeats</strong>). In practice it just means updating the checkpoints table and setting the group_id=my_group_id WHERE group_id=failed_worker_group_id . The entire change would be adding a function call right after while True in reducer.py .</p><p>But there is a small caveat:</p><ul><li>If the failed reducer’s mapper is <strong>alive</strong>, that means that we should leave 1 checkpoint unchanged, as it’s being written into right now. Whenever it expires naturally, we’ll take over and process it normally.</li><li>If the failed reducer’s mapper is <strong>failed</strong>, we can safely reassign all checkpoints to ourselves.</li></ul><p>To be extra safe, when reassigning checkpoints, we’ll move their start_date to one year to the past to be 900% sure that they’ll not get mixed up with originally “my” active checkpoint</p><pre>def get_reducers_round_robin(group_id):<br>    # list all reducers in roud-robin manner.<br>    # for example, reducer 4 will get the IDs in following order:<br>    #   5-6-7-8-9-0-1-2-3 <br>    return db.execute(&quot;&quot;&quot;<br>        WITH all_with_status AS (<br>            SELECT<br>                group_id,<br>                CASE WHEN <br>                  heatbeat_ts &lt; DATE_SUB(MINUTE, %, CURRENT_TIMESTAMP())<br>                THEN &#39;failed&#39; ELSE &#39;alive&#39; END AS status<br>            FROM heartbeat<br>            WHERE type = &#39;R&#39;<br>        )<br>        SELECT *<br>        FROM all_with status<br>        WHERE group_id &gt; %<br>        ORDER BY group_id<br><br>        UNION ALL<br> <br>        SELECT *<br>        FROM all_with status<br>        WHERE group_id &lt; %<br>        ORDER BY group_id<br>    &quot;&quot;&quot;, WORKER_TIMEOUT_INTERVAL, group_id, group_id)<br><br><br>def scan_for_failed_reducers():<br>    all_reducers_with_status = get_reducers_round_robin(GROUP_ID)<br>    <br>    # iterate over the list, stop when next alive<br>    #   worker is encountered. <br>    failed_reducer_ids = []<br>    for itm in all_reducers_with_status:<br>       if itm.status == &#39;alive&#39;:<br>          break<br>       failed_reducer_ids.append(itm.group_id)<br><br>    # reassign all/expired checkpoints of failed<br>    #   workers to self, depending on if the mapper is alive<br>    for fr in failed_reducer_ids:<br>       <br>       reassign_all = db.get_heartbeat_time(fr, &#39;M&#39;) &lt; \<br>          datetime.now() - timedelta(minute=WORKER_TIMEOUT_INTERVAL)<br>       <br>       reassign_checkpoints_for_group(<br>          fr, GROUP_ID, reassign_all=reassign_all)<br>       <br>       # if both mapper and reducer are dead, <br>       #   we should treat them as if they never existed<br>       if reassign_all:<br>          db.remove_heartbeat(fr, &#39;M&#39;)<br>          db.remove_heartbeat(fr, &#39;R&#39;)<br><br><br>def reassign_checkpoints_for_group(<br>   from_group_id:int,<br>   to_group_id:int,<br>   reassign_all=False<br>):<br>  db.execute(<br>    &quot;&quot;&quot;UPDATE checkpoints <br>       SET group_id = %, start_date = DATE_SUB(YEAR, 1, start_date)<br>       WHERE checkpoint_id IN (<br>          SELECT checkpoint_id<br>          FROM checkpoints<br>          WHERE group_id = %<br>          ORDER BY checkpoint_id<br>          OFFSET %<br>       )&quot;&quot;&quot;<br>    , to_group_id, from_group_id, 1 if reassign_all else 0<br>  )</pre><p>Now if we call scan_for_failed_reducers right after while True: in reducer.py , every once in a while we’ll check if there are failed reducers, reassign their unfinished business to ourselves and treat those as if they were our checkpoints in the first place.</p><h3>Summary</h3><p>In about a hundred line of python code, we’ve created data streaming application which is</p><ul><li>Performant</li><li>Scalable</li><li>Durable</li><li>Highly available</li><li>Idempotent</li><li>No single point of failure</li><li>Does not rely on a “master” node, zookeeper or anything else, therefore easy to setup and deploy</li><li>Does not require active maintenance</li></ul><p>The <strong>mapper</strong> can be programmed to also perform non-blocking tasks like basic filtering, schema validation, basic cleaning, maybe run the data through an LLM or whatnot. The <strong>reducer</strong> can be asked to pre-aggregate or enrich data with minimal changes.</p><p>What it does not support (at least now) without major changes:</p><ul><li>Complex streaming pipelines with multiple stages of map-reduce, joins etc. We, of course, can hook in multiple mappers and reducers (with light code changes), but it will first of all lack the optimizer that makes sure data gets <em>shuffled </em>only when it’s absolutely necessary. And it will never use in-memory processing (because it was designed not to do that)</li><li>Hopping windows or session windows (read more <a href="https://docs.cloud.google.com/dataflow/docs/concepts/streaming-pipelines">here</a>)</li><li>Flexibility in reusing. See, it’s not written in declarative language but imperative. To perform a different workflow, either most of the code needs to be copied or it has to be re-written into declarative paradigm to accept functions (like Apache Beam accepts ParDo or DoFn )</li><li>In contrast to Apache Beam running on Google DataFlow, no <em>autoscaling</em> will be available</li></ul><p>Did we re-invent Hadoop Map-Reduce? Yes we did. Is it better-suited for simple streaming workflows? Unless you prove me wrong, it is.</p><p>But most importantly, we went deep into system design, explored potential problems around race conditions, load balancing, consistency, availability, single points of failure. And that was my goal.</p><h3>Bonus Stage: Dynamic worker scaling</h3><p>But what if we want more mappers than reducers? After all, mappers are doing more work than reducers (I checked, they do).</p><p>For that we need to add… (almost) nothing. It’s just a matter of setup: Imagine if we mess with the deployment a bit and start <strong>6 mappers</strong> under IDs 0–1–2–3–4–5 and <strong>3 reducers</strong> under IDs of 0–2–4.</p><ul><li>Mappers don’t care if their reducer is alive so all 6 will work normally</li><li><strong>Reducer 0</strong> will think that<strong> Reducer 1 </strong>is not absent but failed <em>(yes, I know their heartbeat row is missing but that’s solvable by small passing another env variable to the workers and modifying the SQL of </em>get_reducers_round_robin <em>)</em></li><li>But <strong>Mapper 1</strong> is alive</li><li>So whenever a checkpoint of <strong>Mapper 1</strong> naturally expires, <strong>Reducer 0</strong> will take over that checkpoint</li><li>And process it as if it were its own</li><li>Same with <strong>Reducer 2</strong> and <strong>Reducer 4</strong></li></ul><p>So or system half-supports a dynamic number of reducers (kind of) out of the box. Why half — it’s because we can’t have less Mappers than Reducers, since if a Reducer doesn’t find its “soulmate’s” heartbeat, it shuts itself down (tragic, I know).</p><h3>Bonus Stage: Schema Management</h3><p>In the code, we’ve been always infering the Parquet schema from the pandas DataFrame. And the DataFrame is <strong>assuming </strong>the schema from the collection of Dicts that the intermediate file is. That is okay but not good. Imagine if 99.9% events have NULL value for key X. What will pandas assume the type of the column is? Probably string . But it might be anything.</p><p>In my case, I did have the schemas specifically defined in yaml file. So the first step is to convert the data structure defined in it into a pyarrow.Schema . That is simple enough, nothing an AI can’t write for you.</p><p>But schemas change, don’t they? Therefore I couldn’t just have a static yaml attached to a container and forget about it. It had to be updated whenever there is an update to the original yaml, which was kept in <strong>git</strong>. Therefore, the process looked as follows:</p><ul><li>On startup, the reducer <strong>pulls</strong> the yamls from the git repo</li><li>Parses the yaml into a pyarrow.Schema</li><li>Uses that schema for all Dataframe-to-Parquet conversions.</li><li>Whenever the yaml is updated, the <strong>CI/CD</strong> pipeline configured in git, will issue a <strong>restart</strong> command to all Reducers (though Kubernetes).</li><li>On next startup, the reducers will use the latest configuration.</li></ul><p>Now our parquets are always structured the way we expect them to, without schema conflicts etc.</p><h3>Why I started the project?</h3><p>We had a very old version of Apache Beam running on Flink runner, hooked into Kubernetes. The thing was eating up 200GB of RAM and 120 CPU cores even though an entire day worth of data was only 1TB. That wasn’t okay. People, who built that, were no longer with the company and there was nobody who had the skills and knowledge to update it to the new version or even properly take ownership of it (in terms of maintenance).</p><p>As the owner of company’s data infrastructure, I decided to act. My first attempt was to go into the code and see if I can set up a local env, test it on newer version, see maybe if I’m lucky and it would run. Not just run, but also hopefully consume less resources. Unfortunately it was all written in Java and I couldn’t understand any of it. It was the pre-AI era, so I was completely on my own, so I abandoned that approach quickly.</p><p>Good thing was I knew what it did exactly. Maybe I could re-write it from scratch in Python. Apache Beam has improved greatly over years, especially in terms of Python support. Later I could deploy it to Google DataFlow and forget Flink, and not bother the DevOps team with getting access to Kubernetes. Regrettably, there I failed too.</p><p>Not counting the issues I had with setting it up locally, there was another blocker. See, I was using <strong>hive partitioning</strong> to separate the parquets by event_type — a piece of data that was in the events’ json. So I needed the events to be grouped by event_type and each written into separate directory as parquet. This would result in enormous benefits in processing time (and cost) for some of our ETL pipelines if the engine (be it BigQuery, DataProc or whatever) would only deal with small parts of the data, filtering on event_type .</p><p><em>And by the way, this was the reason I had to acknowledge receiving the message from Kafka on the Mapper side, not on the Reducer side, because the events weren’t ordered (why would they be), neither the topic was partitioned on </em><em>event_type (it would make a terrible, terrible partition key due to massive imbalance) so I couldn&#39;t re-process a specific </em><em>event_type if I failed to write it into destination. Even if I could, why would I need to if I have the file in the local filesystem?</em></p><p>On the other hand, the default parquet <em>sink</em> didn’t support that. I spent about 2 weeks on trying to modify it or write my own parquet sink and failed. Skill issue? Probably. But if your system is designed and documented in a way that writing a custom one from scratch is faster/easier, then you’re doing something wrong, eh?</p><p>I looked into other options like:</p><ul><li>Apache Flink — same issues as in Apache Beam</li><li>Apache Storm — very limited Python support</li><li>Apache (Py)Spark in streaming mode — comes with too much stuff to maintain (zookeeper, yarn, hadoop). Can be deployed to Kubernetes, but is rather a workaround.</li><li>Google DataFlow had a <strong>template </strong>for “PubSub to Bigquery”. Template meant one-click setup of a pipeline without needing to code anything, only configure. But.<br>First of all, I neither had PubSub (I had Kafka) nor I wanted to store that data in BigQuery. The reason for the latter is that BigQuery doesn’t support more than 1 partition key (hence the preference of storing raw Parquet) so I’d have to export as partitioned parquet from BigQuery periodically into GCS which is not only additional setup process, but also expensive (I’m already paying for PubSub completely unnecessarily). <br>But this was the worst case scenario plan.</li><li>Google DataFlow had a template for “PubSub to GCS” but it didn’t perform any partitioning out of the box.</li><li>Proprietary software — too expensive</li></ul><p>Then I thought to myself: I’m not looking for anything fancy. Just read some damn data and write some damn data in a specific directory structure. I bet I can pull this off on my own. And I did. I built this thing in 2–3 weeks, ran stress tests for a week and off it went to production, deployed to Kubernetes, now using 3 pairs workers with 2gb RAM and 2 CPU mappers + 8gb RAM and 2 CPU reducers, totaling to 30GB of RAM instead of 200GB, that’s x5 decrease in resource usage. If I did that now, I’d have Nvidia engineers knocking at my door.</p><p>And 3 pairs weren’t even needed — when I tested it locally, 1 pair was able to process the entire flow of data. The downside was that an hour worth of outage would take 3 hours of catching up, so a weekend of downed system would take a week to recover. So it was decided that 3 is adequate.</p><p>Do I blame Apache Beam for being inefficient, eating up resources unnecessarily? Just a bit. I’m mostly unhappy about the documentation being incomplete and vague.</p><h4>Why it doesn’t matter anymore</h4><p>Simple… Google DataFlow now has a template for “Kafka to Iceberg”. And it is a simple setup, no coding involved. I know, I said setting up Iceberg is a bit of additional work, but if one-click template was available, I’d accept setting up Iceberg catalog as a very reasonable investment, which would take me days at most in contrast to weeks of setting up a streaming pipeline in Beam.</p><p>Not to mention even all the optimizations and additional features that come with Iceberg, which, yes, I said I didn’t need by then, but having the option is always nice.</p><p>So compared to previous templates, now there’s no need to re-route events from Kafka to PubSub, no need to post-process data in Bigquery, it’s all there, just type in the 30 or so parameters and hit “Run”.</p><h3>Final thoughts</h3><p>If you made it here, I’d like to thank you for your time. I know it was a long article, but I hope it was worth reading and you now know more about distributed system design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8a0ced47a3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Անհաջողության բանաձևը․ ինչու դու նպատակիդ չես հասնի։]]></title>
            <link>https://medium.com/@arikshtein2/%D5%A1%D5%B6%D5%B0%D5%A1%D5%BB%D5%B8%D5%B2%D5%B8%D6%82%D5%A9%D5%B5%D5%A1%D5%B6-%D5%A2%D5%A1%D5%B6%D5%A1%D5%B1%D6%87%D5%A8-%D5%AB%D5%B6%D5%B9%D5%B8%D6%82-%D5%A4%D5%B8%D6%82-%D5%B6%D5%BA%D5%A1%D5%BF%D5%A1%D5%AF%D5%AB%D5%A4-%D5%B9%D5%A5%D5%BD-%D5%B0%D5%A1%D5%BD%D5%B6%D5%AB-37d5596e7b41?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/37d5596e7b41</guid>
            <category><![CDATA[նպատակ]]></category>
            <category><![CDATA[prioritization]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Sun, 31 Jan 2021 16:58:38 GMT</pubDate>
            <atom:updated>2021-01-31T16:58:38.308Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U3-7P4jF7clVbs8HzI_-kQ.png" /></figure><p>Այսօր երկար փնտրել հարկավոր չի, որպեսզի գտնես ինչ որ վեբինար/սեմինար/մաստեր-կլասս/մոնոլոգ/թրենինգ/ելույթ կամ նման զռթիկ, որտեղ, որպես օրենք, արդեն հաջողակ ինչ մարդ շատ էներգետիկ ու ոգևորված դեմքով կասի “Դու կհասնես երազածիդ, եթե վերցնես ու անես ու վերցնել ու անելը ամենակարևորն ա, պետքա ձգտես, պետքա աշխատես, պետքա․․․ ձգտես․․․ վայ, ձգտելը ասեցի՞ արդեն, հա, շատ պտի ձգտես, ճիշտա։ Պետքա թղթի վրա գրես ու ամեն օր զարթնելուց հետո ու քնելուց առաջ նայես ու 3 անգամ ասես “ես կարող եմ” ․․․”։ <br>Էդ ամենը, իհարկե, լավ ա, բայց իրոնիկն էն ա, որ 70% դեպքերում էդ մարդը հաջողակ ա դարձել, որովհետև ինքը ծնվել ա հարուստ ընտանիքում, փոքրուց շփվել ա այլ միլյոնատերների հետ, ու որպես օրենք իրա առաջին միլյոնը աշխատել ա ինչ որ անհետաքրքիր բնագավառում (առևտուր, ծանր արդյունաբերություն․․․), որի մասին ինքը բացարձակապես երբեք չի երազել, այլ ընդամենը լավ հնարավորություն էր, օգտվել ա։</p><p>Տեխնիկապես էդ մարդը չի խափում, ինչ որ բանի հասնելու համար ձգտումն ու աշխատանքը էական կետեր են։ Այնքան էական, ինչքան ավտոմեքենայի համար շարժիչն ու ակերը։ Ու չնայած ավտոմեքենայի ամբողջ իմաստը նրանում ա որ շարժիչը ստիպում ա ակերը պտտվեն, միայն այդ երկուսի առկայությունը ընդհանրապես չի երաշխավորում որ “մեքենան” կշարժվի։</p><p>Ու էդպես շատ մարդկանց “հաջողության մեքենան” մենակ շարժիչից ու ակերից բաղկացած լինելով հարևանի զապի կողքը կանգնած մնում ա էնքաաան, մինչև ժանգոտում ա, էդ էլ ա անպիտան դառնում։ Տերն էլ ամեն օր տանից դուրս գալուց նայում ա վրան, ասումա “ախր թամ թազա մատոռ առա, բերիմ դրիմ վրեն, խի տեղից չի շարժվում”։ <br>Շատ պատճառ կա ինչի մարդ իրա նպատակին չի հասնում, ու դրանց քանակը էնքան ա, ինչքան պակասող դետալ կա մեր նկրագրված “մեքենայում”։ Ես կփորձեմ ներկայացնել նրանք, որոնք իմ անձնական դիտարկմամբ ամենահաճախն են հանդիպում։</p><h4>Ցանկությունը նպատակ չվեչածելը</h4><p><em>Հիմա ակնհայտ բան եմ ասելու, հեսա կասեմ ինչի։</em></p><p>Ցանկացած ծրագիր իրականացնելուց առաջ անցնում ենք 3 փուլով․</p><ul><li>Մտահաղացում — երբ մտքովդ մի կամ մի քանի անգամ անցավ</li><li>Ցանկություն — երբ ծրագիրը ժամանակ առ ժամանակ քո տեսադաշտում ա, ինչ որ քայլեր են ձեռնարկվում դրա համար</li><li>Նպատակ —երբ ծրագիրը ՄԻՇՏ քո տեսադաշտում ա, բոլոր հնարավոր քայլերը ձեռնարկվում են դրա համար</li></ul><p>Բերեմ կոպիտ օրինակ․</p><ul><li>“Դզեց, Լամբորջինի, կարելի ա սրանից քշել” — մտահաղացում</li><li>“Փող հավքեմ, Լամբորջինի առնեմ, քշեմ” — ցանկություն</li><li>“Մյուս աշխատավարձից սկսած, 100$ ամեն ամիս դնելու եմ կողք, որ Լամբորջինի առնեմ, քշեմ” — նպատակ</li></ul><p>Ծիագրիը իրականություն դարձնելու համար պետքա պարտադիր 3 փուլերով էլ անցնի, “ցանկություն”ը չի դառնում իրականություն, “մտահաղացում”ը չի դառնում “նպատակ”։ Բայց շատ հաճախ էս մետամորֆոզը հակառակ ուղղությամբ էլ ա գնում։ Ավելի հաճախ՝ “նպատակ”ից “ցանկություն”։ Դա տեղի ա ունենում, երբ ծրագիրը դադարում ա միշտ լինել քո տեսադաշտում ու ոչ բոլոր հնարավոր քայլերն են ձեռնարկվում դրա համար։ Ամենատիպային օրինակը մարզասրահ գնալ-թարգելն ա։ Երբ առաջի մի քանի շաբաթը <strong>նպատակ</strong>ադրված “չոտկի” գնում ես պարապելու, հետո մի-երկու ամսից ասում ես “հա, լավ, դե էսօր հավես չկա, մյուսին գնամ”։ Մի 2 շաբաթից մի անգամ էլ։ Հետո սկսում ես “վատ զգալ”, հետո գործեր են հայտնվում ու տենց “մարմինս կոպել”ու ծրագիրը “նպատակ”ից դառնում ա ցանկություն, վերջում էլ “հեսա գործերս դզվի, մարզասրահի մի տարվա աբոնեմենտ առնեմ, էլի գնամ” — մտահաղացում։</p><p>Հիմա, էս լրիվ ինչի էի ասում․ մարդիկ հաճախ ինչ-որ բան են ծրագրում ու մտածում են, որ նպատակ են դրել, բայց իրականում ընդամենը ցանկություն ունեն։ Էն մարդը ով 100$ ամեն աշխատավարձից կողք ա դնում որ Լամբորջինի առնի, բայց օրը մեջ 200դրամ տալիս ա, սնիկերս ա ուտում, ինքը դեռ “նպատակ” փուլում չի, որովհետև հակառակ դեպքում ինքը էդ սնիկերսը կուտեր ամիսը 2 անգամ, բայց 100$ի փոխարեն 105$ կդներ։ Համ էլ էդքան սնիկերս ուտող մարդը Լամբորջինիի մեջ դժվար տեղավորվի։ Մարդ, ով ուզում ա սահուն անգլերեն խոսել սովորի, A1-ի գիտի, բայց հեռախոսի լեզուն դեռ ռուսերեն ա, ինքը “նպատակ” փուլում չի։ Այսինքն չի ուղղվում <strong>բոլոր </strong>հնարավոր միջոցները այլ միայն ինչ որ մաս, որ համարում ենք “բավարար”։ Է “բավարար” ջանքերով “բավարար” արդյունք էլ կստանաս։ Լամբորջինիի տեղը Ford Focus, “սահուն” անգլերենն էլ “I am agree” մակարդակի վրա։ Բավարար ա, էլի։</p><p>Էս պարագայում ամենամեծ թշնամին դասընթացներն են։ Որովհետև դասընթացը իրականում քեզ տալիս ա ինչ-որ “մինիմում” (օրինակ շաբաթական 3 անգամ 1 ժամ + տնայիններ) ու դու դադարում ես ձգտել ավելին։ Խմբի 99%ը կյանքում ծրագրից դուրս մի փոքր իսկ բան չեն արել։ Որ դասընթացավարն էլ լրացուցիչ նյութ ա տալիս, մասնակիցների ռեակցիան “հա դե, մի օր կնայեմ, հիմա վախտը չի” ա միշտ։ Օդից չեմ խոսում, ինքս դասավանդել եմ բազմակի անգամ։ Էս ինձ հիշեցնում ա իմ ուսանողական օրերը, երբ դասախոսը ասում էր, որ ինչ որ թեմա քննությանը չի լինելու, նույն վայրկյանին էդ թեման մեր տարածքա-ժամանակային կոնտինումը լքում էր։ Ու, փաստացի, քո կամքի ուժը մնացել ա 18 տարեկան ուսանողի մակարդակի վրա, “եթե լրացուցիչ ա, պետք չի”։ Ու սա կասի մարդ, ով էդ “լրացուցիչ”ի համար վճարել ա։ Բայց փողերի թեման հետո։</p><p>Բնականաբար սա չի նշանակում որ պտի հաց չուտես, սաղ աշխատավարձդ դնես Լամբորջինիի բյուջեի մեջ, կամ որ եթե որոշել ես Լամբորջինի առնես, ծովափնյա վիլլայի մասին մտածելն անիմաստ ա։ Չէ, կարող ես մի քանի նպատակ ունենալ, մեկը մյուսից ավել կամ պակաս կարևոր, ու ռեսուրսներն էլ պետքա օգտագործվեն խելամիտ։ Լիովին, բայց խելամիտ։</p><p>Մարդ կա, կասի “դե մոտիվացիայի խնդիր ա”, մյուսը կասի “պրիորիտետի հարց ա”, բայց օրվա վերջում քնելուց առաջ դու օրդ ամփոփում ես, քեզ հարցնում ես “էսօր ի՞նչ արեցի իմ նպատակին հասնելու համար։ Ոչի՞նչ։ Լավ, վաղը 2 անգամ շատ կանեմ։”, մոռանալով որ երեկ էլ էիր նույնը ասել։ <br>Հեսա մեկը կասի “բայց չէ, ես լիքը բան եմ արել․․․ բանը․․․ էսօր լուսամուտը դրիիիմ, էդ դնելու պահին վերևից գյաջ մաջ էր թափվե պադագոննիգին, էդի սիրուն հավքիիիմ, մաքրիիմ, լվացիիմ, պլպլցրիմ ու պատուհանը փակիմ։ Հմի նայում ես վաաաախ։”։ Ու կնստի էլի “սիրելի մորքուր” երգելուն։ Ու էս անգամ “տոշնի ասող” Հայկո չկա։ Դու պիտի լինես ինքդ քո Հայկոն, բայց, ցավոք, դու մենակ Մկո ես :)</p><p>Դու նպատակիդ չես հասնի։</p><h4>Նույնիսկ տարրական ինքնազարգացման ունակ չես, ուր մնաց մեծ նպատակներ</h4><p>Մի հատ հիշի ինչ փոքր բան ես վերջին տարում արել՝ կյանքդ մի քիչ բարելավելու ուղղությամբ։</p><p>Շաքարավազի օգտագործումը պակասեցրու, ատամներդ 3 րոպե լվացրու, մեջքդ ուղիղ նստի (ասեցի, նոր արեցիր, դա հաշիվ չի), կարգավորված քնիր, 7ից հետո ուտելը դադարեցրու, երեկոյան հեռախոսի ու համակարգչի լույսը իջեցրու, շոկոլադը փոխարինի մրգերով, երեկոյան քնելուց առաջ դուրս արի 10 րոպե քայլի կամ գոնե սենյակդ օդափոխիր, կինոն ու սերիալները մասամբ փոխարինի գրքերով, աչքերդ ժամը մեկ 30 վայրկյանով կտրիր էկրանից, զարթնելուց հետո մի բաժակ ջուր խմիր, օրվա անելիքներդ գրի առ, որ հասցնես․․․</p><p>Էս ցուցակը կարելի ա հոդվածի երկարությամբ շարունակել։ Դու, անշուշտ, էս կետերի առնվազն կեսի մասին լսել էիր, որ դրանք կարևոր են, ու ոնց էլ չլինի, մեկընդմեջ մտքովդ անցել ա, որ “պետքա սկսել անել”, բայց գրեթե միշտ թքած ես ունեցել։</p><p>Հիմա ինքդ քեզ հարցրու․ մարդ, ով 4 վայրկյան ժամանակ չունի մի բաժակ ավել ջուր խմելու սեփական առողջության համար, կարո՞ղ է օրական 2 ժամ հատկացնել, ինչ որ մեծ նպատակ իրականացնել։</p><p>ՈՒ ես մտադրաբար չնշեցի էնպիսի բաներ, որոնք իրոք ժամանակատար են, օրինակ․ համով պատրաստել սովորիր, ամիսը մեկ անգամ գնա թատրոն, առավոտները զարթնի, վազի, մեդիտացիա արա, որովհետև սկի նրանք չես անում, ուր մնաց էսպիսի բարդ ու ժամանակատար բաներ անես։</p><p>Լավ, էդ սաղ հեչ։ Ի՞նչ հոբբի ունես։ Պատասխանելուց առաջ հիշի, հոբբին ենթադրում ա որոշակի ներգրավվածություն նշված առարկայի մեջ, այսինքն չես կարա համակարգչիդ էկրանին Մոնա Լիզային դնես ու պնդես, որ քո հոբին այսուհետ Ռենեսանսի դարաշրջանի նկարներն են։</p><p>Հեսա կասես “կինո”։ Եթե քո հոբբին կինոն ա, ասա ինձ Ուոլտ Դիզնեյ ստուդիայի նկարած որևէ <strong>կինո</strong> (մուլտ չէ, կինո)։ Չգիտես, չէ՞։ Այո, քեզ համար դժվար ա հավատալ, բայց Դիզնեյ ստուդիան Միկի Մաուսի ու արքայադուստրների մասին մուլտերից բացի <a href="https://en.wikipedia.org/wiki/Lists_of_Walt_Disney_Studios_films">մի ֆուռ կինո ու մուլտֆիլմ</a> ունի նկարած, որոնցից շատերը դու նայել ես ու շատ ես սիրում։ Այսինքն իրականում քո հոբբին բազկաթոռին նստած հեռուստացույց նայելն ա, ոչ թե կինոն։</p><p>Հեսա կասես “երաժշտություն”։ Բայց եթե դու Тимоти-ի ստեղծագործությունները երբևե համարել ես “երաժշտություն” ուրեմն քո հոբբին ոչ թե դա ա, այլ “ցկցկալ”ն ա։ Երկրորդ շանս․ Բախի ստեղծագործության անուն ասա։ Էդ էլ չգիտես։ Beatles խմբի 3 ստեղծագործություն ասա։ Let it be, Imagine… դե՞․․․ դե՞․․․։ Լավ, ժամանակակից․ էն երգը, որ ասումա “dance for me, dance for me, dance for me, oooo o”, լսե՞լ ես, չէ՞։ Բա էդ երգի անունն ի՞նչա։ Էդ էլ չգիտես։</p><p>Աղջիկները կասեն “makeup”ն ա, բայց եթե դու չգիտես Գոհար Ավետիսյանը ով ա, քո հոբբին “makeup”ը չի, այլ դեմքիդ պուդրա քսելն ա։ Լավ, ուրիշ մասնագիտացված Makeup Artistի անուն ասա, ո՞վ ա ըստ քեզ ամենահմուտը։</p><p>Տղաները կասեն “ֆուտբոլ”։ Եթե քո հոբբին ֆուտբոլը լիներ, դու կհիշեիր նախանցած տարի որ Մյունխենը չեմպիոնների լիգան որ հաղթեց, ում դեմ էր խաղում ու ինչ հաշվով հաղթեց։ Եթե չես հիշում, ուրեմն քո հոբբին իրականում գարեջուր խմելն ու հեռուստացույցի վրա գոռգռալն ա։</p><p>Դե որ տենց ա, իմ հոբբին էլ քնելն ա։ Ի՞նչ վատ հոբբի ա որ։ Որ ազատ ժամանակ ա լինում, պառկում քնում եմ։ Լիարժեք ներգրավվածություն:</p><p>Չէ, չես հասնի դու նպատակիդ։</p><h4>Սեփական ֆինանսներդ չես կարողանում կարգի բերել, ինչ մեծ նպատակների մասին կարող է խոսք գնալ</h4><p>Մի բժիշկ մի անգամ շատ խելոք բան ասաց․ ասաց “հիշի, 2 բան կա, որ գումարով չես առնի՝ ժամանակը ու առողջությունը”։ Հետո պարզվեց, որ ինքը ապօրինի օրգաններ էր վաճառում սև շուկայում, բայց էն մյուսը ճիշտ էր՝ ժամանակը փողից թանկ ա։ Հիմա ես ճիշտ եմ, չէ՞, մտածում, որ մարդ, ով իր ֆինանսներին անպատասխանատու ա վերաբերվում, իր ժամանակին է՛լ ավելի անպատասխանատու կվերաբերվի։</p><p>Փողը միշտ էլ դելիկատ թեմա ա, բայց բոլոր անհաջողակներին մի բան ա միավորում․ փող միշտ չկա։ Բայց մի րոպե։ Դու հաստատ 2 տարի առաջ ոնց էլ չլինի մի 10՛000 դրամ քիչ էիր աշխատում։ Էն ժամանակ չկար, հիմա էլ չկա՞։ Ոնց էլ չլինի մի 2 տարուց մի 10՛000 դրամ կողքից կավելանա։ Ու փող ոնց չկար, էդպես էլ էլի չի լինի, չէ՞։ Այսինքն, արի խոստովանենք, որ “փող չկա” իրավիճակը նրանից չի, որ քիչ ես վարձատրվում, ուրիշ տեղ ա պետք փնտրել։</p><p>Դե արի հասկանանք․ ինչքա՞ն բացարձակ (դրական մնացորդ+կանխիկ - վարկեր) գումար ունես։ Եթե դու 2 տարի կամ ավել անընդհատ և ստաբիլ եկամուտ ես ունեցել, ապա պիտի առնվազն մեկ ամբողջ աշխատավարձ խնայած գումար ունենայիր “սև օրվա” համար։ Գիտեմ, որ այդքան չունես, հիմա արի հասկանանք ինչի։</p><p>Երբևէ վարկ վերցրե՞լ ես մի բանի համար ինչը հենց էդ պահին բացարձակ անհրաժեշտություն չէր։ Օրինակ հեռախոս կամ համակարգիչ (երբ հները դեռ օգտագործման պիտանի էին), ճանապարհորդություն, նոր տարվա սեղան։ Եթե այո, ուրեմն դու մտնում ես “ֆինանսապես անողնաշարների” դասի մեջ։ Ինչի՞։ Դե որովհետև չկարողացար սպասել մինչև գումար խնայես ու վճարես ապրանքի/ծառայության իրական գինը, այլ նախընտրեցիր +24,4% նվիրել բանկին։ Հիմա ով ասի “հա բայց փող պտի ըլնի, որ խնայեմ”, ես հարց ունեմ․ մինչև վարկ վերցնելը 10՛000 դրամ չկար, բայց վարկը վերցրեցիր, ԴԱՀԿի վախի տակ 10՛000 դրամ կախարդական կերպով հայտնվե՞ց։</p><p>Լավ, ուրիշ հարց տամ․ տեղյա՞կ ես, ինչքա՞ն ես վերջին 3 ամսում ծախսել սնունդի ու տնտեսական ապրանքների (բացարձակ անհրաժեշտություն), շորերի ու տրանսպորտի (անհրաժեշտություն), ժամանցի ու նվերների վրա։ Չգիտես, չէ՞։ Այսինքն դու չես էլ փորձել իրավիճակի մասին տեղեկանալ, որ տեսնել փոխելու հնարավորություն կա՞ թե դու գնում ես դեպի սնանկություն։ Բայց մի կոնտինգենտ կա, որ իրա կոնկրետ 2 տեսակի ծախս ամսեամիս հիշողության մեջ իդեալական պահում ա․ վարորդները՝ բենզինի ու վճարված տուգանքների չափերը։ Քնից հանես, հարցնես “2018 թվականի հունիսին բենզինի վրա ինչքա՞ն ես ծախսել” ինքը քեզ ոչ միայն թիվը կասի, այլև որտեղ ա լցրել ու մյուս բենզալցակայաններում էդ պահին գինը ինչքան էր։ Ես նույնիսկ ներկա եմ եղել խոսակցության, որը “փող չկա” թեմայից անցել ա “անցած ամիս 80՛000ի խախտում եմ արել”ի։</p><p>Արի ինձ հետ համաձայնվի, որ դու նպատակիդ չես հասնի։</p><p>Ինչպես ցանկացած հաջողության բանաձև, իմ անհաջողության բանաձևն էլ չի երաշխավորում, որ եթե դու 3ն էլ ունես, կամ առնվազն մեկն ունես, ուրեմն վերջ, անիմաստ ա։ Չէ, գործոնները շատ ավելի շատ են, ես ընդամենը թվարկեցի նրանք, որոնք մաքսիմալ քեզանից են կախված ու չափից շատ տարածված են։</p><p>Դե հիմա գնա ու ապացուցիր, որ ես սխալ եմ :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37d5596e7b41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PyShinyan։ Ն․ Փաշինյանի ֆեյսբուքը թվերով — Մաս 1]]></title>
            <link>https://medium.com/@arikshtein2/pyshinyan-%D5%B6-%D6%83%D5%A1%D5%B7%D5%AB%D5%B6%D5%B5%D5%A1%D5%B6%D5%AB-%D6%86%D5%A5%D5%B5%D5%BD%D5%A2%D5%B8%D6%82%D6%84%D5%A8-%D5%A9%D5%BE%D5%A5%D6%80%D5%B8%D5%BE-%D5%B4%D5%A1%D5%BD-1-1e2faa09d56a?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e2faa09d56a</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 09:45:15 GMT</pubDate>
            <atom:updated>2020-04-14T09:45:15.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>PyShinyan։ Ն․ Փաշինյանի ֆեյսբուքը թվերով — Մաս 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*9szPd-ChHml1ANtMZjAn7A.png" /></figure><h3>Disclaimer</h3><p>Սույն գրառումը հանդիսանում է <a href="https://public.tableau.com/profile/arakel#!/vizhome/PyShinyan/sheet0_1">հետևյալ հաշվետվության</a> մանրամասն վերլուծություն և նպատակ ունի խորացված կարգով ուսումնասիրել տվյալներում առկա օրինաչափությունները և ներկայացնել հիպոթեզներ։</p><blockquote>Սույնով արգելում եմ BlogNews.am կայքին, նրա աշխատակիցներին և առնչվող անձանց որևէ կերպ օգտագործել տվյալ գրառումը վերոնշյալ կայքում կամ առնչվող այլ ռեսուրսներում։</blockquote><p>Ինչպես և հաշվետվությունը, գրառումը չի հետապնդում որևէ քաղաքական ենթատեքստ և ստեղծված է զուտ տվյալների վերլուծման նպատակով։ Ներկայացված տվյալները կարող են լինել ոչ լիարժեք / մասնակիորեն կամ լիովին սխալ, այնպես որ հեղինակը պատասխանատվություն չի կրում օգտատիրոջ կողմից կատարված հետևությունների կամ գնահատականների համար։</p><blockquote>Վիճակագրության կանոն #3. Correlation is not causation</blockquote><p><em>Տվյալները քերել (scrape — անգլ․ քերել) եմ </em><strong><em>Py</em></strong><em>thon ծրագրավորման լեզվով, այսպիսով </em><strong><em>Py</em></strong><em>Shinyan:</em></p><p>Այս պրոեկտի համար տվյալները սկսել էի հավաքել դեռ 2019ի սկզբին, ինչը շարունակում եմ մինչև հիմա, բայց վերջին իրադարձությունները համարում եմ լավ առիթ արդեն որոշ արդյունքներ հրապարակելու համար։ Գիտեմ որ ավելի հետաքրքիր կլիներ տեսնել ընթացիկ տարվա իրավիճակը բայց այնտեղ տվյալները այդքան էլ շատ չէին, ինչի համար հաշվետվությունը սահմանափակված է միայն ամբողջ 2019 թվականի համար։</p><p>Եկեք սկսենք առաջին էջի առաջին գրաֆիկից․</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*doaor8LJ279OvZ9PWg0Ocw.png" /><figcaption>Գրառումների քանակն ըստ ամիսների</figcaption></figure><p>“Nikol Pashinyan / Նիկոլ Փաշինյան” ֆեյսբուքյան էջում, ըստ իմ տվյալների, 2019 թվականին կատարվել է ընդհանուր 1093 գրառում։ Շատ հավանական է որ մի քանի գրառումներ դուրս են մնացել իմ տվյալներից Ֆեյսբուքի՝ գրառումները “խելոք” կերպով թաքցնելու / արտապատկերելու ալգորիթմի պատճառով, սակայն հիմք չկա ենթադրելու որ շեղումը կլինի էական։</p><p>Արդեն իսկ այստեղ տեսնում ենք Օգոստոսին, մոտ կրկնակի չափով գրառումների քանակի աճ։ Հետազոտությունը ցույց տվեց որ առանձնապես շատացել էին “Լայվ” տեսակի գրառումներն ու տեքստայինները։ Գրառումների քանակի աճը զուգորդվում է 2019 դեկտեմբերի 8ին կայանալիք ինքնակառավարման մարմինների ընտրություններին նախորդող քարոզարշավների կազմակերպման, երբ լայվերի միջոցով ակտիվորեն հրապարակվում էր քարոզարշավի ընթացքը, ելույթներն ու հանդիպումները։ Մյուս կողմից այդ տեսակ գրառումները մեծամասնություն չեն կազմել նշված ամիսներին սակայն չի բացառվում որ ակտիվության բարձրացումը պայմանավորված էր հաճախեցված կոմունիկացիայի օգնությամբ աուդիտորիա (և ընտրողներ) ներգրավելու նպատակով։ Դեկտեմբերին, ընտրություններից հետո, գրառումների քանակը էական պակասեց, սակայն հետագայում (նաև 2020 թվականին) մնաց ավելի բարձր մակարդակի վրա քան 2019 հունվար-հունիս ժամանակաշրջանում էր։</p><p>Տարվա կտրվածքով գրառումների 54.1% գրառումները կատարվել էին ոչ աշխատանքային ժամերին (“աշխատանքային” համարելով երկուշաբթիից ուրբաթ 9:00–18:00 ընկած ժամանակահատվածը) սակայն տարվա ընթացքում այս ցուցանիշը էական փոխվել է․</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*E_noqVms45iMHLi4zllSWA.png" /><figcaption>Ոչ աշխատանքային ժամերին կատարված գրառումների տոկոսը ըստ ամիսների (հասանելի չէ հաշվետվությունում)</figcaption></figure><p>Պրն․ Փաշինյանը տարվա սկզբին իր՝ հանրության հետ կապի պահպանման գործառույթները (ինչը ես իմ <strong>սուբյեկտիվ</strong> կարծիքով համարում եմ աշխատանք) հիմնականում կատարում էր ոչ աշխատանքային ժամերին, սակայն հետագայում ձգտեց ավելի օպտիմալ work-life բալանսի, մինչև հուլիս ամիս։ Օգոստոսին, ինչպես նշվեց, ակտիվության բարձրացմամբ պայմանավորված, զգալի քանակի գրառումներ սկսեցին կատարվել աշխատանքային ժամերից դուրս, իսկ դեկտեմբերին ցուցանիշը կրկին նվազեց մինչև 40%: Նշեմ, որ հաշվի առնված չեն տոները և պրն․ Փաշիյանի արձակուրդային ժամանակահատվածը, որոնք, փաստացի, ոչ աշխատանքային ժամեր էին։</p><p>Միջին օրական գրառումների գծով ասելիք չունեմ, բայց կհավելեմ որ մեկ օրում ամենաշատ գրառումները կատարվել են 2019–10–01ին ԵԱՏՄ խորհրդի նիստի անցկացման օրը, երբ էջի անունից հրապարակվեց 17 գրառում օրվա բոլոր մասերում, հիմնականում Լայվերի տեսքով։ Ամենաերկար ժամանակահատվածը, երբ էջը չի հրապարակել գրառումներ, եղել է 2019–07–25ից 2019–07–28ը ներառյալ, ինչը ընկնում է պրն․ Փաշինյանի արձակուրդային շրջանի մեջ։</p><p>Վերլուծության ընթացքում չհայտնաբերեցի որևէ օրինաչափություն կապված շաբաթվա օրերի հետ, և զերծ կմնամ փաստեր ներկայացնելուց քանի որ չեմ կարող տրամադրել պարզաբանում։ Ամեն դեպքում և ամիսների և գրառման տեսակների կտրվածքով, գրառումների բաշխումը ըստ շաբաթվա օրերի ունի տարբերվող տեսք և ուրախ կլինեմ լսել հիպոթեզներ, որոնք ինչ որ կերպ կբացատրեին այս կամ այն գործոնի կապը։</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*X1acQQhG8dvdGatQ7Ozdnw.png" /><figcaption>Տոկոսային գրառումները տարբեր ամիսներին՝ ըստ օրվա մասի։</figcaption></figure><p><em>“Օրվա մաս” դասակարգման մանրամասները հասանելի են հաշվետվության վերջին բաժնում։</em></p><p>Նախ կուզեմ Ձեր ուշադրությունը սևեռել ամենամուգ՝ Գիշեր օրվա մասին, երբ տեսնում ենք, թե ինչպես պրն․ Փաշինյանը աշխատում էր տարվա առաջին կեսում գրառումները ավելի ու ավելի կատարել օրվա լուսավոր ժամանակին ինչը աջակցում է աշխատանքային ժամերին գրառումներ կատարելու ձգտման հիպոթեզին։ Տարվա ընթացքում երկու փոքր պիկ են հանդիպում գիշերային ժամերին։ Առաջին պիկը դա սեպտեմբերին վարչապետի այցն է ԱՄՆ, երկրորդը՝ նոյեմբերին՝ Ֆրանսիա, երբ գրառումները իր տեսանկյունից կատարվել են օրվա ընթացքում, սակայն ժամային գոտիների տարբերության պատճառով ՀՀում գիշեր է եղել:</p><p>Ինձ համար անհայտ մնաց ինչի է երեկոյան գրառումների տոկոսը այդպես կտրուկ աճում հենց հուլիս ամսին մինչդեռ մյուս բոլոր ցուցանիշները այդպիսի կտրուկ փոփոխություն չեն ցույց տալիս, որ կբացատրեին սա։ Ոչ գրառումների տեսակները, ոչ բովանդակությունը առանձնահատուկ հիմք չեն տրամադրում ենթադրելու որ պրն․ Փաշինյանը ավելի կնախընտրեր երեկոյան գրառումները, համեմատ նախորդ ամսվա։ <br>Հետագայում կուսումնասիրենք նաև թե արդյոք կապ կա գրառման կատարման ժամի և հետևորդների արձագանքի միջև։</p><p>Ըստ գրառման <strong>տեսակի</strong>, գրառումները բաշխված են հետևյալ կերպ․</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twevm6OplXmwTK81VX7v9A.png" /></figure><ul><li>Տեքստային գրառումները հաճախ հանդիսանում էին պաշտոնական վիճակագրական տվյալների ամփոփում բայց հիմնականում այլ տարբեր բովանդակության էին:</li><li>Վարչապետը հաճախ կիսվում էր “ՀՀ Կառավարություն” էջի գրառումներով (բայց ոչ միայն) հավանաբար փորձելով ավելի լայն տարածում տալ այդ նյութերին:</li><li>Շատ են դեպի արտաքին (ոչ ֆեյսբուքյան) կայքեր հղումները, որոնք գրեթե ամբողջովին բաղկացած են յութուբյան վիդեոներից։ Այստեղ էլ, կրկին, պրն․ Փաշինյանը կիսվում էր այլ աղբյուրների (1in.am, ՀՀ կառավարություն, Ազատություն, Civilnet…) կողմից թողարկված նյութերից, որոնք հիմնականում վերաբերում են նրա այցերին, ասուլիսներին, բայց, կրկին, ոչ միայն։</li></ul><p>Առանձին վերլուծության է արժանի լայվ տեսակի գրառումների պատկերը տարբեր ամիսներին․</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*6nGrdxjX5_2iOD5Sl6wgMQ.png" /><figcaption>Լայվ տեսակի գրառումների քանակը տարբեր ամիսներին</figcaption></figure><p>Չնայած որ “զրույց քաղաքացու հետ” տեսակի լայվերը կարևոր տեղ են զգաղեցնում դիտորդների ոուշադրության մեջ (կհամոզվենք հետագայում), ընդհանուր լայվ տեսակի գրառումների մեջ գերակշռում են այլ բովանդակությամբ նյութեր, օրինակ պաշտոնական և ոչ պաշտոնական այցեր, ասուլիսներ,ելույթներ և հարցազրույցներ, կառավարության նիստեր կամ միջոցառումներից միացումներ։ Մասնավորապես փետրվար ամսվա 19 գրառումից 13ը եղել են Ազգային Ժողովի և Կառավարության նիստերից միացումներ, մարտ ամսվա 22 գրառումից 7ում ցուցադրվում է Վարչապետի այցը Արարատի մարզի գյուղեր։ Հետագա ամիսներին արդեն, նույնիսկ գրառումների քանակի ավելացման հետ, նյութերի բովանդակությունը մնում է բազմազան, առանց ակնհայտ օրինաչափությունների։</p><p>Եվս երեք փաստ, որ ուշադրություն են գրավում</p><ul><li>Օգոստոս ամսին կատարվել է 38 տեքստային գրառում — նախորդ ամսվա 11ի փոխարեն։ Գրառումների զգալի մասում խոսվում է կաառավարության որոշ փոփոխությունների և ձեռքբերումների ամփոփման վերաբերյալ։ Հավանաբար պայմանավորված է կիսամյակային վիճակագրական տվյալների հասանելիությամբ և դրանց հիման վրա կատարված որոշումներով։</li><li>Ապրիլ ամսին էջիը կիսվել է 40 հղումներով վիդեոներով, նախորդ ամսվա 23ի համեմատ, բայց այստեղ արդեն չեմ կարող հիպոթեզ առաջադրել։</li><li>Նկար տեսակի գրառումները պրն․ Փաշինյանը ավելի հաճախ կատարում էր երեկոյան ժամերին։ Բացառությամբ հունիս ամվա, երբ 3 նկարն էլ տեղադրվել էին աշխատանքային ժամերին։</li></ul><p>Երևի այսքանով սահմանափակեմ վերլուծության առաջին մասը, որովհետև հաջորդներում պլանավորում եմ կատարել ավելի հետաքրքիր տեսակի վերլուծություններ կապված լայքերի (էմոջիների) ու մեկնաբանությունների վերաբերյալ, ավելի շատ փորձելով հասկանալ ոչ թե Վարչապետի, այլ էջի հետևորդների պահվածքը։</p><p>Ուրախ կլինեմ լսել առաջարկներ/մտքեր թե ի՞նչ կարելի է ներառել հաջորդ մասում/մասերում, ինչը բաց թողեցի կամ որտեղ սխալվեցի։</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e2faa09d56a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ծրագրավորման գրականություն]]></title>
            <link>https://medium.com/@arikshtein2/%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B4%D5%A1%D5%B6-%D5%A3%D6%80%D5%A1%D5%AF%D5%A1%D5%B6%D5%B8%D6%82%D5%A9%D5%B5%D5%B8%D6%82%D5%B6-775178a524a8?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/775178a524a8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[books]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 11:26:08 GMT</pubDate>
            <atom:updated>2020-03-02T11:35:31.682Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*ZvzHfPWpBbjDylP7.jpg" /></figure><p>Ինչպես նշեցի իմ <a href="https://medium.com/@arikshtein2/%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B4%D5%A1%D5%B6-%D5%A4%D5%A1%D5%BD%D5%A8%D5%B6%D5%A9%D5%A1%D6%81%D5%B6%D5%A5%D6%80-%D5%A2%D5%A1-%D5%B0%D5%A5%D5%BF%D5%B8-4d5aff260307">նախորդ հոդվածում</a>, “ուսումը շարունակական ու անծայրածիր գործընթաց ա, որը չպետք ա դադարի”։ Սա նշանակում է, որ նույնիսկ ծրագրավորման հատուկ դասընթացների ավարտից հետո դեռ շատ ու շատ գիտելիքներ կա ձեռք բերելու։ Հոդվածում փորձեմ թվարկել իմ սուբյեկտիվ կարծիքով լավագույն մեթոդները, թե ինչպես ընտրել <strong>ճիշտ </strong>գրականություն:</p><p>Ինչու՞ միայն գրականություն։ Ի սկզբանե պլանավորում էի վեռնագրել “․․․ գրականություն և հոլովակներ” բայց հետո հասկացա, որ այդքան էլ մեծ փորձ չունեմ ծրագրավորման թեմայով որակով հոլովակներ գտնելու, և կյանքում սահմանափակվել եմ միայն Յութուբում բացատրություններ և պարզաբանումներ փնտրելով։ Չնայած որ կարող են ձանձրալի, ձգձգված թվալ, վստահեցնում եմ, որ գրքերը ավելի հիմնային, խորը ու բովանդակալի աղբյուրներ կլինեն ծրագրավորման մեջ որևէ գիտելիք ձեռք բերելու ճանապարհին։ <br>Փորձել եմ նույնիսկ համեմատել գիրքը դրա նույն վեռնագրով նույն հեղինակների կողմից նույն բովանդակությամբ հոլովակի հետ․ վերջինս տևում էր 2 ժամ 42 րոպե, մինչդեռ գրքից ես մի քանի շաբաթում միայն 3 գլուխ հասցրեցի կարդալ։</p><p>Նախ դասակարգենք ըստ լեզվի․</p><h3>Ռուսերեն գրականություն</h3><p>Մոռացեք, ռուսերենով նորմալ բան չեք գտնի։ Նախ որովհետև այլ շատ կարևոր աղբյուրներ (stackoverflow, դոկումենտացիա) հասանելի են միայն անգլերենով, և երկրորդը որովհետև ռուս հեղինակները շատ ավելի քիչ են, իսկ թարգմանությունները հրատարակվում են չափազանց ուշ։ Այնպես որ առաջ դեպի <a href="https://www.facebook.com/EngwithLaura/">անգլերենի դասընթացների</a> (non sponsored):</p><h3>Անգլերեն գրականություն</h3><p>Ամբողջովին սկսնակ, թեմայից անտեղյակ լինելու դեպքում ես ընդամենը բացում էի Գուգլը ու փնտրում “10 Best books to learn [ինչ որ բան]”, հետո հղվում դեպի առաջին պատասխանը ու ուսումնասիրում ցանկերը։ Փորձը ցույց տվեց որ 3/10 գրքերը իրոք բարենպաստ էին սկսնակների համար։</p><p>Երբեք մի նայեք “Bestsellers on Amazon”, որովհետև նախ ցանկը հսկայական է և, հաջորդը, շատ հին գրքեր են հանդիպում, ինչը այդքան էլ օգտակար չի։ Ընդհանրապես ծրագրավորման աշխարհը փոխվում է շատ արագ, և դասագիրքը կարող է 4–5 տարում ակտուալությունը կորցնել լիորեն։ Կան գրքեր, որոնք 90ականներից մինչև հիմա ուղեցույց են հանդիսանում խոշորագույն համալսարանների ուսանողների համար։ Կան նաև գրքեր որոնք ակտուալ են 2011ից մինչև հիմա (<a href="https://books.google.pl/books/about/HTML_and_CSS.html?id=aGjaBTbT0o0C&amp;printsec=frontcover&amp;source=kp_read_button&amp;redir_esc=y#v=onepage&amp;q&amp;f=false">օրինակ</a>), բայց հնարավորության դեպքում խորհուրդ կտամ նախընտրություն տալ թարմերին։</p><h4>Ինչպես ներբեռնել գրքեր</h4><p>Հրատարակչությունները, որ հիմա կթվարկեմ, իրենց գրքերը վաճառում են բավականին բարձր գնով, ու որպեսզի դրանք ձեզ չվախեցնեմ, ահա մի մեթոդ որի օգնությամբ կկարողանաք ներբեռնել ձեր ցանկացած գրքերն անվճար։ Գոյություն ունի <a href="http://gen.lib.rus.ec/">կայք </a>(<a href="https://libgen.pw/">հայելի</a>), որը պարունակում է գրեթե բոլոր գրքերի վերջին հրատարակումները և հնարավոր է ներբեռնել առանց որևէ տեսակի գրանցման։ Միայն ուշադիր եղեք, փնտրելուց pdf ֆորմատը ներբեռնեք։</p><p>Հիմա անցնենք բուն գրականությանը։ Ինչպես նշեցի, սա ուղեցույց չէ թե “ինչ լավ գիրք ընտրել”, այլ “ինչպես լավ գիրք ընտրել” և ես կթվարկեմ հրատարակչություններ որոնց գրքերը գրեթե միշտ բարձրունքում են։ Նշեմ, որ բոլոր նշվածների գրքերը ունեն սպեցիֆիկ կազմ ու 1–2 գիրք տեսնելուց հետո կկարողանաք տարբերակել և ճանաչել դրանք մյուսների մեջ։</p><h4><a href="https://ssearch.oreilly.com/?i=1;q=python;q1=Books;q2=O%27Reilly+Media;x1=t1;x2=publisher&amp;act=fc_contenttype_O%27Reilly%20Media">O’Reilly Media</a></h4><p>O’Reilly-ն առանձնանում է հասկանալի ու թափանցիկ տեքստերով։ Բովանդակությունը բավականին հարուստ է, քննարկումները՝ չափավոր խորը։ Գրքի բնութագիրը ու կառուցվածքը հասանելի է հրատարակչության կաքում (հղումը վերևում)։ Փնտրում ենք մեզ հետաքրքրող թեման կայքում, ընտրում ենք ձեզ աչքով-ունքով անող գիրքը, կարդում բնութագիրը։ Եթե գրավեց, գտնում ենք նույնը (ցանկալի է վերջին հրատարակումը) իմ նշած կայքում ու ներբեռնում ենք։ Եթե չկա, փորձենք մի ուրիշը։</p><h4><a href="https://www.apress.com/de/search?dnc=true&amp;facet-type=type__book&amp;query=python">Apress</a></h4><p>Apressը հատուկ տեղ ունի իմ “գրադարանում”, քանի որ այնտեղ կարողացել եմ գտնել ինչպես նոր, այնպես էլ հին գրականություն։ Մյուս կողմից հնարավոր է գտնել առանձին գիրք կոնկրետ, նեղ թեմայի շուրջ։</p><h4><a href="https://www.packtpub.com/catalogsearch/result/?q=python&amp;product_type_filter=Book&amp;released=Available">PaktPub</a></h4><p>Մեր ժամանակների հերոսը։ Հսկայական հայտնիության պատճառով շատ հեղնիկաներ հրատարակում են իրենց գրքերը հենց PaktPubի հովանու ներքո։ Պարունակում է բավականին թարմ գրականություն գրեթե ցանկացած տեխնոլոգիայի շուրջ։ Կկարողանաք գտնել ինչպես կատարյալ սկսնակի, այնպես էլ լուրջ մասնագետի համար գրված աշխատանքներ։</p><p>Այս մեկի վրա միքիչ կմանրամասնեմ, քանի որ կա 3 հիմնական տեսակի գիրք․</p><ul><li>Learning [ինչ որ բան] — սկսնակների համար, լայն ուղղվածությամբ</li><li>Mastering / Pro [ինչ որ բան] — մասնագետների համար, հաջորդ մակարդակը</li><li>[ինչ ոչ բան] cookbook — ինչպես հուշում է անունը, բաղադրատոմսեր են, թե ինչպես վարվել տարբեր իրավիճակներում, խորհուրդներ և հնարքներ, էլեգանտ լուծումներ բարդ հարցերին։ Խորհուրդ կտամ կարդալ նախորդ երկուսից հետո։</li></ul><p>Հրատարակչությունը “հրատարակում է” նաև հոլովակներ, սակայն անվճար տարբերակով դրանք դժվար թե գտնեք, իսկ գինը այդքան էլ հարմար չի։</p><h4><a href="https://www.manning.com/">Manning</a></h4><p>Համեմատաբար վերջերս եմ սա հայտնագործել ինձ համար։ Առանձնանում են նյութերի թարմությամբ, վերահրատարակելով, ու գրքերի պրակտիկ կիրառության ուղղվածությամբ։ Շար գրքեր չեք կարողանա գտնել իմ նշած աղբյուրում, առավել ևս եթե 2–3 ամսվա թարմության են։</p><p>Եթե դժվարանում եք ընտրել տարբեր գրքերի մեջ, կարող եք համեմատել դրանց գնահատականները, կարդալ մեկնաբանությունները կամ պարզապես կարդալ բոլոր տարբերակների առաջին էջը և կողմնորոշվել “աչքով-ունքով անելու” սկզբունքով։</p><p>Նրանց համար, ով պատրաստ է գումար ներդնել և աջակցել գրքերի հեղինակներին, խորհուրդ կտամ դիտարկել բաժանորդագրություն <a href="https://subscribe.packtpub.com/pricing/">PaktPub</a>-ին կամ <a href="https://www.oreilly.com/online-learning/pricing.html">O’Reilly</a>-ին ու օգտվել բոլոր գրքերից օնլայն։ Վերջինս պարունակում է բոլոր նշված հրատարակիչների (ոչ միայն) բոլոր գրքերը և հոլովակները։ Իդեպ, ծախսերը կարելի է կիսել ընկերոջ հետ և օգտվել երկուսով/երեքով․․․։</p><p>Հ․Գ․ Հղումները տանում են “Python” թեմայով գրքերի ցանկ զուտ պատահական լեզվի ընտրության սկզբունքով։ Ես չեմ դրդում ուսումը սկսել այդտեղից (:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=775178a524a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ծրագրավորման դասընթացներ։ Բա հետո՞։]]></title>
            <link>https://medium.com/@arikshtein2/%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B4%D5%A1%D5%B6-%D5%A4%D5%A1%D5%BD%D5%A8%D5%B6%D5%A9%D5%A1%D6%81%D5%B6%D5%A5%D6%80-%D5%A2%D5%A1-%D5%B0%D5%A5%D5%BF%D5%B8-4d5aff260307?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d5aff260307</guid>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Tue, 25 Feb 2020 07:31:30 GMT</pubDate>
            <atom:updated>2020-02-25T07:31:30.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*qN90TQjwfF_ARudojJl1Dg.png" /></figure><p>Այսպիսով, դու դիմեցիր ծրագրավորման դասընթացների, 4–6 ամիս ժրաջան աշխատեցիր, որ կարողանաս մուտք գործել հրաշքներով լի ՏՏ աշխարհ, որտեղ մարդիկ երբ ուզում գործի են գնում ու պարկերով փող են տանում տուն։ Դու ուշադիր լսելցիր դասընթացավարիդ և պարտաճանաչ կատարելցիր բոլոր հանձնարարությունները։ Եվ ահա, դասընթացներն ավարտվեցին ու ժամանակն է ամրապնդել սովորածը փորձով և, ինչու ոչ, հետ բերել կատարված ներդրումը։</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*LdNcaFEEaBXFqNHZZ8dH1g.png" /></figure><p>Թեպետև հիմա ՏՏն ամենաարագ աճող ոլորտն է ու հսկայական պահանջարկ ունի, որը, կարծես թե, չի հագենում, հայտարարությունների գերակշռող մասը ենթադրում է որոշակի աշխատանքային փորձ, որը դու, ցավոք, դեռ չունես։ Մյուս կողմից ամեն ամիս քեզ պես ևս 50 հոգի ավարտում են նման դասընթացներ ու դիմում են նույն հաստիքների ինչ դու։ Գումարենք մի քանի համալսարանների ՏՏ բակալավրի բազմաթիվ շրջանավարտներին ու գիտակցում ես, որ ամեն ինչ այդքան հեշտ չի, ինչքան թվում էր։</p><p>Հոդվածում փորձեմ ներկայացնել որոշ խորհուրդներ, որոնք կառանձնացնեն քո թեկնածությունը դիմորդների մոխրագույն բանակից և կբարձրացնեն հավանականությունը հարցազրույցի հրավրիված լինելու։</p><h3>1. Թարգի’ լատինատառ գրելը</h3><blockquote>Pntrum em front_end-i asxatank gitem html css js javascript java script EREXEK STAPA</blockquote><p>Կներեք, չդիմացա։ Բայց իրոք, էլի, մի քիչ պրոֆեսինոլիզմ պահպանենք։ Ես չեմ զարմանա, որ էսպես շարադրող մարդու ինքնակենսագրությունն էլ լատինատառ գրված լինի։ Մարդ, որ չգիտի, թե ինչպես ստեղնաշարը փոխել հայատառի, տեղ չունի ՏՏում։ Իսկ ով գիտի, բայց չի անում, միայն խոսում ա նրա անլուրջ տրամադրվածության մասին։ Ես էս գրառումներին առհասարակ չեմ արձագանքում։</p><h3>2. Ունեցի’ր “պորտֆոլիո”</h3><p>Գործատուն նախընտրություն կտա հարցազրույցի հրավիրել նրանց, ովքեր բացի լեզվին տիրապետելու պնդումից կներկայացնեն ապացույց, կատարված և պատրաստի պրոեկտների տեսքով։</p><p><strong>Ի՞նչ սարքել։</strong> Ինչ ուզես !</p><h4>FrontEnd</h4><p>Էս մասնագետների հարցը շատ հեշտ ա: Բացի նրանից, որ ցանկացաց մեկը կարող է գնալ Գուգլ, գրել “front end portfolio” ու հենց առաջին հղումը բացել, պորտֆոլիո կարող է հանդիսանալ ամեն ինչ։ Օն-լայն վայրկյանաչափ, ինքնակենսագրություն, ռեստորանի կայք, նույնիսկ մի բան, ինչ արդեն գոյություն ունի․ menu.am, microsoft.com, github.com (միայն թե արտագրված չլինի)։</p><p>2018ի հունվարին 20&#39;000ից ավել հանրային հասանելի API-ներ են եղել (<a href="https://www.programmableweb.com/news/apis-show-faster-growth-rate-2019-previous-years/research/2019/07/17">աղբյուր</a>), սարքիր փոխարժեքի, եղանակի, թվիթերի, գրքերի, ֆիլմերի կայք․․․ բոլոր հիմքերը դրված են, մնում է դնես ու անես։</p><p>Բացի GitHub-ում կոդը տեղադրելուց, մի շարք <strong>անվճար </strong>հոսթինգներ կան, որտեղ այսպիսի փոքր պրոյեկտները կարելի է թողարկել ու կիսվել պոտենցիալ գործատուների հետ։ Հենց <a href="https://medium.com/@svinkle/publish-and-share-your-own-website-for-free-with-github-2eff049a1cb5">GitHubը</a>, <a href="https://medium.com/@aleemuddin13/how-to-host-static-website-on-firebase-hosting-for-free-9de8917bebf2">Google Firebase</a>, <a href="https://blog.teamtreehouse.com/deploy-static-site-heroku">Heroku</a>։ Հղումներն էլ տեղադրեք ձեր ինքնակենսագրության մեջ (չմոռանաք bit.ly-ով կարճեցնել)։</p><h4>Հավելվածներ — Android/iOS</h4><p>Էստեղ է՛լ ավելի լայն ընտրություն կա․ կարելի կլինի վերստեղծել հենց քո հեռախոսի միջի որևէ հավելվածի հեշտ տարբերակ, բայց էն ֆունկցիաներով, որոնք քո կարծիքով պակասում էին։</p><p>Վերջնական տարբերակը տեղադրենք Google Drive, ու, հղումը նախապես կարճեցնելով bit.ly-ում, կիսվել պոտենցիալ գործատուի հետ։</p><h4>BackEnd</h4><p>Կարող եմ խորհուրդ տալ գրել նոր APIներ։ Լավ միտք կարող է լինել, որ լատինատառ հայերեն տեքստ տաս, փորձի սարքել հայատառ (: Տո վերցրու 2 հատ ուրիշ API, տեղեկատվությունը միացրու ու մատուցի: Չմոռանանք, որ գուգլում “backend portfolio ideas” գրելը օգտակար ա։ Վերոնշյալ Firebase-ն ու Heroku-ն կօգնեն հոսթինգի հարցում։ .NET մասնագետների համար՝ <a href="https://medium.com/@bharatdwarkani/how-to-publish-asp-net-core-3-0-app-in-azure-linux-app-service-explained-from-scratch-6e45392ca256">Azure</a>։</p><h4>Desktop</h4><p>Սովորիր BackEnd:</p><p>Տեսեք մնացածը ինչ ունեն (ես չունեմ, ինձ չնայեք), ոգեշնչվեք, ստեղծագործեք, արարեք․․․ վստահեցնում եմ, աննկատ չի մնա։</p><h3>3. The show must go on</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*k1P4vDr06__pJDjrdIphJQ.png" /></figure><p>Սովորեցիր-վերջացրեցիր, ճի՞շտ ա։ Սխալ ա ! Ուսումը շարունակական ու անծայրածիր գործընթաց ա, որը չպետք ա դադարի։</p><p>Ես լիովին հասկանում եմ, որ հետաքրքրվածությունը մարում ա, դրդվածությունը կորում ա, նեռվերդ նեռվայնանում են, բայց ինչքան շատ իմանաս, այդքան շանսերդ աճում են։ Ենթադրենք՝ դու գիտես HTML, CSS, Javascript․ է 500 ուրիշներ էդ նույնը գիտեն, ինչի՞ պիտի հենց քեզ շանս տան։ Ավելացրու React, 500ը կվերածվի 150ի։ Ավելացրու Redux, դարձավ 50։ Ու էսպես կամաց կամաց մրցակիցներիդ քանակը կիջնի այնքան, որ հարցազրույցի հրավիրված լինելու շանսերդ խելքին մոտ կլինեն։ Նայիր, տես, ինչ են պահանջում էն կազմակեպություններում, որտեղ կցանկանայիր աշխատել։</p><p>Իսկ եթե կարծում ես, որ ինչ որ պետք ա, արդեն գիտես, էս քեզ <a href="https://github.com/kamranahmedse/developer-roadmap">կետ-առ-կետ ձեռնարկ</a>, թե դու ինչ ունես սովորելու թե որպես Front-End մասնագետ, թե Back-End և թե Dev-Ops: Էլ չես կարծում, չէ՞ (: Էս էլ <a href="https://github.com/mobile-roadmap/android-developer-roadmap">Android</a> ու <a href="https://www.linkedin.com/feed/update/urn:li:activity:6374940532589854720/">iOS</a> մասնագետներինը։</p><p>Մյուս հոդվածում կպատմեմ թե <strong>ինչպես</strong> ճիշտ սովորել։</p><h3>4. Փափուկ տեխնիկական հմտություններ</h3><p>Ընդհանրապես “փափուկ” են անվանում այն հմտությունները, որոնք չես գրի ինքնակենսագրությունում, բայց որոշ գործերի համար կաևոր են․ կոնֆլիկտակայունություն, սթրեսակայունություն, առաջնորդության հմտություններ և այլն։ Մեր իսկ նպատակը ինքնակենսագրությունը հարստացնելն է։ Կան որոշ օժանդակ գիտելիքներ, որոնք միշտ ողջունելի են ծրագրավորողի CV-ի մեջ։</p><p>Դրանք են.</p><ul><li><strong>GIT</strong></li><li>Որևէ ամպային (Cloud) համակարգ — Azure/AWS/GCP</li><li>Որևէ Workflow Management գործիք — Microsoft DevOps/JIRA/…</li><li>Docker</li><li>Linux / Bash / Powershell</li></ul><p>Սրանց իմացությունը ոչ միայն մեծ հավանականությամբ պետք կգա աշխատանքի մեջ, այլև կդիտվեն որպես էական առավելություն, քանի որ խոսում են իրական պայմաններում աշխատանք կատարելու պատրաստվածության մասին։</p><h3>5. (բոնուս) Ինքնակենսագրությունը Word-ով մի՛ հավաքիր</h3><p>Կոլեգաներս կասեն “բայց ինչ կապ ունի, կարևորը միջի գրածն ա, ոչ թե դիզայնը”, ու կգնան Կոկո-կոլա խմելու ;)</p><p>Առաջին տպավորությունը <strong>միշտ</strong> կարևոր ա։ CVն կարող է լինել լավ ձևավորված, բայց նաև գործնական ու խիստ, կամ ազատ ու ընկերական, կամ վառ ու գրավիչ։ Միայն պարտադիր չափի մեջ, զիզի-պիզի բաները անտեղի են։</p><p>Չեմ սիրում մարդկանց փոխարեն գուգլ անել (օրինակ “Free CV generator”), ու փոխարենը խորհուրդ կտամ <a href="https://www.freepik.com/free-photos-vectors/cv-template">Freepik </a>կայքի համապատասխան բաժինը, որտեղ կգտնեք հազարավոր շաբլոններ ձեր ինքնակենսագրության համար։ Միայն հարկավոր կլինի Adobe Illustrator-ով շաբլոնը վերածել ինքնակենսագրության, ինչը կարա երկար տևի բայց միանշանակ ադյունք կունենա։ <a href="https://www.freepik.com/free-vector/colorful-resume-template-with-infographic-elements_1231678.htm#page=21&amp;query=cv+template&amp;position=37">Այս մեկը</a> ոնց որ թե լավն ա երևում, առավել ևս եթե շատ ցույց տալու բան չունես։</p><p>Ծրագրավորման դասընթացից, հետո մտածել “վերջ, մնումա մի տեղ տեղավորվեմ ու լավ կլնի” նույն կերպ ա հնչում, ինչպես եթե դա ասեր համալսարանի բակալավրի շրջանավարտը։ Մինչդեռ իրականում դա ընդհամենը հազարավոր քայլերից միայն առաջինն էր ու, հավատացեք, դժվարների ցանկում էլ չէր նույնիսկ։</p><p>Բայց չհամարձակվես հիասթափվել, քանզի լավագույնը դեռ առջևում է։ Մոտիվացիայի համար, վերջերս իմացա, որ ավագ ծրագրավորողը 1&#39;500&#39;000դր մաքուր աշխատավարձ ա ստանում այսօր Հայաստանում։ Չէ, ծանոթով չի, ու հա, դու էլ կարող ես ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d5aff260307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Երեք միֆ ծրագրավորման մասին]]></title>
            <link>https://medium.com/@arikshtein2/%D5%A5%D6%80%D5%A5%D6%84-%D5%B4%D5%AB%D6%86-%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B4%D5%A1%D5%B6-%D5%B4%D5%A1%D5%BD%D5%AB%D5%B6-898346589db6?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/898346589db6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Thu, 25 Jul 2019 12:57:53 GMT</pubDate>
            <atom:updated>2019-07-25T13:04:17.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*oPzSAN7fpFg8TtDj.jpg" /></figure><p>Մինչ պատմվածքս սկսելը, նախ նշեմ, որ ես ծրագրավորող <strong>չեմ</strong>։ Ծրագրավորել գիտեմ, բայց ինձ ծրագրավորող չեմ համարում, քանի որ ոչ կրթությամբ եմ ծրագրավորող, ոչ էլ պաշտոնով։</p><p>Այնուամենայնիվ արդեն 3 տարի ա, ինչ Տեղեկատվական Տեխնոլոգիաների ոլորտում եմ աշխատում, ինչպես նաև իմ շրջապատի մեծամասնությունը, ուստի ինձ բավական կոմպետենտ եմ համարում այս ամենի մասին խոսել։</p><p>Զգուշացնեմ նաև, որ ստորև շարադրված է իմ սուբյեկտիվ կարծիքը, ինչը ձեր իրականության հետ կարող է չհամընկնել, և եթե կա կոնստրուկտիվ կրիտիկա, ուրախ կլինեմ մեկնաբանություններում կարդալ։</p><p>Եվ այսպես, սկսեցինք։</p><h4>Միֆ 1. “Ծրագրավորման մեջ փող կա”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/0*ADRW5sZoWOujzASz.jpg" /><figcaption>Ծրագրավորողները՝ շատերի աչքերում</figcaption></figure><p>Բոլորս էլ առնչվել ենք էն կարծիքի հետ որ “ծրագրավորողները շատ փող են ստանում”։ Բոլորս էլ կունենանք մի ծանոթ, ով ծրագրավորող ա ու բարձր եկամուտ ունի, ու էդպես բերնեբերան էս հանրային կարծիքը ձևավորվեց։ Բայց էս միֆը իրականում ոչ ճիշտ ա, ոչ էլ սուտ։</p><p>Սկսեմ նրանից որ ցածր աշխատավարձով ծրագրավորողը ինքնին հազվագյուտ երևույթ ա, քանի որ ՏՏ ոլորտում երբ մարդ աճելու/զարգանալու միտումներ չի ցուցաբերում, էդ մարդը շատ արագ ազատվում ա իր պաշտոնից։ Ինչը ճիշտ չի հաշվապահությունում, մարքեթինգում, մենեջմենթում, խոհարարությունում և այլն։ Դրա համար ցածր աշխատավարձով հաշվապահներ ավելի շատ կան, քան ցածր աշխատավարձով ծրագրավորողներ։</p><p>Իսկ հիմա իմ օրինակով բացատրեմ․ Օրինակ ես ունեմ ծրագրավորող ընկեր, ով 4 տարի ա էդ ոլորտում ա, ու որի “մաքուր” աշխատավարձը 600հզ․ դրամ ա։ Ունեմ ֆինանսներում աշխատող ընկեր, ով ունի 4 տարվա աշխատանքային փորձ ու ունի 550&#39;000դր․ ամսեկան եկամուտ։ Ունեմ մարկետոլոգ ընկեր նույն աշխատանքային փորձով և մոտ նույն աշխատավարձով։ Էս ցանկը համալրվում ա նաև մենեջերներով, լուսանկարիչներով, և այլն։ Այս մարդկանց, բացի բարձր եկամուտից, միավորում է 2 բան․</p><ul><li>նրանք լավ մասնագետներ են, և ունեն տարիների ընթացքում հավաքած ամուր գիտելիքներ</li><li>նրանք աշխատում են առաջատար կազմակերպություններում</li></ul><p>Այդ մարդկանց ճանաչելով, ես կասեի, որ այս երկուսը իրար հետ փոխկապակցված են, բայց Ձեր ուշադրությունը կհրավիրեի ավելի շուտ այդ երկու գործոնների՝ եկամուտի վրա ազդեցությանը։ Իսկ ավելի կոնկրետ բարձր եկամուտի և ոլորտի իրարից կատարյալապես անկախ լինելուն (նշված օրինակների սահմաններում)։ Ավելի կոնկրետ, բարձր եկամուտ երաշխավորում են գիտելիքները, փորձը և ճիշտ աշխատատեղը, ոչ թե մասնագիտությունը։</p><p>Մյուս կողմից ունեմ նույն ֆինանսներում (վարկերի սպասարկումում մնացած), հաշվապահությունում (առանց սերտիֆիկատ), մարքեթինգում և տուրիզմում (հին մեթոդներով շարժվող) ժրաջան, բայց ոչ պրոդուկտիվ աշխատող ընկերներ, որոնց եկամուտը թեպետև ցածր չի բայց բարձր էլ չի, ու պատճառը վերևում նշված հենց երկու գործոնների բացակայությունն է, այլ ոչ թե ծրագրավորող չլինելը։</p><p>Սրանով ես չեմ մերժում էն փաստը, որ ծրագրավորումը, որպես մասնագիտություն, բարձր ա վարձատրվում քան, օրինակ, պատմաբանությունը, բայց դա միանշանակ ոչ ամենաբարձր վարձատրվողն ա, ոչ ամենահասանելին ա, ոչ էլ, այո, այո, ամենապահանջվածն ա (ներքևում կպարզաբանեմ)։ Չեմ մերժում, որ կան ցածր վարձատրվող մասնագիտություններ, որոնք տրամաբանորեն պիտի բարձր վարձատրվեն։</p><p>Որպես օբյեկտիվ գնահատական, Software Engineering (ծրագրավորում) մասնագիտությունը 17րդն ա էս ցանկում ըստ վարձատրության։ <a href="https://teleport.org/cities/yerevan/salaries/">https://teleport.org/cities/yerevan/salaries/</a></p><h4>Միֆ 2․ ՏՏ ոլորտում միայն ծրագրավորողներ են</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*73_wyl5XZRa3wtealSQWKA.png" /><figcaption>Գոյություն չունեցող ՏՏ կազմակերպություն</figcaption></figure><p>Շատ անգամ, երբ տարբեր մարդկանց խորհուրդ եմ տալիս ՏՏ ոլորտի կազմակերպություն, որպես լավ աշխատատեղ, ստացել եմ “բայց ես ծրագրավորող չեմ” պատասխանը։ Մինչդեռ միջին և մեծ ՏՏ կազմակերպություններում հիմնականում առկա են լինում հետևյալ մասնագիտությունները (բացի ծրագրավորողից)․</p><ul><li>Illustration, Web կամ UI/UX Design</li><li>Business Development, Promotion &amp; Braiding</li><li>Product Management, Project Management</li><li>HR, Recruiting (վերջերս)</li><li>Quality Assurance</li><li>Customer Support</li></ul><p>Եվ մինչդեռ ցուցակում առաջին երեքը պահանջում են, կամ նվազագույնը ենթադրում են համապատասխան բարձրագույն կրթություն, վերջին 3ի համար համապատասխան դիպլոմ, կարելի է ասել, գոյություն չունի ու հետևաբար ավելի ազատ ա մուտքը։</p><p>Այնուամենայնիվ, փաստացի բացի ծրագրավորումից կան ևս 6 հիմնական մասնագիտություններ, որոնք մեծ հավանականությամբ ավելի բարձր կվարձատրվեն քան ոչ ՏՏ ընկերություններում և որոնք “մաթեմ” չեն պահանջում, բայց պահանջում են բարձր պրոֆեսիոնալիզմ և անգլերեն լեզվի տիրապետում։</p><p>Ովքեր կասեն որ սրանք շատ ավելի քիչ պահանջված են քան բուն ծրագրավորումը և որպես արգումենտ կբերեն այն, որ ամեն երրորդ աշխատանքի հայտարարությունը հենց ծրագրավորողի է վերաբերվում, շտապեմ ձեզ հիասթափեցնել։ Ծրագրավորումը բարդ ոլորտ է, և մինչդեռ հմուտ մարկետոլոգը կկարողանա վարել գրեթե ցանկացած (կամ նվազագույնը շատ լայն սպեկտրի) կազմակերպության բրենդինգ, հմուտ ծրագրավորողները, որպես օրենք, կենտրոնանում են 1–2 տեխնոլոգիաների վրա և աշխատանքի հայտարարությունների 80%ը իրենց համար դառնում է ոչ ռելեվանտ։ Այսինքն, հոդվածը գրելու պահին staff.am-ում 152 Software Development հաստիքներից, միջին վիճակագրական ծրագրավորողը կհամապատասխանի միայն մոտ 30ին։ Համեմատության համար․ նույն կայքում դիզայն և մենեջմենթ նկատեգորիաներից յուրաքանչյուրում այս պահին կա 15 հաստիք։</p><h4>Միֆ 3․ Հնարավոր է 3–4 ամսում զրոյից սովորել ծրագրավորում</h4><p>Հատկապես վերջրերս, համացանցը վխտում ա մատչելի և կարճաժամկետ ծրագրավորման դասընթացներով, որ խոսք են տալիս 4 ամսյա դասընթացներից հետո նույնիսկ լավագույններին աշխատանքով ապահովել։ Ինձանից հաճախ են կարծիք հարցնում թե ինչքանով է սա իրատեսական․</p><blockquote><strong>6</strong> ամսում ծրագրավորում կարելի է սովորել միայն եթե օրական առնվազն 2 ժամ պարապել ամեն օր։ Առնվազն 2 ժամ նշանակում ա <strong>առնվազն</strong> 2 ժամ, ոչ թե “1 ժամ 40 րոպե” կամ “1,5 ժամ էսօր, վաղը 2,5”, իսկ ամեն օր նշանակում ա <strong>առնվազն </strong>ամսեկան 29 օր, ոչ թե “շաբաթ-կիրակին հանգստանալու համար ա”։ Էս պայմաններում, ճիշտ աշխատելով, ճիշտ ծրագրով, գրականությամբ, ուղղորդող ունենալով, այո, հնարավոր ա։</blockquote><p>Դուք կվստահեի՞ք կարևոր փաստաթղթերի թարգմանությունը 4 ամսյա կուրսերի գնացած թարգմանիչի։ Իսկ ինքչանո՞վ հանգիստ կլինեիք ինքնաթիռում, որի կապիտանը 4 ամիս սիմուլյատորի վրա անհատական պարապմունքներ է ունեցել։ Իսկ ձեռնարկատերը ինչքանո՞վ կվստահի 10՛000$անոց պրոեկտի թեկուզ մի մասը 4 ամիս դասընթացների գնացած ծրագրավորողի։</p><p>Ցավոք, ես փորձ ունեցել եմ նման հաստատություններից մեկի հետ աշխատելու և խիստ բացսական կարծիքի եմ։ Որպես գաղտնիք էլ ասեմ, շատ հաճախ “ապահոված” աշխատանքը դա հենց իրենց իսկ կազմակերպությունում դասավանդելու հնարավորությունն է մինչդեռ իսկապես լավագույն ուսանողը ծրագրավորման աշխատանքի համար կարող էր ստանալ մինչև կրկնակին + աճելու հնարավորություն։</p><p>Չէ, ծրագրավորում հնարավոր չի սովորել 4 ամսում, իսկ ինչ էլ սովորեցնեն, միայն 20–30%ով կբավականացնի ամենակրտսեր պաշտոնի աշխատանք ստանալու համար։ Չէ, վեբ ծրագրավորումն էլ հեշտ չի սովորել, այն ընդհամենը ավելի հասանելի ա համեմատաբար:</p><p>Նախ սկսենք նրանից, որ ծրագրավորողը պարտավոր է միջին կամ բարձր մակարդակի տիրապետել անգլերեն լեզվին, քանի որ արդեն 5 տարուց ավել ռուսերեն լեզվով գրեթե ոչ մի գրականություն չի թողարկվում, իսկ հայերենի մասին ընդհանրապես լռում եմ։ Բացի դրանից ծրագրավորողը առնվազն օրական 2–3 անգամ բախվում է մի խնդրի հետ, որ պետք ա ճշտել ինտերնետում․ եթե չգիտես ինչպես շարադրել հարցդ, կորած ես, իսկ ռեսուրսները նույնպես անգլերենով են։</p><p>Հետո ծրագրավորումը, շատ այլ մասնագեիտությունների պես, պահանջում է յուրահատուկ մտածելակերպ՝ խնդիրները լուծելու համար։ Եվ այդ մտածելակերպը 4 ամսում չի զարգանում։ Պոլիտեխնիկի ՏՏ ֆակուլտետում ուսանողները կիրառական մաթեմատիկա են սովորում ոչ թե որպեսզի աշխատանքի մեջ կիրառեն, այլ որ ձևավորեն մտածելակերպ դրված նպատակին հասնելու համար արագ և օպտիմալ քայլեր կառուցելու, ինչը հենց ծրագրավորման ցանկացած խնդրի լուծման սկզբունքն է։ Զրոյից 4 ամսում դա զարգացնելը իրատեսական չի հնչում ըստ ինձ։</p><p>Իհարկե կան մարդիկ, ում հաջողվել է 4 ամսում սովորել ծրագրավորում և դառնալ լավ մասնագետ։ Անալոգիապես կան միլիոնանց բիզնեսներ որոնք սկսվել են 100$ ներդրումից։ Իսկ քանի՞ բիզնես ա սկսվել 100$ից, ու դրանցից քանիսն են հաջողվել 🤔:</p><p>Հոդվածը վերջացնելուց հետո, երբ կարդացի որ ամփոփեմ, նկատեցի, որ մի տեսակ դեմոտիվացնող ա, վանող միջավայր ա ստեղծում ծրագրավորումը՝ որպես մասնագիտություն ընտրելու համար, բայց ոչ մի այդպիսի նպատակ չկար։ Հոդվածը գրված ա ծրագրավորման հանդեպ գերլավատեսական տրամադրվածությամբ մարդկանց իրականություն վերադարձնելու նպատակով, հիշեցնելու, որ կան նաև այլ մասնագիտություններ որոնք ոչ պակաս / ավելի բարձր վարձատրվող կարող են լինել եթե ճիշտ աշխատել (ոչ թե 12 ժամ, այլ գլխով © Սթիվ Ջոբս)։</p><p>Որպես քաջալերում, խորհուրդ եմ տալիս բոլոր ցանկացողներին սովորել ծրագրավորում, իմանալ ինչպես ա էս ամենը աշխատում, հասկանալ գործընթացները, որ ձեր շուրջ ամեն օր կատարվում են, էքսպերիմենտներ անել, տեխնոլոգիան ձեր օգտին օգտագործել, ստեղծել-ստեղծագործել, զարգացնել, հարստացնել ու ծաղկացնել ոլորտը։ Ձեր հեռախոսի, սմարթ-ժամացույցի, հեռուստացույցի համար ստեղծել այն, ինչ կուզենաք, կառուցել նոր սարքավորումներ, միլիոնավոր կիրառումներով։ Ծրագրավորումը մի հրաշք աշխարհ ա, ուր գրեթե ոչինչ անհնար չի, ու տարեց տարի էդ “գրեթե”ն ավելի ու ավելի ա փոքրանում։ Ծրագրավորում սովորելը խայտառակ հասանելի ա էսօր, հազարավոր կատարյալապես անվճար ռեսուրսներ, միշտ օգնել պատրաստ մասնագետների համայնք, կոնֆերանսներ / միթափներ, և այս ամենը ցանկացած վայրից, մարզից, քաղաքից/գյուղից, գիշեր-ցերեկ։</p><p>Սովորեք ծրագրավորում, որովհետև ձեզ դա դուր է գալիս կամ հետաքրքրում է, բայց ոչ որովհետև “մեջը փող կա” կամ որովհետև “հեշտ ա” կամ “գործը թափած ա”, քանի որ էդ դեպքում դուք միայն ժամանակ եք կորցնում ու միանշանակ հիասթափվելու եք։</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=898346589db6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s do some Data Engineering or “How hard do I work”: Part 2 — Creating Data]]></title>
            <link>https://medium.com/@arikshtein2/lets-do-some-data-engineering-or-how-hard-do-i-work-part-2-creating-data-f104980271ac?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f104980271ac</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Thu, 04 Jul 2019 14:38:47 GMT</pubDate>
            <atom:updated>2019-07-04T14:39:52.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s do some Data Engineering or “How hard do I work”: Part 2 — Creating Data</h3><p>In the first part of the story, I’ve discussed the general concepts and overview of the project. We talked about what our flow will look like and what solutions we’re going to use. I also introduced the importance of the system being distributed. So I’d strongly recommend to read the <a href="https://medium.com/@arikshtein2/lets-do-some-data-engineering-or-how-hard-do-i-work-part-1-introduction-972213ef97b8">Part 1</a> before continuing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Bn6iuZP7rR17ymRE9NbIdA.png" /><figcaption>Project data flow discussed in Part 1</figcaption></figure><p>Now it’s time to dive into the implementation. Let’s start with writing a keyboard an mouse listener and then we’ll setup a Google Cloud project and setup access to Google Pub Sub. Then first two blocks will be ready and we’ll be able to move on.</p><h3>Listening to mouse and keyboard events using Python</h3><p>First of all I need to confess: I’m a terrible programmer. I don’t respect best practices, I don’t use any OOP principles (unless there’s no other option), but what I do do is to comment my code and provide meaningful and short variable names and, after all, it works ! So I’d say we’re even with my conscience, and I don’t feel myself a monster. Ok, now we can go.</p><p>I guess first thing we’ll do is to download the latest version of python. You can find a link to installer download <a href="https://www.python.org/downloads/windows/">here</a>. We’ll go for Python 3 by the way (because why would you use Python 2 ?). <br><em>I don’t consider MacOS and Linux cases only because the Python code I’ll demonstrate will work only on Windows. You can adapt the code to any OS you’d like, or at least you can try.</em></p><p>Next, we need an IDE. I’d personally recommend <a href="https://www.sublimetext.com/3">Sublime Text 3</a> or <a href="https://www.jetbrains.com/pycharm/download/#section=windows">PyCharm CE</a>. Both are portable and free. Sublime Text has many community-driven plugins which may be extremely useful in some situations.</p><p>Now grab some tea/coffee and finally we can start the CODING</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*gMDHFpJl3S8tT4Of8a9xCQ.gif" /></figure><p>BUT before actually writing the code, open the <strong>command line</strong> and type there</p><p><em>pip install pynput</em></p><p><strong>pip</strong> is Python’s <strong>package manager</strong>, it’s like <strong>install wizard</strong> for Python. It connects to a repository of all packages, downloads the required one (if found) and places them in appropriate folder. You can think of a package as several blocks of code written by somebody else to make your life easier. We’ll installing more packages throughout this tutorial</p><h4>Mouse events</h4><p>First we’ll go with listening to mouse clicks, than add the keyboard stuff on the go since there’s not much of a difference, and also we can handle both using the same library. Here’s a slightly modified version of a code from the of <a href="https://pythonhosted.org/pynput/mouse.html">pynput documentation</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6b43746730f7c2f5587c91aef6b2d8a/href">https://medium.com/media/a6b43746730f7c2f5587c91aef6b2d8a/href</a></iframe><p>Paste this in a text file, save it as a .py and double click on it. You’ll see a the command line (or terminal) window which is blank yet. The code we wrote will print out a message when we perform a click with information about which button was clicked. Now try it. Just don’t (left) click on the terminal or your computer will glitch (that’s some kind of bug between the terminal and the library). Try clicking on your desktop or somewhere else. You’ll see messages about your mouse buttons being clicked appearing.</p><p>How does this work:<br>First we need to <strong>import </strong>our newly installed package, the <strong>mouse</strong> part of it, to be precise. Then we’ll write the a function which we want to be executed when a “click” is performed. The 4 parameters indicate the x coordinate of pointer, y coordinate, a button object containing information about the button (usually left/right/middle/other) and a flag if it was a “mouse button press” (true) or “mouse button release” (false). Inside the function first we check if it was a “mouse button press” or “release”. It doesn’t matter which we catch, but we need only 1 of them (otherwise two messages will be printed out). Then there’s a simple print command to write down the button name and “ pressed”.</p><p>Now it gets a little more complicated:<br><em>mouse.Listener </em>initializes (but not starts) a background process (a <strong>thread</strong> to be precise) that will listen to mouse events (click, move, scroll) and call a function when the event happens. Which event we’re interested in and what function to execute is specified in parenthesis. Currently we’re only interested in <strong>click </strong>action and we want the <strong>print_message </strong>function to be executed. Not so hard, right ?<br>Next line instructs Python to <strong>start</strong> the background process, and the next line tells him to <strong>wait</strong> until that process finishes. But why wait ? Simple, Python will exit after the moment he executes the last line of the code. If line 9 does not exist, Python will start the Listener process, and assume that everything what was required, and close the command prompt window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hoZCiiwv45R06z3wtfOD6g.jpeg" /></figure><p>To prevent it from happening we trick Python to wait a while, so the execution of our code does not end and we can see messages displayed from our clicks.</p><p>Now, let’s write a more complete code which will produce a json message (plus a few more improvements)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8642b9ad0292dfa57d0691fa32b2bc01/href">https://medium.com/media/8642b9ad0292dfa57d0691fa32b2bc01/href</a></iframe><p>I decided to spice the things up a bit and to avoid writing boring “time + button” info into our log. So getting the application window title where the click was performed will make our data much more interesting. The <strong>get_current_app_title</strong> function. It will just return a string with a title of the current active window. Don’t go into it too much. Just keep in mind, that you’ll need <strong>ctypes</strong> library to use it (it is built in Python, so no need to <em>pip install</em>). <br>Next we initialize a dict object to transform our “button.left”-ish text to numbers, since numbers are easier to deal with, where left button will be 1, right — 2 and middle — 3. If the button was not found in the dict, 0 will be used. We write the button information into a dict: the button, the timestamp (using timestamp module, which you’d probably noticed importing), and the current active app. Then we <strong>dump the dict to a json</strong> format to later <strong>write</strong> it to a temporary file in our local computer. I ran into <a href="https://stackoverflow.com/questions/47648886/difference-between-strdict-and-json-dumpsdict">this </a>interesting article about why to use the <strong>json</strong> library to convert Python dicts to jsons, rather than to do <em>str(data_dict)</em>.</p><h4>Keyboard events</h4><p>Even though pynput has also a <strong>keyboard </strong>module which has almost everything that we need, I decided to use one more <strong>keyboard </strong>package to make a few things easier.</p><p>Let’s first install the <strong>keyboard</strong> package, we’ll need it later:<br><em>pip install keyboard</em></p><p>Once again, the code to handle keyboard press events is pretty straightforward and close to the one that listens to mouse:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0c284d936e99317ab74d0cf422747f2/href">https://medium.com/media/a0c284d936e99317ab74d0cf422747f2/href</a></iframe><p>Again, we create a function which we want to be executed when the “event” happens. What we want now is to print the pressed key in command line window with some additional message (see below). Next we define a keyboard listener, and we’ll be listening to “press” event (instead of “click” in case of mouse). This will return a <strong>thread</strong> object, which we will start and wait until it ends.</p><p>When writing this project I thought about catching how many times do I copy and paste stuff during my ordinary workday. To have that data we need to check if “Ctrl” button was on hold when “c” or “v” press event happened. And here’s where we’ll need our keyboard library. It has a very convenient <em>is_pressed</em> member which returns true if corresponding key is down at the moment of calling. What’s left is to perform this check exactly at the moment when a key was pressed, that is — inside the function. Later we’ll know if the key was “c” then it’s a copy command, if “v” — paste, “o” — open, “n” with “ctrl” and “shift” pressed means that I will be searching for a present for my wife and I don’t want ads to pop out constantly, spoiling the surprise.<br>Anyway, same can be done with “shift”, “alt” and so on.</p><p>Now it’s time for us to speak about something important: security. Since we’ll be uploading this data later to internet, I don’t want anyone to see that I’m pressing 1 2 3 4 5 6 combination (not a password) or Ctrl + Shift + N several times a day. <br>Also I don’t want to expose what exact software I’m using, what websites do I open and when. Therefore I chose to limit the scope of the data that is collected to: only several applications (others will be aggregated to “other”, this will be eventually done for mouse listener as well) and writing only syllables events keyboard block + copy and paste actions.</p><p>Eventually our code will look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbc08299b114f7e2f352c360774283ec/href">https://medium.com/media/dbc08299b114f7e2f352c360774283ec/href</a></iframe><p>In line 16 you’ll see the condition which will limit the scope of tracked data to syllables or C or V keys but only if Ctrl was down. We will send information about if Shift or Ctrl was down at the moment of pressing the key, just for robustness. Then there goes the current timestamp and Active Window.</p><p>You can see that in <strong>map_apps</strong> function I used regex to spot if the current application window title is in the list that I’m willing to share with everyone. Otherwise it will be renamed to “Other”. <br>Regex can be very hard to understand sometimes, but once you work with it sufficiently, you’ll be able to construct complex patterns and deal with text in no time.</p><h4>“Deployment” and Execution</h4><p>You know why I love Python ? It’s because you don’t need to think about meaning of life for like 1, while stuff compiles, and then get a compile error. If somebody says that compiled languages are safer and you can compile Python code as well,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*nRw_zJjkkiKeeHAMsXxBiA.png" /></figure><p>Nevermind, you have the .py file now, and we need to run it and make it work on background, because we don’t need the command line window, and we can accidentally close it. <br>Usually if you have Python installed on your Windows machine, double clicking on a .py file, the <strong>python.ex</strong>e executable will launch pointing to your file, but then the command line window will be visible. There’s also another executable file <strong>pythonw.exe </strong>which does approximately the same as python.exe but without showing any UI output. More good news is that there’s already a file type associated with pythonw.exe, it is .pyw. So the only thing we need to do is to rename our .py file to a .pyw file !</p><p>Beware! Launching in background mode first of all means that we won’t see if the program works or it has exited due to some error or something, so be sure to properly test your code. <br>Second, to close the service, you’ll need to do it from task manager. Or you can add a handle in your code that if, for example, Ctrl + Alt + 9 is pressed, the process will exit. But I’ll leave it to you.</p><p>And that’s all for this one! We’re not exactly over with the data producer, since we still need to <strong>send</strong> the code to somewhere but that’s only a few lines which we’ll discuss in the next part: Setting Up a Google Cloud Project. So stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f104980271ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s do some Data Engineering or “How hard do I work”: Part 1 — Introduction]]></title>
            <link>https://medium.com/@arikshtein2/lets-do-some-data-engineering-or-how-hard-do-i-work-part-1-introduction-972213ef97b8?source=rss-1c08677dfe2f------2</link>
            <guid isPermaLink="false">https://medium.com/p/972213ef97b8</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Arikshtein]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 09:34:32 GMT</pubDate>
            <atom:updated>2019-06-27T09:34:32.539Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s do some Data Engineering or “How hard do I work”: Part 1 — Introduction</h3><p>With recent rise of Data Science profession and Artificial Intelligence technologies, Data itself is becoming more and more popular. Alongside with problems like “How to detect an obstacle on the street in real-time ?” or “What product to propose to the customer”, some other ones, not directly related to Data Science, emerge as well like “Where do we store the data and in what format ?”. Earlier these questions were all addressed to Database Administrators, but later a Data Engineer discipline began to gain popularity. It is hard to give a strict answer to “well, what’s the difference ?” because just like Data Scientist is an extremely broad profession, so is Data Engineer. I would personally go for the following explanation: <strong>Usually </strong>Data Engineer’s responsibility is wider, since he works with several environments which directly or indirectly relate to some data, while DB Administrator usually works with single type of database and struggles on maintaining and optimizing it.</p><p>Data Engineer may be assigned to be in charge of the whole data process (maybe except analytics, but sometimes even that) starting from <strong>gathering</strong> or <strong>collecting</strong> data being it a push (where somebody <strong>sends</strong> you the data, and you have to collect it) or pull process (where the data is <strong>stored </strong>somewhere, and you have to gather it), then validating it, storing it, transforming and adapting to the business requirements, implementing data access policies, even visualizing, plus automation, backup, monitoring, scheduling, choosing tech stack, and the list goes on.</p><p>In this article I’ll try to cover a little the most important parts, to give a high level understanding of what a simple data flow may look like. Since there are a plenty of articles and courses on topics like “<a href="https://towardsdatascience.com/streaming-twitter-data-into-a-mysql-database-d62a02b050d6">How to get Twitter data into MySQL</a>”, I designed something new, which, hopefully, you’ll be personally interested in to see the results. <br>Imagine we want a real-time dashboard, to tell us about how keyboard/mouse intensive our day in front of our laptops is. To make that happen we need at least 3 components: a keyboard&amp;mouse listener, and data storage and visualization environments. Theoretically we could create these 3 in a single Jupyter notebook, but the problem with it is that you can’t really show it to anyone. We rather need a solution on some server to be up and running 24/7, accessible for anyone with just a browser, with minimal maintenance, and, of course, completely <strong>free</strong>.</p><p>It may sound a bit unrealistic at first, but in era of open-source and cloud computing, we can make it happen using the following flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*Bn6iuZP7rR17ymRE9NbIdA.png" /></figure><ol><li>First we need the data from keyboard and mouse as a stream (since typing and clicking is regarded as a continuous endless process). There will be a code in next part of the story which is responsible for listening to keyboard and mouse on the background and sending events in small json format to…</li><li>…a message broker. These are distributed systems that act as a temporary storage for our data and forward it to one or more destinations. But why not upload the data into database directly ? Well, there’re several reasons for that, which are summarized <a href="https://stackoverflow.com/questions/13005410/why-do-we-need-message-brokers-like-rabbitmq-over-a-database-like-postgresql">here</a> but in two words this is to be sure that we don’t loose any data (but not only).<br>I will go with Google Pub Sub since it is included in <a href="https://cloud.google.com/free/">free tier</a> of Google Cloud Platform, but there many alternatives as well.</li><li>As said, message broker is just a temporary storage for our data. We need to store it somewhere after all. No, this won’t be MySQL or any other SQL because of two main reasons: SQL databases usually don’t scale well, and are usually made for mutable data (while we’ll be storing log of events, as is). Elasticsearch, in contrast, is very good at working with logs, is fast and distributed. <br>We’ll also write a simple transfer program on Python to transfer data from our message broker to database.</li><li>Grafana is a nice tool for visualizing real-time data. It has a pleasant UI which helps both during setup and viewing. We’ll see what our keyboard/mouse activity looks like nearly at the moment we press something or perform a click. <br>Grafana does not need to be distributed because it does not execute much computation, all is left to the database that we choose to connect.</li></ol><p>If you didn’t catch up with all of these, don’t worry, everything will be covered in more details in next parts.</p><h4>Why distributed matters ?</h4><p>You probably noticed me mentioning “<strong>distributed</strong>” word a lot: <br>Even though our project is small and we’ll collect, store and visualize data from one client, we need to look forward to (imagine) a bigger use case: what if we have 1000 clients ? What if we decide to gather more data ? What if we need to keep 5 year history of everything ? If these questions are not addressed at the beginning of the project, they will be addressed later, but they will be much more painful to address. Uber <a href="https://use-the-index-luke.com/blog/2016-07-29/on-ubers-choice-of-databases">switched their main database 2 times</a> because of b̶a̶d̶ ̶p̶l̶a̶n̶n̶i̶n̶g̶ unforeseen limitations, which, I suppose, costed them a lot.</p><p>Let’s imagine that in 5 years our project has grown and now our environment includes more elements, like data from various devices, also 3rd party API’s, a Web Application for customers, a Machine Learning engine and a central database that serve the Web Application, Business Intelligence tool which is used by analysts for historical and forecast data (from ML engine)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*gNRL7ZvVP2kYLlopzTBahg.png" /><figcaption>Our project in 5 years</figcaption></figure><p>First thing to notice is that our initial flow is left untouched. Even though we significantly increased the project’s scope and the volume &amp; variety of the data that is processed, it is still capable of serving its purpose because all 3 components (message broker, data ingestion block, and Elasticsearch) are scalable, which means by adding more machines to any of the blocks will result in higher throughput and even increased performance (at some extend of course).</p><p>Second point, distributed systems are made to be <strong>generally</strong> <strong>available</strong> which means each block consists of several cooperating machines and (if set up correctly) failure of one or more machines (depending on total number of machines in block), the system will continue to operate and users won’t even know. Of course this will result in increased load on rest of the machines, but when the crashed ones come back, everything will be back to normal automatically. Shortly speaking we don’t have any <strong>single points of failure</strong>.</p><p>Third point, distributed systems use maximum benefits of <strong>parallel operations</strong>, which means that each machine will be responsible for its own small piece of problem, which will be solved in parallel to others. It’s close to a <strong>divide and conquer</strong> approach and years of software development practice proves that many weak machines working on parallel is always better than 1 fast machine working alone. For the later case you must fine-tune your code to be sure that all the 24 CPU cores are equally busy, no bottlenecks occur, you’ve got ideal memory management, failures are handled gracefully and so on: hell. I’ve seen many <a href="https://medium.com/@glmdev/building-a-raspberry-pi-cluster-784f0df9afbd">clusters of Raspberry Pi Zero</a>-s which may give better budget-to-performance rate than most of single machine stations.</p><p>In this article I have presented you a primitive data-related project, which a Data Engineer may deal with. I have not gone through specific software, which I will do in the next parts, but rather tried to describe the concepts. In next parts we’ll go in details in each block, learn about each technology, see how it works. We’ll set up a Google Cloud project, deploy a virtual machine with real IP, do some python coding, use command line, get to know Docker and many more, so off we go !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=972213ef97b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>