<?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 Nicolas Raynaud on Medium]]></title>
        <description><![CDATA[Stories by Nicolas Raynaud on Medium]]></description>
        <link>https://medium.com/@tekinico?source=rss-200d05ffe3b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Nicolas Raynaud on Medium</title>
            <link>https://medium.com/@tekinico?source=rss-200d05ffe3b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:29:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tekinico/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[Build a React Embeddable widget]]></title>
            <link>https://tekinico.medium.com/build-a-react-embeddable-widget-c46b7f7999d8?source=rss-200d05ffe3b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c46b7f7999d8</guid>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[parcel]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Nicolas Raynaud]]></dc:creator>
            <pubDate>Wed, 03 Feb 2021 16:46:35 GMT</pubDate>
            <atom:updated>2021-02-03T16:46:35.626Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*gOHbn2r9KlVO--lkhBN2Vw.jpeg" /></figure><p>Chances are, if you’re doing web applications, that you will at least once, come across a need where you want to embed some component in a website that you did not develop, or one that is in a different technology than your preferred stack. After all, web development is all about integration, and if you can’t create a component with a single responsibility principle and inject it anywhere, well ….. you should !</p><p>Like me, you like well built apps and websites, so the perspective of creating a pure javascript widget to inject html in the DOM by yourself is pure evil ! You can’t sleep at night thinking that you’ll have to use jQuery or reinvent the wheel by coding again some utils functions that npm packages have had in store for a decade...</p><p>Also, since you know <strong>React</strong> (or not, don’t leave just for that), you know that there might be a way to build a proper mini app that can instantiate in any website because, after all, that’s what a React app does. You just can’t put your finger on the right setup to do so !</p><p>Well, you’re in luck, there is a way ! Hopefully it will help you streamline your widget development, and hey, you might even enjoy doing it after that !</p><h3>What we’ll build</h3><p>I have chosen to create a widget that needs to consume an API to display some information. Nothing extraordinary, but just enough so that you can start to feel the interest of using React rather than coding it using jQuery…</p><p>We’ll create a widget displaying a stock price, because it seems like the trendy thing to do right now !</p><p>The widget will take the stock symbol as parameter and we need to be able to inject it several times in the same HTML page, either with the same, or other stock symbols.</p><p>This is what we’re looking to create :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*eYQ7HH57xvoLkmTyDC9nRg.png" /><figcaption>3 stock widgets in a page</figcaption></figure><h3>Create the a̶p̶p̶ widget</h3><p>As usual, a <strong>React</strong> app development starts with a <a href="https://create-react-app.dev/docs/getting-started/">create-react-app</a>, no surprise there :</p><pre>npx create-react-app my-widget<br>cd my-widget<br>npm install axios</pre><p>We’ll need a couple libs, because there is no limit to what one can do with a React app, and your widget could also be something bigger than just a quote !</p><p>At this point, you have a very working and very disturbingly empty and common React app.</p><h3>Change its initialization and injection</h3><p>Now, the fun begins. By default a React app instantiate itself automatically in a div named “root” as you can see in the default “index.js”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dfa12824fc5654bec7dcc132d9d8ed96/href">https://medium.com/media/dfa12824fc5654bec7dcc132d9d8ed96/href</a></iframe><p>But that does not help us much because :</p><ul><li>A <strong>div</strong> id=”root” is too common, you don’t know where your widget will be injected and, chances are, some other developper will have named something “root”.</li><li>We don’t have any control on input parameters or the fact that we want to render the app multiple times : here, it is impossible because it only identifies one div, and inject the app in the first it finds.</li></ul><p>So, we’ll need to help our widget find its home by changing it a little bit :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/533a12504564b2c24a870d1581ff6fc7/href">https://medium.com/media/533a12504564b2c24a870d1581ff6fc7/href</a></iframe><p>What we did here, is look for all divs identified by a class, and for each of them, inject a <strong>new instance</strong> of our widget. Also, look at <strong>div.dataset.symbol</strong>, this is an automatic shortcut to reference an element attribute identified by the prefix “data-”. This is what we’ll use to specify our stock symbol parameter. You can learn more about it <a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes">here</a>.</p><p>In dev, npm start will inject the React app in the <strong>public/index.html</strong>,<strong> </strong>so that is where we want to change things to see our app working again. We’ll remove :</p><pre>&lt;div id=&quot;root&quot;&gt;&lt;/div&gt;</pre><p>And replace it with :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7a2ed90bf002340a6c75699c7a6a4d5/href">https://medium.com/media/a7a2ed90bf002340a6c75699c7a6a4d5/href</a></iframe><p>Here, i have already created three widgets, each with a different parameter so that we’ll have several stock quotes displaying.</p><h3>Implement the feature</h3><p>That is not really the point of this blog post but this is still fun !</p><p>I’ll just need <a href="https://www.npmjs.com/package/axios">axios</a>, <a href="https://tailwindcss.com/">tailwindcss</a> and a REST API.</p><p>I chose <a href="https://marketstack.com/">MarketStack</a> for the finance API : they offer a free plan, with CORS compatible setup (so I can query the prices directly from the browser, not fighting with cross origin issues).</p><p><strong><em>Disclaimer</em></strong><em> : This, though, requires me to create an account with them and use an access key for each HTTP request. Bear in mind that this is </em><strong><em>not secure</em></strong><em>, as your access key will be available to whoever looks at network traffic from your widget. I chose this API for the sake of simplicity and because Yahoo Finance API does not allow cross domain requests.</em></p><p>Now let’s create a <strong>StockQuote</strong> component that will fetch and display the necessary data :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de8801146827d4c7c640f1c9fbb9a1e1/href">https://medium.com/media/de8801146827d4c7c640f1c9fbb9a1e1/href</a></iframe><p>Now we can put this widget in the App, passing it the symbol as a prop (remember, the symbol comes from the data attributes) :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3da86230865c2f2d0fb5be5ce25ed97/href">https://medium.com/media/a3da86230865c2f2d0fb5be5ce25ed97/href</a></iframe><h3>Build as a widget</h3><p>Now, our widget works well, but it is still a React App, and if we build our app using the standard command, we’ll just create a whole bunch of static files that do not make it an easily embeddable widget :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*YqPJtmPzUHCuuNdXweqOxw.png" /></figure><p>See all these static files ? That means, anyone wanting to embed the widget will need these 4 files. This is too much, I am sure we can do better.</p><p>We’ll need a bundler tool like (<a href="https://parceljs.org/getting_started.html">parcel</a>) to help us squash all this. (Note that many other bundler exist, i’m only using parcel because it is a one liner solution in my case) :</p><pre>npm install -D parcel-bundler</pre><p>Then we’ll create a new build script in package.json :</p><pre>...<br>&quot;scripts&quot;: {<br>  &quot;eject&quot;: &quot;react-scripts eject&quot;,<br>  &quot;start&quot;: &quot;craco start&quot;,<br>  &quot;build&quot;: &quot;craco build&quot;,<br>  &quot;test&quot;: &quot;craco test&quot;,<br>  <strong>&quot;build:widget&quot;: &quot;parcel build src/index.js --no-source-maps -d widget &amp;&amp; cp build/static/css/*.css widget/index.css&quot;</strong><br>},<br>...</pre><p>This new “<strong>build:widget</strong>” command will let parcel parse our app, and output it as a single <em>js</em> and a single <em>css</em> file in the “widget” directory. Here is the command being ran :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*mAmOaT6h8zEUVxgcS_oolg.png" /><figcaption>Output of parcel script is now just 2 files</figcaption></figure><blockquote>The only drawback from parcel, is that it does not automatically process my tailwind file. As a temporary fix, I rely on the processed css file from build/static/css and overwrite the one generated by parcel. Hence the subsequent <strong>copy</strong> command.</blockquote><p>And that’s it ! You can now import these 2 files anywhere and the widget will get instantiated automatically !</p><h3>Host it somewhere</h3><p>Now that you have your binary, should you want to embed it somewhere, you’ll need to host it so the html page in which you’d like to display it can fetch the <em>js</em> and <em>css </em>files easily.</p><h3>Embed your widget</h3><p>Now comes the rewarding moment, injecting your widget in your html !! Here is a sample code that will just do that :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1bb28e5a15366a05df3f07194605e539/href">https://medium.com/media/1bb28e5a15366a05df3f07194605e539/href</a></iframe><p>Notice how we only need to import the js and css resources <strong>once.</strong> This is because when the script is loaded, it will automatically loop through all html elements with class “nicoraynaud-finance-widget” and inject an instance of the widget inside. So, be careful not to import it several times.</p><p>I also recommend importing these scripts at the end of the page, to avoid blocking your content with these resources. Once they are downloaded and the js script ran, widget will automatically appear.</p><h3>Conclusion</h3><p>So, I know, this wasn’t a big deal, but it took me a couple hours to set this up together and streamline a react app into a widget that easily, so I figured : why not sharing it with you !</p><p>The whole project is available to you on my github @ <a href="https://github.com/nicoraynaud/react-widget">https://github.com/nicoraynaud/react-widget</a></p><p>Enjoy :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c46b7f7999d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inject your SpringBoot app data in Google BigQuery]]></title>
            <link>https://tekinico.medium.com/inject-your-springboot-app-data-in-google-bigquery-759acfb08925?source=rss-200d05ffe3b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/759acfb08925</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[spring-data]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Nicolas Raynaud]]></dc:creator>
            <pubDate>Thu, 15 Oct 2020 14:44:35 GMT</pubDate>
            <atom:updated>2020-10-15T14:44:35.775Z</atom:updated>
            <content:encoded><![CDATA[<h3>Inject your SpringBoot app Data in Google BigQuery</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9W5XNOyh0RrPFW1hHR3kw.png" /></figure><p>We all know data is king ! But to be analyzed, data needs to be injected and centralized in data warehouses first. This tutorial covers a standard use case where you need to extract data from your <a href="https://spring.io/projects/spring-boot">Java SpringBoot</a> application and input it in <a href="https://cloud.google.com/bigquery">Google BigQuery</a> datasets to be later analyzed.</p><p><strong>The use case here is to make a generic set of services or components that can query data from a database and input it in a BigQuery table either by truncating or updating any previous data.</strong></p><h3><strong>1. Generate a simple Spring Boot project</strong></h3><p>For this tutorial to work, I’ll assume you already know how to setup a proper SpringBoot app with a JPA datasource (whatever flavour you feel like…).</p><p>If you use <a href="https://start.spring.io/#!type=gradle-project&amp;language=java&amp;platformVersion=2.3.4.RELEASE&amp;packaging=jar&amp;jvmVersion=11&amp;groupId=com.tekinico&amp;artifactId=data-to-bigquery&amp;name=data-to-bigquery&amp;description=Demo%20project%20for%20Uploading%20data%20to%20BigQuery&amp;packageName=com.tekinico.data-to-bigquery&amp;dependencies=data-jpa,cloud-gcp">Spring initializr</a>, make sure you chose the following dependencies :</p><ul><li>Spring Data JPA</li><li>GCP Support (Google Cloud Platform)</li></ul><h3><strong>2. Create a Google Cloud Platform service account</strong></h3><p>To use Google Cloud Platform from your project, you’ll need valid credentials. The proper way to set this up is by creating a service account dedicated to your app and set its permissions to the only resources it’ll need.</p><p>Here is a tutorial of how to generate a google cloud platform service account :</p><ol><li>In your Google Cloud Platform project, go to “IAM &amp; Admin” / “Service Accounts”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*P4Yco-fcV28G79BWRsr2Dg.png" /></figure><p>2. Click on “Create service account” and name it properly so you’ll understand what it does, just by looking at it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*kRAKVErnnHc7iB2iKbgL-A.png" /></figure><p>3. Select the right permissions that will later allow us to create/update tables in a BigQuery dataset (BigQuery Data Editor and Job User) :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*igXr4OpzP_7anxknghA3Sg.png" /></figure><p>4. Skip the next step (it is not required for this tutorial)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*k3Jqn5NpFUSIE3ypXAwtLg.png" /></figure><p>5. Service Account is created, you will now need to download its access key, that will later be used to configure your app. Click on“Create key”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*wgOwftPHtg-t8LTqbhywpQ.png" /></figure><p>6. Select “JSON” type (this is the default) and “Create”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*zyiRVwlJNHZSpwhbto0Dzw.png" /></figure><p>7. You’ll then be able to download the JSON file for this service account. Make sure you store this file in a secured environment as this represents the credentials of the service account and will allow whoever has it to access your GCP account.</p><h3><strong>3. Create a BigQuery dataset</strong></h3><p>1. Create A BigQuery Dataset that will hold your data. In “BigQuery”, select your project (here spring-boot-to-bigquery), and click “Create Dataset”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSjqKxNjMKUZ0xlR0z5NEw.png" /></figure><p>2. Fill in a name and a location : <em>the choice of the data location is important as it cannot be changed later. Also, if you already have datasets and want to use query across several of them, you need to have them in the same location</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*eCmY_db_jI68JLgjydbSjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS3h81gKoawNqGrx-hD3UA.png" /></figure><p>We know have a dataset named “spring_app”. We’ll use that name later on.</p><h3><strong>4. Setup Spring Boot Google Cloud Platform integration</strong></h3><p>You now should have a project with a <strong>build.gradle</strong> that looks a lot like this :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5be8e072bcae4e6cd7feb2f70bec8ef/href">https://medium.com/media/e5be8e072bcae4e6cd7feb2f70bec8ef/href</a></iframe><p>Well, you’ll need to add another dependency to tell your project that you are going to integrate BigQuery :</p><pre><em>// Integrate with BigQuery<br></em><strong>implementation</strong> &#39;org.springframework.cloud:spring-cloud-gcp-starter-bigquery&#39;</pre><p>And another one to write CSV files more easily :</p><pre><em>// Write CSV Files<br></em><strong>compile</strong> &#39;org.apache.commons:commons-csv:1.8&#39;</pre><p>Now, remember the GCP Service Account json file you downloaded ? You are going to need it now.</p><p>To let Spring know what credentials to use when accessing GCP services, you have several choices (here is the <a href="https://docs.spring.io/spring-cloud-gcp/docs/1.0.0.BUILD-SNAPSHOT/reference/htmlsingle/#_credentials">Spring documentation</a>, or the short version below) :</p><ul><li>Specify an environment variable with the location of the file :</li></ul><pre><strong>GOOGLE_APPLICATION_CREDENTIALS=</strong>/path/to/file.json</pre><ul><li>Embed the json file with your project, and reference it using configuration (assuming you are using application.properties)</li></ul><pre><strong>spring.cloud.gcp.credentials.location=</strong>file:/usr/local/key.json</pre><ul><li>Or specify the file content directly in Base 64 (assuming you are using application.properties):</li></ul><pre><strong>spring.cloud.gcp.credentials.encoded-key=</strong>ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAiaGFyZGJhY29uLTI0MzMyMCIsCiAgInByaXZhdGVfa2V5X2lkIjogIjViZmY5YzQ2NGFlOGIxZjc1ZmU0MTBmNzhkZTY1ZDBmM2M4M2YxZDki....</pre><p>The last way is my favorite since it allows for a quick deployment without any additional file to deploy with your server. Of course, depending on your production environments and your security requirements, you might prefer one the former way.</p><p>By the way, should you chose the last option, here is a command to encode your file in base 64 :</p><pre>$ <strong>cat spring-boot-to-bigquery-a125027b0ed6.json | base64</strong><br><em>ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAic3ByaW5nLWJvb3QtdG8tYmlncXVlcnkiLAogICJwcml2YXRlX2tleV9pZCI6ICJhMTI1MDI3YjBlZDZiMTBmOD…</em></pre><p>Finally, you also need to specify what GCP project your app will be connecting to, and the dataset you’ll be writing data to (the one we created earlier), so your <strong>application.properties</strong> now looks like this :</p><pre><strong>spring.cloud.gcp.project-id=</strong>spring-boot-to-bigquery<br><strong>spring.cloud.gcp.credentials.encoded-key=</strong>ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAic3ByaW5nLWJvb3QtdG8tYmlncXVlcnkiLAogICJwcml2YXRlX2tleV9pZCI6ICJhMTI1MDI3YjBlZDZiMTBmODA3MTUy...<br><strong>spring.cloud.gcp.bigquery.dataset-name=</strong>spring_app</pre><h3><strong>5. The Scenario</strong></h3><p>Here is our data model : We have users. Each of them has one device and may have subscriptions.</p><blockquote>The stat we want to extract is the number of subscriptions per Operating System to answer the mighty question : are iOS users buying more than Android’s ?.</blockquote><p>This data will be better stored and analyzed in BigQuery, and not directly on our production database. So what we need is to do is extract enough data to be stored in BigQuery, and do our reporting from there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*QqdWoAahOTfYYR9KT9eD_A.png" /></figure><p>Obviously, we don’t need not the whole DB to compute our statistic. Here I think we’ll just need to extract the subscriptions, the date they’re bought and the OS of the device associated to the user making the transaction. So our target data schema will be : (note that we are extracting the date so that we can track the evolution of subscriptions over time).</p><pre>subscriptionId (NUMERIC)<br>dateBought (DATE)<br>deviceOS (STRING)</pre><h3><strong>5. How to do it</strong></h3><p>By default, in a free tiers GCP account, the only way to inject data in BigQuery is through file input. Inputing data as objects, one by one, using the API is only available to paid tiers. <br>So, our example will make use of CSV files to inject data in bulk into data tables.</p><p>Basically we will :</p><ul><li>Query for data using a JDBCTemplate</li><li>Read the results into a CSV file</li><li>Inject the CSV file into BigQuery</li></ul><h3><strong>6. The SQL Query and creation of a CSV File</strong></h3><p>This is a basic process, but i’ll give you my code just in case it can help someone going through the same process…</p><p>Here is the query we need to use to extract sufficient data.</p><pre><strong>SELECT</strong> s.id as subscriptionId, s.dateBought, d.OS as deviceOS <br><strong>FROM</strong> subscription s <strong>INNER</strong> <strong>JOIN</strong> device d <strong>ON</strong> d.user_id = s.user_id;</pre><p>So now, let’s create a service that takes that query, a schema and produces a CSV file containing the data :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c7b1b4b33a7299c63d5f5a944a23c2f/href">https://medium.com/media/6c7b1b4b33a7299c63d5f5a944a23c2f/href</a></iframe><p>Of course, all the magic is in the `CsvResultSetExtractor` :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f7dd9b1e268078b45e8c079f3b898ed/href">https://medium.com/media/1f7dd9b1e268078b45e8c079f3b898ed/href</a></iframe><blockquote>This class takes a JDBCTemplate ResultSet and converts it into a flat CSV file using Apache Commons CSV library. It uses a schema provided as a list of Pairs containing the column names and their datatype. I have chosen to use the standard SQL datatypes names such as “NUMERIC”, “DATE” and “STRING”. You could extend do any type you like and probably use enums and a better error handling, but that’s not the point of this post !</blockquote><p>So, now, we are able to extract any query from the DB into a CSV file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2022a32613c9aee14da1f93909e136cd/href">https://medium.com/media/2022a32613c9aee14da1f93909e136cd/href</a></iframe><h3><strong>7. Implement a BigQuery Connector</strong></h3><p>We will create a service that accepts CSV files with a schema as input, and upload it on our BigQuery dataset, creating the data table matching the schema if not existing.</p><p>This is pretty straightforward once you know what setting to use !</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5be10e35e0e0e24bacba4d4bf72d9a8/href">https://medium.com/media/e5be10e35e0e0e24bacba4d4bf72d9a8/href</a></iframe><p>And that’s it !</p><p>Now we can chain those two calls and create a BigQuery data table from an SQL query.</p><p>Of course you can use either part of this process to produce custom CSV files or input data to BigQuery coming from any source, considering it takes plain old CSV files as input !</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d63ca1d161c7ec019284ed6b8e6b0a2f/href">https://medium.com/media/d63ca1d161c7ec019284ed6b8e6b0a2f/href</a></iframe><h3><strong>8. See the result !</strong></h3><p>After running the service, it will show the new table in your BigQuery dataset :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*pU4ezpv0EN8WocWYggI5SQ.png" /></figure><h3><strong>9. Conclusions and going forward</strong></h3><p>While it might not be the most beautiful and neat way to extract data from your app to BigQuery, it layouts the basics of how to do so without much pain.</p><p>Once these services are setup, why not use Spring Batch to schedule such an export. You could then schedule these data updates to have up to date data in your BigQuery dataset flawlessly.</p><p>You could also date your SQL queries (add a date parameter) and chose not to truncate BigQuery data tables when uploading : this would for sure improve speed and efficiency of the whole process since the current code will probably suffer from memory issues when your data reach a certain size.</p><p>You can find the code in my GitHub repo here <a href="https://github.com/nicoraynaud/data-to-bigquery">https://github.com/nicoraynaud/data-to-bigquery</a>. Feel free to comment or let me know whether I can improve or correct this to better help anyone who faced the same task !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=759acfb08925" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>