If the barcode is generated based on unique number of the entity, should we store the barcode image in database ? Or should we use javascript libraries to draw barcode whenever necessary?
Should we store barcode in database?
2.6k views Asked by Tej Patil At
2
There are 2 answers
0
Hugo Ferreira
On
Store barcode image is not necessary and will full your database with data that will be obsolet soon and will be stored for ever. in addition, barcode is not requested every time user request the page. and also don't consume a lot of cpu to be drawn. So, it's best you save just the number and just if user request, you draw the image. this way. you'll keep your database light.
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in PHP
- How to add the dynamic new rows from my registration form in my database?
- Issue in payment form gateway
- How to create a facet for WP gridbuilder that displays both parent and child custom fields?
- Function in anonymous Laravel Blade component
- How to change woocomerce or full wordpress currency with value from USD to AUD
- General questions about creating a custom theme Moodle CMS
- How to add logging to an abstract class in php
- error 500 on IIS FastCGI but no clue despite multiple error loggings activated
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Laravel: Using belongsToMany relationship with MongoDB
- window.location.href redirects but is causing problems on the webpage
- Key provided is shorter than 256 bits, only 64 bits provided
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
Related Questions in MYSQL
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to change woocomerce or full wordpress currency with value from USD to AUD
- window.location.href redirects but is causing problems on the webpage
- Error: local variable 'bramka' referenced before assignment
- Products aren't displayed after fetching data from mysql db (node.js & express)
- status table for all entries (even in different dates) in database changing value when all checkboxes are checked
- Can't Fix Mariadb & Mysql ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) On MacOs
- Express Mysql getting max ID from table not working cought in a promise
- failed to upload a table from sql file
- Update a MySQL row depending on the ID in Google Sheets Apps Script
- Use row values from another table to select them as columns and establish relations between them (pivot table)
- SQL: Generate combination table based on source and destination column from same table
- How to display the column names which have only unique non-null values in MySQL table?
- mysql query takes too long because of wrong indexes usage
- Multitable joining in Sql
Related Questions in BARCODE
- How do I generate a Codabar barcode in Swift?
- Zxing lib refuses to recognize QR code at all
- Trying to convert an image to a Stream for use with Spire.Barcode ScanStream functionality
- Flutter - get data from embedded barcode scanner
- Using flutter how to get scan code from hand held device
- Printing BarCode Fail c# winform and zen.barcode framework
- Barcode detection from an image on server side (particularly on node.js)
- Flutter RawKeybardListener returns only space before Android 11 devices
- Blazor Hybrid App: Error "object DOMException" with Barcode Reader
- Reading barcode in an ios application in .net8 without maui
- Print Code 128 (GS1) with Zebra/Bixolon printer
- Barcode to webform, webform prefilled depending on barcode
- Xamarin Forms : byte[] to image , save the iamge in device and open it again
- ZXing.NET UPC_A Extensions
- how to limit the barcode scanning area
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If you can generate the barcode on the fly then I would advise storing the code rather then an image.
My reasoning for this is as follows:
You will take up less space in the server's database.
You will use less internet bandwidth by serving a simple number verses an image.
Even if you reduce the image colour palette to monochrome and compress the image. A primitive type (i.e. strings,integers...) will take fewer bytes than an image.
The code for storing a number will be a lot less complex than storing an image.
Operations can be performed on numbers later. For example you could use the data for processing. If you need to change the IDs then the operation will be a lot simpler than regenerating all of the images in your database. You could also do more complex queries in the future with that number and you could use it to tie information together in a relational database.