<?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 Pshanarat on Medium]]></title>
        <description><![CDATA[Stories by Pshanarat on Medium]]></description>
        <link>https://medium.com/@pshanarat?source=rss-4f8ecf8208d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DY3cuZmHGT-tHlSL</url>
            <title>Stories by Pshanarat on Medium</title>
            <link>https://medium.com/@pshanarat?source=rss-4f8ecf8208d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:35:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pshanarat/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[TTS (text-to-speech) Streaming with chunk encoding | a technique used by OpenAI]]></title>
            <link>https://medium.com/@pshanarat/tts-text-to-speech-streaming-with-chunk-encoding-a-technique-used-by-openai-4852458f7270?source=rss-4f8ecf8208d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4852458f7270</guid>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[stream-speech]]></category>
            <category><![CDATA[tts]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chunk-encoding]]></category>
            <dc:creator><![CDATA[Pshanarat]]></dc:creator>
            <pubDate>Sat, 13 Jul 2024 05:16:53 GMT</pubDate>
            <atom:updated>2024-07-13T05:16:53.981Z</atom:updated>
            <content:encoded><![CDATA[<p>In voice-based applications, streaming speech from the text in real-time is a common use case. This technique is used in various applications, including voice-based customer service, medical history narration, chatbots, and more.</p><p>Implementing this in real-time applications poses significant challenges. In this brief paper, we will discuss a method developed by OpenAI known as chunk-encoding. This method processes chunks of text and plays them using an in-memory temporary file, allowing speech to begin before the entire text is processed by the TTS model. This approach is particularly effective for handling large texts. For more details, please refer to the OpenAI documentation linked here: <a href="https://platform.openai.com/docs/guides/text-to-speech">link</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*n2ViFRKaCiVGOR_7vx2ZaA.png" /><figcaption>Figure 1.1: Chunk-encoding</figcaption></figure><p>I have used the same technique for an open-source TTS model <a href="https://pypi.org/project/gTTS/">gTTS </a>. GTTS is (<em>Google Text-to-Speech</em>), a Python library and CLI tool to interface with Google Translate’s text-to-speech API. Hopefully, it gave better results for large texts.</p><pre>from gtts import gTTS<br>from pydub import AudioSegment<br>from pydub.playback import play<br>from io import BytesIO<br><br>def speak_chunk_byte(chunk):<br>    tts = gTTS(text=chunk, lang=&#39;en&#39;, tld=&#39;co.uk&#39;, slow=False)<br>    with BytesIO() as fp:<br>        tts.write_to_fp(fp)<br>        fp.seek(0)<br>        audio = AudioSegment.from_file(fp, format=&quot;mp3&quot;)<br>        play(audio)<br><br>def chunked_speak_bytefile(text, chunk_size=50):<br>    words = text.split()<br>    chunks = [&#39; &#39;.join(words[i:i + chunk_size]) for i in range(0, len(words), chunk_size)] <br>    for chunk in chunks:<br>        speak_chunk_byte(chunk)<br>        <br>if __name__ == &quot;__main__&quot;:<br>    text = &quot;Large text&quot; #Please provide a large text<br>    chunked_speak_bytefile(text, chunk_size=50)</pre><p>Please note that this might not be the most optimized solution and the idea can be valuable for any TTS-related implementation. Also, please note that to run the above code you need to have gTTS and<a href="https://pypi.org/project/pydub/"> pydub</a> python packages (pip install &lt;package&gt;)installed and <a href="https://ffmpeg.org/download.html">ffmpeg</a> must be available in your environment.</p><p><strong>References:</strong></p><ol><li>OpenAI documentation: <a href="https://platform.openai.com/docs/guides/text-to-speech">https://platform.openai.com/docs/guides/text-to-speech</a></li></ol><p>2. Chunk Encoding: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4852458f7270" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What does Next.js have That React doesn’t?]]></title>
            <link>https://medium.com/@pshanarat/what-does-next-js-have-that-react-doesnt-0a240a0e2441?source=rss-4f8ecf8208d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a240a0e2441</guid>
            <dc:creator><![CDATA[Pshanarat]]></dc:creator>
            <pubDate>Sun, 12 May 2024 14:08:11 GMT</pubDate>
            <atom:updated>2024-05-12T15:45:57.924Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*W-DWnWVdT5oCDcM8" /></figure><p>Let’s first dive into <strong>What is Next.js</strong>?</p><p>Developed by <strong>Vercel</strong>, <a href="https://nextjs.org/">Next.js</a> is an open-source JavaScript framework that empowers developers to craft rapid and intuitive web applications and static websites using React. Built upon Node.js and Babel, it seamlessly integrates with React for the creation of Single Page Applications, streamlining server-side operations for convenience and efficiency, a JavaScript framework, that facilitates the creation of lightning-fast static websites and web applications with React. As an open-source and lightweight framework, Next.js is tailored for React applications, offering the capability for server-side rendering.</p><p>In 2013, Facebook unveiled React, a revolutionary web development framework. However, by 2023, the official React documentation advises against utilizing plain React and recommends employing the Next.js framework instead, known for its performance optimization and server-side rendering capabilities. This article will delve into the primary distinctions between Next.js and React.</p><p>The primary alterations observed in Next.js include:</p><h3><strong>Simplified development processes</strong></h3><p>The primary distinction between Next.js and React.js lies in their performance.</p><p>In the case of Next.js applications, their exceptional speed stems from static routing and server-side rendering. Complemented by various performance-enhancing features like Image Optimization, they offer swift and efficient user experiences.</p><p>Opting for Next.js for your project grants you automatic <strong>server rendering</strong> and <strong>code-splitting</strong>, thereby boosting development efficiency. Additionally, server-side rendering significantly contributes to superior application performance.</p><p>Conversely, when discussing React, certain limitations emerge. It predominantly supports <strong>client-side rendering</strong>, which may not suffice for high-performance application development.</p><p>When considering another aspect, Server-Side Rendering, Next.js provides robust support. It actively gathers data and renders each request whenever a different view is required for diverse users.</p><p>In contrast, React doesn’t inherently support server-side rendering, though it can be enabled with additional effort. Integrating SSR with your chosen server and configuration requires extra steps, and there’s a possibility that future versions may not prioritize or fully support this feature.</p><h3>Next JS vs React: Developer Community</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*l6gzTR8qyLGfODbw" /></figure><h3>Advantages of Next.js</h3><p><strong>Rapid Development</strong></p><p>Next.js provides a plethora of built-in components, libraries, and compatibility features, enabling rapid development of minimum viable products (MVPs). This facilitates swift user reviews and feedback, allowing for timely adjustments without any loss of time.</p><p><strong>SEO</strong></p><p>As Next.js facilitates the creation of faster and more lightweight static websites, they inherently become SEO-friendly. Consequently, there’s a greater likelihood of your website ranking on the first pages of search engines.</p><p><strong>Super Fast Rendering</strong></p><p>Changes made are instantly visible upon reloading the website, allowing real-time rendering of components and easy tracking of alterations as they happen.</p><p><strong>Built-in CSS</strong></p><p>In Next.js, importing CSS styles from a JavaScript file speeds up rendering.</p><p><strong>Image Optimization</strong></p><p>Images are automatically scaled and served in the optimal WebP format, adjusting seamlessly to fit smaller viewports.</p><p><strong>ESLint Support</strong></p><p>With Next.js, integrating ESLint is simple for developers using the following script: `”lint”: “next lint”`.</p><p>Next.js documentation: <a href="https://nextjs.org/docs">https://nextjs.org/docs</a></p><h3>Disadvantages of Next.js</h3><p>Challenges with Next.js include its routing system, which relies on a file-based approach that may not suffice for certain project requirements. This necessitates developers to be proficient in utilizing Node.js tools to establish dynamic routes effectively. Additionally, while the developer community for Next.js is smaller in comparison to React, it’s steadily expanding. Although finding experienced Next.js developers might be limited, the growing demand for Next.js proficiency presents ample opportunities for individuals seeking to distinguish themselves in the competitive development landscape.</p><h3>Advantages and Disadvantages of React</h3><p>React brings numerous advantages, including ease of development, thanks to its JavaScript-based approach, reducing codebase for dynamic app creation. Its vast developer community ensures swift support and abundant learning resources. React components are highly reusable, facilitating consistent updates across multiple pages.</p><p>Moreover, React’s features can be extended through tools like Redux. However, React’s reliance on additional tools for optimal functionality and the rapid evolution of its documentation poses challenges. On the other hand, Next.js simplifies coding compared to React, requiring less code for implementation. While React suits large, data-driven web applications, Next.js shines in the static website and JAMstack development.</p><h3>What to choose?</h3><p>Ultimately, the choice between Next.js and React depends on project requirements and preferences, with Next.js excelling in server-side rendering and static site creation, while React specializes in interactive user interface development. Both frameworks have their merits, and choosing the right one hinges on understanding their strengths and aligning them with project goals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a240a0e2441" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement a dockerized Django Application with Redis, Celery, and PostgreSQL]]></title>
            <link>https://medium.com/@pshanarat/implement-a-dockerized-django-application-with-redis-celery-and-postgresql-9acd23e3c54c?source=rss-4f8ecf8208d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9acd23e3c54c</guid>
            <dc:creator><![CDATA[Pshanarat]]></dc:creator>
            <pubDate>Sun, 18 Jun 2023 13:38:37 GMT</pubDate>
            <atom:updated>2023-06-18T13:38:37.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*5Svce7CBNG5eD9LypQJrCA.png" /></figure><p><a href="https://redis.io/docs/"><strong>Redis</strong></a> and <a href="https://docs.celeryq.dev/en/stable/"><strong>Celery</strong></a> are two popular tools used in building scalable and distributed systems, particularly in the context of web applications.</p><p>1. <a href="https://redis.io/docs/"><strong>Redis</strong></a>: <a href="https://redis.io/docs/"><strong>Redis</strong></a> is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It provides fast data access and supports a wide range of data structures such as strings, hashes, lists, sets, and more. Redis is often used for caching frequently accessed data to improve the performance of web applications.</p><p><a href="https://redis.io/docs/"><strong>Redis</strong></a> is particularly useful in scenarios where quick read and write operations are required, and the data can be stored temporarily in memory rather than being persisted to disk. It can store millions of key-value pairs in memory and allows for high-speed data retrieval, making it well-suited for tasks such as session storage, real-time analytics, leaderboards, and pub/sub messaging.</p><p>2. <a href="https://docs.celeryq.dev/en/stable/"><strong>Celery</strong></a>: <a href="https://docs.celeryq.dev/en/stable/"><strong>Celery</strong></a> is a distributed task queue system that is used for background processing and asynchronous task scheduling. It allows you to offload time-consuming or resource-intensive tasks from the main application flow to be executed separately. Celery is typically used in combination with a message broker like Redis to distribute tasks across multiple workers or worker processes.</p><p><a href="https://docs.celeryq.dev/en/stable/"><strong>Celery</strong></a> follows a producer-consumer model, where tasks are generated by the application (producer) and placed into a message queue (broker). The workers (consumers) then pick up tasks from the queue, process them independently, and provide the results. This asynchronous approach helps to improve the <strong>responsiveness</strong> and <strong>scalability</strong> of web applications by handling resource-intensive tasks in the background.</p><p>By using Redis as the message broker for Celery, you can leverage the efficient pub/sub capabilities of Redis and benefit from its ability to handle a large number of concurrent tasks efficiently. Redis acts as the intermediary between the application and Celery, ensuring reliable message delivery and task management.</p><p>Overall, Redis and Celery are powerful tools that can enhance the performance, scalability, and responsiveness of web applications by providing efficient data storage and distributed task processing capabilities, respectively.</p><p>To start with an application with the benefit of both worlds. We can use docker so these services work independently and are easy to deploy.</p><p>I have created a code repository in Github which can be downloaded via the l<a href="https://github.com/prasan93/celery_redis-app">ink.</a></p><p>To start a Dockerized app, you’ll need to follow these general steps:</p><p><strong>Install Docker:</strong> Before you begin, you’ll need to install Docker on your machine. Docker provides platform-independent containers that encapsulate your application and its dependencies. You can download Docker from the official website (<a href="https://www.docker.com/">https://www.docker.com/</a>) and follow the installation instructions for your specific operating system.</p><p><strong>Build your Docker image:</strong> Docker images are the building blocks of containers. You need to create a Dockerfile, which is a text file that contains instructions for building the image. In the Dockerfile, you define the base image, copy your application code into the image, specify dependencies, and configure the container. Once you have your Dockerfile ready, you can build the image using the following command in your terminal or command prompt:</p><ol><li>Let’s then create a virtual environment.</li></ol><pre># (linux)<br>python -m venv virtual-environment </pre><pre># (windows)<br>virtualenv venv </pre><p>2. Start the virtual environment</p><pre># (linux)<br>source venv/bin/activate</pre><pre>venv\Scripts\activate</pre><p>3. Install Django, redis and celery dependencies</p><pre>pip install Django</pre><pre>pip install celery</pre><pre>pip install redis</pre><p>4.1 Install Django and start a new project followed by a new app</p><pre>django-admin startproject celery_redis_app</pre><p>5.1 Then go into the project folder.</p><pre>cd celery_redis_app</pre><p>5.2 Start a Django app</p><pre>python manage.py startapp app</pre><p>6. Run the server</p><pre>python manage.py runserver</pre><p><strong>(make sure to migrate your database changes using “python manage.py makemigrations” and “python manage.py migrate”)</strong></p><p>7. Place the Dockerfile and the docker-compose.yaml file in the project directory.</p><p>#Dockerfile</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*4uUtJuAWujt0y6xZAiXH0A.png" /><figcaption>fig 1.1 : Dockerfile in the directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*JW7vZRLqfRvh8cpioQCHTw.png" /><figcaption>fig 1.2 : Dockerfile</figcaption></figure><p>#docker-compose.yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*VW3111WAdmjkW_gqYsjM8Q.png" /><figcaption>fig 1.3 : docker-compose.yaml file directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*obgHOWd6B9oLoET4a4EkuA.png" /></figure><p>Here I have created a docker file to install containers of postgres, redis, and celery using docker.</p><p>The given Dockerfile code does the following:</p><p>- It starts with a base image of Python version 3, which will serve as the foundation for the Docker image.</p><p>- It sets an environment variable called PYTHONBUFFERED to 1. This variable ensures that Python’s standard output is immediately flushed to the console, allowing for real-time logging and debugging.</p><p>- It sets the working directory to “/usr/app/”. This will be the location where the subsequent commands will be executed.</p><p>- It copies the “requirements.txt” file from the local directory (the same directory as the Dockerfile) to the “/usr/app/” directory in the Docker image. The requirements.txt file typically contains a list of Python packages or dependencies required for the application.</p><p>- It runs the command “pip install -r requirements.txt” to install the Python dependencies specified in the requirements.txt file. The “-r” flag tells pip to read the requirements from a file.</p><p>In summary, this Dockerfile sets up a Docker image based on Python 3, sets the working directory, copies the requirements.txt file into the image, and installs the required Python dependencies.</p><p>The given <strong>docker-compose.yaml</strong> file defines a multi-container application using Docker Compose. Here’s a summary of what it does:</p><p>- It specifies the version of Docker Compose to use as “1.0.0”.</p><p>- It defines three services: “pgdb”, “redis”, and “celery”.</p><p>- The “pgdb” service uses the “postgres” image, sets environment variables for the PostgreSQL database (database name, username, and password), and creates a volume called “pgdata” to store the database data.</p><p>- The “redis” service uses the “redis:alpine” image and assigns it a container name.</p><p>- The “celery” service builds an image using the current directory as the build context. It restarts the container automatically, runs the command “celery -A celery-redis-app worker -l INFO” to start the Celery worker, mounts the current directory as a volume in the container, sets environment variables for the Celery broker and backend (both using Redis), assigns it a container name, and specifies that it depends on the “redis” and “pgdb” services.</p><p>- The “volumes” section defines the “pgdata” volume that is used by the “pgdb” service to store the PostgreSQL database data.</p><p>In summary, this docker-compose.yaml file sets up three services: a PostgreSQL database, a Redis server, and a Celery worker. It links them together by specifying their dependencies and configurations, allowing them to work together as a multi-container application.</p><p>Alpine: Alpine is a lightweight Linux distribution that is known for its small size and minimalistic approach. It is designed to be resource-efficient and has a small footprint. Using the Alpine variant of an image can significantly reduce the overall image size and optimize resource usage.</p><p>Combining Redis with the Alpine variant of the image allows for a more lightweight and efficient deployment. Since Redis is primarily focused on in-memory data storage and processing, using a lightweight image like Alpine helps minimize the container’s resource requirements and reduces the time and space needed for image deployment and distribution.</p><p>By choosing “redis:alpine,” the Docker image will be smaller and consume fewer resources compared to a non-Alpine-based image, making it a suitable choice for resource-constrained environments or deployments where optimizing resource usage is a priority.</p><p>8. Include the Python dependencies given below, inside the requirements.txt file and include it in your project directory.</p><pre>amqp==5.1.1<br>asgiref==3.7.2<br>billiard==3.6.4.0<br>celery==5.2.7<br>click==8.1.3<br>click-didyoumean==0.3.0<br>click-plugins==1.1.1<br>click-repl==0.2.0<br>Django==4.2.1<br>django-environ==0.10.0<br>kombu==5.2.4<br>prompt-toolkit==3.0.38<br>psycopg2-binary==2.9.6<br>pytz==2023.3<br>redis==4.5<br>six==1.16.0<br>sqlparse==0.4.4<br>typing_extensions==4.6.2<br>vine==5.0.0<br>wcwidth==0.2.6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*MpKXSe0oTG_RQgszCisJ7g.png" /><figcaption>fig 1.5: requirements.txt file</figcaption></figure><p>9. Set the broker URL in celery to <strong>celery_brocker_url</strong> in settings.py in Django.</p><pre>CELERY_BROKER_URL=&quot;redis://redis:6379/0&quot;</pre><p>10. Set the Django database parameters in settings.py. We have defined these parameters for Postgres in the docker-compose file.</p><pre>DATABASES = {<br>    &quot;default&quot;: {<br>        &#39;ENGINE&#39;: &#39;django.db.backends.postgresql&#39;,<br>        &#39;NAME&#39;: os.environ.get(&quot;DB_NAME&quot;, &quot;postgres&quot;),<br>        &#39;USER&#39;: os.environ.get(&quot;DB_USER&quot;, &quot;postgres&quot;),<br>        &#39;PASSWORD&#39;: os.environ.get(&quot;DB_PASSWORD&quot;, &quot;postgres&quot;),<br>        &#39;HOST&#39;: os.environ.get(&quot;DB_HOST&quot;, &quot;localhost&quot;),<br>        &#39;PORT&#39;: os.environ.get(&quot;DB_PORT&quot;, &quot;5432&quot;),<br>    }<br>}</pre><p>11. Include the celery.py under the directory of Django project directory for celery_redis_app</p><pre>import os<br><br>from celery import Celery<br><br># Set the default Django settings module for the &#39;celery&#39; program.<br>os.environ.setdefault(&#39;DJANGO_SETTINGS_MODULE&#39;, &#39;celery_redis_app.settings&#39;)<br><br>app = Celery(&#39;celery_redis_app&#39;)<br><br># Using a string here means the worker doesn&#39;t have to serialize<br># the configuration object to child processes.<br># - namespace=&#39;CELERY&#39; means all celery-related configuration keys<br>#   should have a `CELERY_` prefix.<br>app.config_from_object(&#39;django.conf:settings&#39;, namespace=&#39;CELERY&#39;)<br>#<br># Load task modules from all registered Django apps.<br>app.autodiscover_tasks()<br><br><br>@app.task(bind=True, ignore_result=True)<br>def debug_task(self):<br>    print(f&#39;Request: {self.request!r}&#39;)</pre><p>12. Include the following under __init__.py</p><pre># This will make sure the app is always imported when<br># Django starts so that shared_task will use this app.<br>from .celery import app as celery_app<br><br>__all__ = (&#39;celery_app&#39;,)</pre><p>13. Under the directory of the Django app named “app”, include the task.py with the following code.</p><pre>from celery import shared_task<br><br><br>@shared_task<br>def add(x,y):<br>    return x + y</pre><p>14. Build the docker image</p><pre>docker-compose build</pre><p>15. Run the docker image</p><pre>docker-compose up</pre><p>16.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sNfsvD_bn__jvl4Q3nB0sw.png" /></figure><p>Mail me for any information: <strong>prasanratnayakeofficial@gmail.com</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9acd23e3c54c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Superset in Production | by Prasan]]></title>
            <link>https://medium.com/@pshanarat/apache-superset-in-production-24c00e5d9146?source=rss-4f8ecf8208d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/24c00e5d9146</guid>
            <dc:creator><![CDATA[Pshanarat]]></dc:creator>
            <pubDate>Mon, 22 May 2023 13:26:41 GMT</pubDate>
            <atom:updated>2023-05-22T13:30:31.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Apache Superset in Production | by Prasan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*VORW8TCMrZUr35k5Nd_9Hw.png" /></figure><h3>1. Why superset?</h3><p>Ever dreamed of an open-source BI tool that has a much simpler learning curve than Tableau? Then you might find Apache Superset amusing to start with. It is an individual project developed by <strong>Maxime Beauchemin</strong> who recently joined <strong>Lyft</strong> as a Software Engineer after some time at <strong>Airbnb</strong>. As a data engineer, he develops tools to help streamline and automate data-engineering processes and he is known as a creator and lead technician for software, Apache Airflow, and Apache Superset.</p><p>Apache Superset is a novel, enterprise-ready data exploration tool and visualization tool which is fast, lightweight, intuitive, and loaded with options that make it available for users of all skill sets to explore and visualize petabytes of data, from simple pie charts to highly sophisticated geospatial charts. The latest stable version of superset 2.0.0 was released on July 15th, 2022, and was written in Python and typescript. It uses MySQL, Postgres, and SQLite as its backend.</p><p>Even though Tableau is a feature-rich and high-performing business intelligence tool, a superset is easy to get started with. It has attracted companies like Dropbox, Airbnb, American Express, Lyft, Nielsen, Rakuten Viki, Twitter, and Udemy among others. Dropbox has even posted a<a href="https://dropbox.tech/application/why-we-chose-apache-superset-as-our-data-exploration-platform"> blog article on why they use Apace Superset</a> as their data exploration platform since 2020.</p><h3>2. Deploying superset</h3><p>For getting started, let’s see how we are able to deploy superset on an EC2 instance on AWS with <a href="https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/">docker-compose</a> and <a href="https://gist.github.com/philippkeller/dedd0ee8221f4b155592149d08a26248">from scratch</a>. As prerequisites for installation, it is important to keep in mind that if you are planning to deploy Apache superset on an EC2 instance, the RAM should be at least larger than 6GB, and therefore t2.large is preferable. The storage should be at least 20GB.</p><ol><li>Docker-compose installation</li></ol><p>To get started, create an EC2 instance and install docker-compose as per the instructions stated in this <a href="https://docs.docker.com/engine/install/ubuntu/">document</a>. The document has given instructions specifically for an Ubuntu instance while you can refer to other installations based on the Linux version you have installed on the instance. Mac OS machines can refer to this <a href="https://docs.docker.com/desktop/install/mac-install/">document</a> for this task.</p><p>After the successful installation of docker-compose run the following commands to get started with Apache Superset:</p><p>Step 01: SSH into the instance by using pem key</p><p>Step 02: <a href="https://github.com/apache/superset">Clone Superset’s repo</a> in your terminal with the following command:</p><p>git clone <a href="https://github.com/apache/superset.git">https://github.com/apache/superset.git</a></p><p>Step 03: Navigate into the superset folder</p><p>cd superset</p><p>Step 04: Launch superset via Docker-compose</p><p>docker-compose -f docker-compose-non-dev.yml pull</p><p>docker-compose -f docker-compose-non-dev.yml up</p><p>Once all seems perfect you should be able to log in using the 8088 port and the IP address of the EC2 instance. Use username: admin and password: admin to log in.</p><p>Note: This will bring up superset in a non-dev mode, changes to the codebase will not be reflected. If you would like to run superset in dev mode to test local changes, simply replace the previous command with: docker-compose up, and wait for the superset_node container to finish building the assets.</p><ol><li>From Scratch</li></ol><p>Please refer to the official <a href="https://superset.apache.org/docs/installation/installing-superset-from-scratch/">documentation</a> to get started with Apache superset from scratch.</p><p>Be sure that you have installed python and facilitate a virtual environment in your instance.</p><p><strong>Step 01: Create a virtual environment</strong></p><p>pip install virtualenv</p><p><strong>Step 02: initiate the virtual environment</strong></p><p># virtualenv is shipped in Python 3.6+ as venv instead of pyvenv.</p><p># See <a href="https://docs.python.org/3.6/library/venv.html">https://docs.python.org/3.6/library/venv.html</a></p><p>python3 -m venv venv</p><p>. venv/bin/activate</p><p><strong>Step 03: install apache superset using pip</strong></p><p># Here we name the virtual env ‘superset’</p><p>pyenv virtualenv superset</p><p>pyenv activate superset</p><p>Or with pyenv-virtualenv:</p><p><strong>Step 04: install apache-superset</strong></p><p>pip install apache-superset</p><p><strong>Step 05: Initialize the database</strong></p><p>superset db upgrade</p><p><strong>Step 06: Finish the installation using the following commands.</strong></p><p># Create an admin user in your metadata database (use `admin` as username to be able to load the examples)</p><p>export FLASK_APP=superset</p><p>superset fab create-admin</p><p># Load some data to play with</p><p>superset load_examples</p><p># Create default roles and permissions</p><p>superset init</p><p><strong>Step 07: If all odds are in your favor, start the superset portal on localhost: 8088 port</strong></p><p># To start a development web server on port 8088, use -p to bind to another port</p><p>superset run -p 8088 — with-threads — reload — debugger</p><h3>3. Pros and Cons</h3><p>Under pros and cons, we will be discussing on some intriguing points which might help you understand the availability of Apache-Superset for your personalized use case.</p><p>Apache superset is an open-source software application that is lightweight, easy-to-install, largely scalable, and more focussed on complex queries. The main features of it can be listed as follows:</p><ul><li>Can process Big Data with all kinds of SQL databases</li><li>Supports interactive filtering</li><li>Development teams can modify the source code depending on the requirements</li><li>It offers a granular level security model which provides different access levels to users and row-level security which is a valuable security asset for start-ups and small businesses</li><li>Apache superset is free and it has a large online support community</li><li>Companies with an in-house data team and a high query load. It supports plenty of daily users (+600) viewing 100,000 charts.</li></ul><p>In spite of the main attractions, it has the following drawbacks.</p><ul><li>It does not support NoSQL databases</li><li>Users with poor SQL knowledge might find Apache Superset to be constrained</li><li>Need technical support to implement the setup</li><li>Multiple queries affect the performance of superset and multiple data tables can not be retrieved at the same time.</li></ul><p>A few of the other features would be</p><p>Support for popular data sources</p><p>Amazon DynamoDB, Amazon Redshift, Apache Drill, Apache Druid, Apache Hive,</p><p>Apache Impala,Ascend.io,Apache, Kylin,Apache Pinot,Apache Solr,Apache Spark SQL,</p><p>ClickHouse,CockroachDB,RisingWave,Dremio,Elasticsearch,Exasol,</p><p>Google BigQuery,Google Sheets,Hana,IBM DB2, IBM Netezza Performance Server,</p><p>MySQL,Oracle,Postgres,Presto,Snowflake,Microsoft SQL Server,</p><p>Teradata,TimescaleDB,Vertica,Hologres,Trino</p><p>Rockset,CrateDB,Databricks,Firebird,YugabyteDB,Firebolt.</p><p>Documentation for plugins: <a href="https://superset.apache.org/docs/databases/db-connection-ui/">link</a></p><p>Support for Real-time data visualizations</p><p>Apache superset can be integrated with OLTP, OLAP Data lakes, and Query Engines to display time-series data. reference — <a href="https://preset.io/blog/2021-4-26-real-time-analytics-in-superset/">link</a>.</p><p>Row-level security support</p><p>you can create filters that are assigned to a particular table, as well as a set of roles under row-level security.</p><p>For further reference: the <a href="https://superset.apache.org/docs/security/">link</a></p><p>Support for Mobile reporting</p><p>Superset in its current state is not designed for the mobile form factor</p><p>Frequent Data refresh support</p><p>Yes, it facilitates frequency data refresh</p><p>Drill-down/Drill-through/Filtering support</p><p><a href="https://github.com/apache/superset/issues/7512">https://github.com/apache/superset/issues/7512</a></p><p>Support various visual charts</p><p>It supports basic chart types and specific charts given below. For a detailed chart walkthrough please refer: <a href="https://docs.preset.io/docs/chart-walkthroughs">Chart Walkthroughs</a></p><ul><li><a href="https://preset.io/#funnel-chart">Funnel Chart</a></li><li><a href="https://preset.io/#force-directed-graph-chart">Force Directed Graph Chart</a></li><li><a href="https://preset.io/#circular-graph-chart">Circular Graph Chart</a></li><li><a href="https://preset.io/#mixed-timeseries-chart">Mixed Timeseries Chart</a></li><li><a href="https://preset.io/#gauge-chart">Gauge Chart</a></li><li><a href="https://preset.io/#radar-chart">Radar Chart</a></li><li><a href="https://preset.io/#tree-chart">Tree Chart</a></li><li><a href="https://preset.io/#pivot-table-v2">Pivot Table v2</a></li><li><a href="https://preset.io/#tree-map-v2">Tree Map v2</a></li></ul><p>Link: <a href="https://preset.io/blog/2021-6-14-superset-nine-new-charts/">Nine New ECharts And Superset Visualizations | Preset</a></p><p>Self-service BI</p><h3>4. References</h3><ul><li><a href="https://thestack.technology/top-apache-projects-in-2021-from-superset-to-nuttx/">Top 10 Apache projects in 2021, from Superset, to NuttX and Pulsar</a></li><li><a href="https://dropbox.tech/application/why-we-chose-apache-superset-as-our-data-exploration-platform">Why we chose Apache Superset as our data exploration platform — Dropbox</a></li><li><a href="https://hevodata.com/learn/apache-superset/">What is Apache Superset?: 3 Important Factors — Learn | Hevo</a></li><li><a href="https://superset.apache.org/docs/intro/">Introduction | Superset</a></li><li><a href="https://superset.apache.org/docs/installation/installing-superset-from-scratch/">Installing Superset from Scratch</a></li><li><a href="https://tech.urbancompany.com/apache-superset-setup-in-production-a8f4ae43b330">Apache Superset setup in production | by rajesh kumar | Urban Company — Engineering</a></li><li><a href="https://gist.github.com/philippkeller/dedd0ee8221f4b155592149d08a26248">Install superset on EC2 · GitHub</a></li><li><a href="https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/">Installing Superset Locally Using Docker Compose</a></li><li><a href="https://blog.dheerajinampudi.com/installing-superset-docker-on-an-ubuntu-16-04-ec2-instance-76bc160cf38f">Installing Superset docker on an Ubuntu 16.04 EC2 instance | by Dheeraj Inampudi | Medium</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*VORW8TCMrZUr35k5Nd_9Hw.png" /></figure><ul><li><a href="https://hub.docker.com/r/apache/superset">apache/superset — Docker Image</a></li><li><a href="https://blog.matrixpost.net/set-up-apache-superset-on-ubuntu-using-docker-compose/">Set up Apache Superset on Ubuntu using Docker Compose — .matrixpost.net</a></li><li><a href="https://trevor.io/blog/apache-superset-alternatives">8 Alternatives to Apache Superset That’ll Empower Start-ups and Small Businesses with BI</a></li><li><a href="https://preset.io/blog/2021-4-26-real-time-analytics-in-superset/">How Apache Superset™ Supports Real-Time Analytics | Preset</a></li><li><a href="https://www.dremio.com/resources/tutorials/adls-dremio-supserset/">Visualizing Azure Data Lake with Apache Superset and Dremio</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24c00e5d9146" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>