Comments (4)
After some research and especially this article on medium, I recommend using UUID as PK.
Of course, compared to auto-increment keys or composite keys there are downsides like performance loss and the increased storage required. However, we can generate the UUID outside of the chaincode and its a create benefit to have a "globally" unique identifier in distributed systems.
I vote for UUID as pk.
What do other folks think about this?
Another scenrio could be to use auto-incremented integers as pk and UUID as a second identifier.
from blockchain-carbon-accounting.
I've gotten a working example of this going this morning. I don't have an opinion on whether we use PK or UUID, as the logic will basically be the same except for that one value. This will leave it flexible in the future, but just a few questions:
-
For the query of ONE emission, would it require all of the same fields and then return the result ONLY unique to that?
-
For querying ALL emissions, we can have any combination of values passed in (for example, utility id only, or perhaps utility ID AND user_id, etc), and it will return all entries that match those fields. Does this sound correct? This gives a super flexible, powerful, and reusable query that we can inherit from on other channels/cc.
from blockchain-carbon-accounting.
I am also looking at this for generating UUIDs: https://www.npmjs.com/package/uuid
from blockchain-carbon-accounting.
- To query one emission should only require the UUID key
- Yes, to query a list of emissions, use all the same current parameters to return a list of the emissions.
from blockchain-carbon-accounting.
Related Issues (20)
- request emissions audit UI allow other request, supported by document HOT 1
- Add dataLoader scripts for product table HOT 1
- Calculation error for emission factor & unit consistency. HOT 2
- Dynamic loading of node-fetch
- separate deploy js for carbon tracker HOT 2
- remove open zeppelin contract upgradability HOT 1
- Create a MAINTAINERS.md file HOT 1
- Remove upgradability from CarbonTracker HOT 4
- loading of oil and gas data HOT 2
- Using Google travel impact model
- Adopt Typescript 3.0 references and composite tsconfig.json setting?
- Private Key exposure during Wallet signup HOT 4
- scripts and documentation for deploying Fabric chain code using Bevel
- scripts and documentation for deploying Solidity smart contracts to Besu using Bevel
- UI to select multiple data points for an audited emissions certificate HOT 4
- Disallow operations on the network with server side stored private key HOT 14
- deploy solidity contracts locally with bevel scripts HOT 1
- Link to Voluntary Offsets Directory is broken HOT 5
- not able to issue carbon tracker tokens HOT 1
- problem loading oil and gas data HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockchain-carbon-accounting.